#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9+7;
#define FOR(i,a,b) for(ll i = a;i < b;i++)
#define pb push_back
#define vll vector<ll>
#define f first
#define s second
#define all(x) (x).begin(), (x).end()
#include "hexagon.h"
int draw_territory(int N, int A, int B,std::vector<int> D, std::vector<int> L){
ll ans = ((((L[0] + 1) * 1LL * (L[0] + 2)) / 2) % mod);
ans *= A;
ans %= mod;
FOR(i,0,L[0] + 1)
{
ans += (((i * (i + 1)) % mod) * B) % mod;
ans %= mod;
}
sort(all(L));
assert(L[0] == L.back());
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1454 ms |
272 KB |
Output is correct |
2 |
Correct |
1523 ms |
284 KB |
Output is correct |
3 |
Correct |
1 ms |
216 KB |
Output is correct |
4 |
Correct |
1 ms |
216 KB |
Output is correct |
5 |
Correct |
0 ms |
216 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1521 ms |
276 KB |
Output is correct |
2 |
Correct |
1480 ms |
284 KB |
Output is correct |
3 |
Correct |
1496 ms |
288 KB |
Output is correct |
4 |
Correct |
1463 ms |
276 KB |
Output is correct |
5 |
Correct |
1 ms |
216 KB |
Output is correct |
6 |
Correct |
1 ms |
216 KB |
Output is correct |
7 |
Correct |
0 ms |
216 KB |
Output is correct |
8 |
Correct |
1 ms |
304 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1535 ms |
276 KB |
Output is correct |
2 |
Correct |
1474 ms |
280 KB |
Output is correct |
3 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1590 ms |
280 KB |
Output is correct |
2 |
Correct |
1596 ms |
284 KB |
Output is correct |
3 |
Correct |
1687 ms |
284 KB |
Output is correct |
4 |
Correct |
1790 ms |
276 KB |
Output is correct |
5 |
Incorrect |
365 ms |
284 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
468 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |