#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9+7;
int n,m,k,x,y,z;
int ar[1005][1005];
char ch;
int main() {
cin >> n >> m >> k;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
ar[i][j] = ++x;
}
}
for (int i = 1; i <= k; i++) {
cin >> ch >> x >> y;
if (ch == 'R') {
for (int i = 1; i <= m; i++) ar[x][i] *= y, ar[x][i] %= mod;
} else {
for (int i = 1; i <= n; i++) ar[i][x] *= y, ar[i][x] %= mod;
}
}
int ans = 0;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) ans += ar[i][j];
}
cout << (ans % mod) << "\n";
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
468 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
1620 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
1364 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
596 KB |
Output isn't correct |
5 |
Incorrect |
3 ms |
3668 KB |
Output isn't correct |
6 |
Incorrect |
2 ms |
1236 KB |
Output isn't correct |
7 |
Incorrect |
5 ms |
3540 KB |
Output isn't correct |
8 |
Incorrect |
3 ms |
3412 KB |
Output isn't correct |
9 |
Incorrect |
3 ms |
2004 KB |
Output isn't correct |
10 |
Incorrect |
3 ms |
2004 KB |
Output isn't correct |
11 |
Runtime error |
49 ms |
8396 KB |
Execution killed with signal 11 |
12 |
Runtime error |
87 ms |
8360 KB |
Execution killed with signal 11 |
13 |
Runtime error |
29 ms |
8360 KB |
Execution killed with signal 11 |
14 |
Runtime error |
95 ms |
8416 KB |
Execution killed with signal 11 |
15 |
Runtime error |
90 ms |
8384 KB |
Execution killed with signal 11 |
16 |
Runtime error |
11 ms |
8404 KB |
Execution killed with signal 11 |
17 |
Runtime error |
15 ms |
8428 KB |
Execution killed with signal 11 |
18 |
Runtime error |
11 ms |
8404 KB |
Execution killed with signal 11 |
19 |
Runtime error |
15 ms |
8404 KB |
Execution killed with signal 11 |
20 |
Runtime error |
10 ms |
8348 KB |
Execution killed with signal 11 |