#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1000000007;
int main()
{
ll n,m,k;cin>>n>>m>>k;
vector<vector<ll>>arr(n,vector<ll>(m));
ll u=1;
for(ll i=0;i<n;i++){
for(ll j=0;j<m;j++){
arr[i][j]=(u++);
}
}
while(k--){
char c;
ll x,y;cin>>c>>x>>y;
if(c=='R'){
for(ll i=0;i<m;i++){
arr[x-1][i]*=y;
arr[x-1][i]%=mod;
}
}
else{
for(ll i=0;i<n;i++){
arr[i][x-1]*=y;
arr[i][x-1]%=mod;
}
}
}
ll ans=0;
for(ll i=0;i<n;i++){
for(ll j=0;j<m;j++){
ans+=arr[i][j];
}
}
cout<<ans<<endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
716 KB |
Output isn't correct |
2 |
Incorrect |
7 ms |
2900 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
844 KB |
Output isn't correct |
4 |
Incorrect |
3 ms |
460 KB |
Output isn't correct |
5 |
Incorrect |
6 ms |
3532 KB |
Output isn't correct |
6 |
Incorrect |
3 ms |
1868 KB |
Output isn't correct |
7 |
Incorrect |
8 ms |
3660 KB |
Output isn't correct |
8 |
Incorrect |
3 ms |
1740 KB |
Output isn't correct |
9 |
Incorrect |
7 ms |
2856 KB |
Output isn't correct |
10 |
Incorrect |
9 ms |
3764 KB |
Output isn't correct |
11 |
Runtime error |
34 ms |
65540 KB |
Execution killed with signal 9 |
12 |
Runtime error |
35 ms |
65540 KB |
Execution killed with signal 9 |
13 |
Runtime error |
34 ms |
65540 KB |
Execution killed with signal 9 |
14 |
Runtime error |
34 ms |
65540 KB |
Execution killed with signal 9 |
15 |
Runtime error |
35 ms |
65540 KB |
Execution killed with signal 9 |
16 |
Runtime error |
35 ms |
65540 KB |
Execution killed with signal 9 |
17 |
Runtime error |
37 ms |
65540 KB |
Execution killed with signal 9 |
18 |
Runtime error |
35 ms |
65540 KB |
Execution killed with signal 9 |
19 |
Runtime error |
35 ms |
65540 KB |
Execution killed with signal 9 |
20 |
Runtime error |
36 ms |
65540 KB |
Execution killed with signal 9 |