| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 631611 | Justin1 | Automobil (COCI17_automobil) | C++14 | 95 ms | 8428 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
