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;
const int MOD = 1e9 + 7;
int draw_territory(int N, int A, int B, vector<int> D, vector<int> L) {
int res = 0;
long long K = L[1] + 1;
K = K * (K + 1) / 2;
K = (K % MOD) * A; K %= MOD;
long long J = L[1];
J = ((J * (J + 1)) % MOD) * (((2 * J + 1) / 6) % MOD);
J %= MOD; J *= B; J %= MOD;
K += J; K %= MOD;
return res = K;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |