# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
570036 | 2022-05-28T13:19:45 Z | 600Mihnea | Nuclearia (CEOI15_nuclearia) | C++17 | 415 ms | 1048576 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; signed main() { ios::sync_with_stdio(0); cin.tie(0); freopen ("input.txt", "r", stdin); int n, m; cin >> n >> m; vector<vector<ll>> radiation(n + 1, vector<ll> (m + 1, 0)); int ops; cin >> ops; for (int i = 1; i <= ops; i++) { int r1, c1, a, b; cin >> r1 >> c1 >> a >> b; for (int r = 1; r <= n; r++) { for (int c = 1; c <= m; c++) { int dist = max(abs(r - r1), abs(c - c1)); radiation[r][c] += max(0LL, a - 1LL * b * dist); } } } { /// transform the radiation in the form of prefix rectangle sum for (int i = 1; i <= n; i++) { ll cur = 0; for (int j = 1; j <= m; j++) { cur += radiation[i][j]; radiation[i][j] = radiation[i - 1][j] + cur; } } } int q; cin >> q; while (q--) { int r1, c1, r2, c2; cin >> r1 >> c1 >> r2 >> c2; ll total = radiation[r2][c2] - radiation[r1 - 1][c2] - radiation[r2][c1 - 1] + radiation[r1 - 1][c1 - 1]; ll area = (r2 - r1 + 1) * (c2 - c1 + 1); cout << round((long double) total / (long double) area) << "\n"; } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 371 ms | 1048576 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 368 ms | 1048576 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 415 ms | 1048576 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 636 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 393 ms | 1048576 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 378 ms | 1048576 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 403 ms | 1048576 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 367 ms | 1048576 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 468 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 596 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 596 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 403 ms | 1048576 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 389 ms | 1048576 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 378 ms | 1048576 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |