| Task: | Ruudukko |
| Sender: | ollpu |
| Submission time: | 2025-12-20 15:27:40 +0200 |
| Language: | C++ (C++20) |
| Status: | READY |
| Result: | 100 |
| group | verdict | score |
|---|---|---|
| #1 | ACCEPTED | 13 |
| #2 | ACCEPTED | 36 |
| #3 | ACCEPTED | 51 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
| #2 | ACCEPTED | 0.01 s | 2, 3 | details |
| #3 | ACCEPTED | 0.11 s | 3 | details |
Code
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#define D(x) {x;}
#else
#define D(x)
#endif
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
const ll M = 1e9+7;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin.exceptions(cin.failbit);
int n;
cin >> n;
ll res = 0;
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
ll a;
cin >> a;
res += a * ll(i + 1) * (j + 1) %M * (n-i) * (n-j) % M;
res %= M;
}
}
cout << res << endl;
}
Test details
Test 1
Group: 1, 2, 3
Verdict: ACCEPTED
| input |
|---|
| 10 647761 970495 559170 744364 38... |
| correct output |
|---|
| 124914206 |
| user output |
|---|
| 124914206 |
Test 2
Group: 2, 3
Verdict: ACCEPTED
| input |
|---|
| 100 599900 828824 239920 576308 48... |
| correct output |
|---|
| 247718517 |
| user output |
|---|
| 247718517 |
Test 3
Group: 3
Verdict: ACCEPTED
| input |
|---|
| 1000 130197 933179 613820 209261 72... |
| correct output |
|---|
| 395488302 |
| user output |
|---|
| 395488302 |
