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>
#define pb push_back
#define ios ios::sync_with_stdio(0);cin.tie(0);
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
const int MAX = 2e5 + 5;
int draw_territory(int N, int A, int B,vector<int> D, vector<int> L){
ll ans = ((((L[0] + 1) * 1LL * (L[0] + 2)) / 2) % mod);
ans *= A;
ans %= mod;
for(int i=0;i<(L[0] + 1);i++){
ans += (((i * (i + 1)) % mod) * B) % mod;
ans %= mod;
}
sort(L.begin(),L.end());
assert(L[0] == L.back());
return ans;
}
# | 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... |