Submission #631611

#TimeUsernameProblemLanguageResultExecution timeMemory
631611Justin1Automobil (COCI17_automobil)C++14
0 / 100
95 ms8428 KiB
#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"; }
#Verdict Execution timeMemoryGrader output
Fetching results...