#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 |
1 |
Correct |
1586 ms |
288 KB |
Output is correct |
2 |
Correct |
1601 ms |
276 KB |
Output is correct |
3 |
Correct |
1 ms |
304 KB |
Output is correct |
4 |
Correct |
1 ms |
216 KB |
Output is correct |
5 |
Correct |
1 ms |
216 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1615 ms |
280 KB |
Output is correct |
2 |
Correct |
1642 ms |
212 KB |
Output is correct |
3 |
Incorrect |
1563 ms |
284 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
436 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1704 ms |
292 KB |
Output is correct |
2 |
Correct |
1656 ms |
288 KB |
Output is correct |
3 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
468 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1659 ms |
280 KB |
Output is correct |
2 |
Correct |
1613 ms |
276 KB |
Output is correct |
3 |
Incorrect |
1632 ms |
284 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
472 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |