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 long long md = 1e9 + 7;
int draw_territory(int N, int A, int B, vector<int> D, vector<int> L) {
long long len = L[0];
long long s1 = 0, s2 = 0;
for(int i = 1; i <= len; i++){
s1 = (s1 + (((i * 1ll) * ((i + 1) * 1ll)) % md)) % md;
s2 = (s2 + i + 1) % md;
}
s1 = (s1 * (A * 1ll)) % md;
s2 = (s2 * (B * 1ll)) % md;
s2 = (s2 + (B * 1ll)) % md;
return (s1 + s2) % md;
}
# | 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... |