#include <bits/stdc++.h>
#ifndef MIKU
#include "wombats.h"
#endif
using namespace std;
#ifdef MIKU
string dbmc = "\033[1;38;2;57;197;187m", dbrs = "\033[0m";
#define debug(x...) cout << dbmc << "[" << #x << "]: ", dout(x)
void dout() { cout << dbrs << endl; }
template <typename T, typename ...U>
void dout(T t, U ...u) { cout << t << (sizeof...(u) ? ", " : ""); dout(u...); }
#else
#define debug(...) 39
#endif
#define fs first
#define sc second
#define mp make_pair
#define FOR(i, j, k) for (int i = j, Z = k; i < Z; i++)
using ll = long long;
typedef pair<int, int> pii;
namespace {
const int MXN = 5005, MXM = 200;
int a[MXN], sum;
}
void init(int R, int C, int H[][200], int V[][200]) {
FOR(i, 0, R - 1) {
a[i] = V[i][0];
sum += a[i];
}
}
void changeH(int P, int Q, int W) {
}
void changeV(int P, int Q, int W) {
sum -= a[P];
a[P] = W;
sum += a[P];
}
int escape(int V1, int V2) {
return sum;
}
#ifdef MIKU
int h[MXN][MXM], v[MXN][MXM];
void miku() {
int n, m;
cin >> n >> m;
FOR(i, 0, n) FOR(j, 0, m - 1) cin >> h[i][j];
FOR(i, 0, n - 1) FOR(j, 0, m) cin >> v[i][j];
init(n, m, h, v);
int e;
cin >> e;
while (e--) {
int t;
cin >> t;
if (t == 1) {
int p, q, w;
cin >> p >> q >> w;
changeH(p, q, w);
} else if (t == 2) {
int p, q, w;
cin >> p >> q >> w;
changeV(p, q, w);
} else {
int v1, v2;
cin >> v1 >> v2;
cout << escape(v1, v2) << '\n';
}
}
}
int32_t main() {
cin.tie(0) -> sync_with_stdio(false);
cin.exceptions(cin.failbit);
miku();
return 0;
}
#endif
Compilation message
grader.c: In function 'int main()':
grader.c:15:6: warning: variable 'res' set but not used [-Wunused-but-set-variable]
15 | int res;
| ^~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4696 KB |
Output is correct |
2 |
Correct |
2 ms |
4700 KB |
Output is correct |
3 |
Correct |
55 ms |
7520 KB |
Output is correct |
4 |
Correct |
1 ms |
4696 KB |
Output is correct |
5 |
Correct |
2 ms |
4700 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
448 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Incorrect |
1 ms |
2396 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
2652 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
8284 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
2652 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
2652 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |