Submission #44566

# Submission time Handle Problem Language Result Execution time Memory
44566 2018-04-03T09:52:39 Z heon Automobil (COCI17_automobil) C++11
0 / 100
2 ms 624 KB
#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 time Memory Grader output
1 Runtime error 2 ms 248 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Runtime error 1 ms 248 KB Execution killed with signal 11 (could be triggered by violating memory limits)
3 Runtime error 1 ms 320 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Runtime error 2 ms 336 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Runtime error 2 ms 412 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 1 ms 428 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 1 ms 452 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 1 ms 528 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Runtime error 1 ms 528 KB Execution killed with signal 11 (could be triggered by violating memory limits)
10 Runtime error 2 ms 624 KB Execution killed with signal 11 (could be triggered by violating memory limits)
11 Runtime error 1 ms 624 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Runtime error 1 ms 624 KB Execution killed with signal 11 (could be triggered by violating memory limits)
13 Runtime error 1 ms 624 KB Execution killed with signal 11 (could be triggered by violating memory limits)
14 Runtime error 1 ms 624 KB Execution killed with signal 11 (could be triggered by violating memory limits)
15 Runtime error 1 ms 624 KB Execution killed with signal 11 (could be triggered by violating memory limits)
16 Runtime error 1 ms 624 KB Execution killed with signal 11 (could be triggered by violating memory limits)
17 Runtime error 1 ms 624 KB Execution killed with signal 11 (could be triggered by violating memory limits)
18 Runtime error 2 ms 624 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Runtime error 1 ms 624 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Runtime error 1 ms 624 KB Execution killed with signal 11 (could be triggered by violating memory limits)