| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 971920 | vjudge1 | Automobil (COCI17_automobil) | C++17 | 1062 ms | 15964 KiB | 
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define MOD 1000000007
ll n, m, k;
ll power(ll a, ll b) {
    ll res = 1;
    while (b > 0) {
        if (b & 1) {
            res = (res * a) % MOD;
        }
        a = (a * a) % MOD;
        b >>= 1;
    }
    return res;
}
int main() {
    cin >> n >> m >> k;
    vector<ll> row(n + 1, 1), col(m + 1, 1);
    while (k--) {
        char type;
        ll x, y;
        cin >> type >> x >> y;
        if (type == 'R') {
            row[x] = (row[x] * y) % MOD;
        } else {
            col[x] = (col[x] * y) % MOD;
        }
    }
    ll sum = 0;
    for (ll i = 1; i <= n; i++) {
        for (ll j = 1; j <= m; j++) {
            sum = (sum + ((i*m + j - m) * row[i] % MOD * col[j] % MOD)) % MOD;
        }
    }
    cout << sum << "\n";
    return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
