Submission #555477

#TimeUsernameProblemLanguageResultExecution timeMemory
555477joelauHexagonal Territory (APIO21_hexagon)C++14
9 / 100
1 ms340 KiB
#include "hexagon.h" #include <bits/stdc++.h> using namespace std; long long m = 1000000007; long long fastexp (long long a, long long b) { long long ans = 1; while (b) { if (b & 1) ans = ans * a % m; a = a * a % m; b >>= 1; } return ans; } int draw_territory(int N, int A, int B, vector<int> D, vector<int> L) { return ((long long) (A-B+m) * (L[0]+1) % m * (L[0]+2) % m * fastexp(2,m-2) + (long long) B * (L[0]+1) % m * (L[0]+2) % m * (L[0]*2+3) % m * fastexp(6,m-2)) % m; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...