Submission #718614

#TimeUsernameProblemLanguageResultExecution timeMemory
718614lamHexagonal Territory (APIO21_hexagon)C++14
0 / 100
1 ms304 KiB
#include "hexagon.h" #include <bits/stdc++.h> #include <vector> #define int long long using namespace std; const int mod = 1e9 + 7; int ppow(int x, int y) { int temp = 1LL; while (y>0) { if (y&1) temp=temp*x%mod; x=x*x%mod; y/=2; } return temp; } int32_t draw_territory(int32_t N, int32_t A, int32_t B, std::vector<int32_t> D, std::vector<int32_t> L) { int dist = L[0]; int ans = dist*(dist+2)%mod*(dist+1)%mod*ppow(3LL,mod-2)%mod; ans = ((dist+1)*A + ans*B%mod)%mod; return ans; }
#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...