Submission #44566

#TimeUsernameProblemLanguageResultExecution timeMemory
44566heonAutomobil (COCI17_automobil)C++11
0 / 100
2 ms624 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 10001; // kad stavis 1001 compilea, 10001 compilea al sa errorom, 100k+1 nece compileat uopce a trebaju bit dimenzije 1 mil x 1 mil da bi dobio sve bodove... ll DIV = 1e9 + 7; ll matrica[MAXN][MAXN]; ll sum = 0, help = 1; ll red,stup,k; char up; ll num1,num2; int main(){ cin >> red >> stup >> k; for(int i = 0; i < red; i++){ for(int j = 0; j < stup; j++){ sum += help; matrica[i][j] = help; help++; help %= DIV; sum %= DIV; } } for(int i = 0; i < k; i++){ cin >> up >> num1 >> num2; num1--; if(up == 'R'){ for(int j = 0; j < stup; j++){ sum -= matrica[num1][j]; matrica[num1][j] *= num2; matrica[num1][j] %= DIV; sum += matrica[num1][j]; } } else{ for(int j = 0; j < red; j++){ sum -= matrica[j][num1]; matrica[j][num1] *= num2; matrica[j][num1] %= DIV; sum += matrica[j][num1]; } } } cout << sum % DIV; }
#Verdict Execution timeMemoryGrader output
Fetching results...