Submission #743370

#TimeUsernameProblemLanguageResultExecution timeMemory
743370onebit1024Hexagonal Territory (APIO21_hexagon)C++17
3 / 100
1 ms292 KiB
#include "hexagon.h" #define ll long long #include <vector> ll mod = 1e9+7; ll ma(ll a, ll b){ return (a+b)%mod; } ll mm(ll a, ll b){ return (a*b)%mod; } int draw_territory(int N, int A, int B, std::vector<int> D, std::vector<int> L) { ll k = L[0]-2; if(L[0]<=2)return mm(A,L[0]*3)%mod; ll fr = mm(L[0],3),sr=0; if(k%2)sr = mm((k+1)/2,k); else sr = mm(k/2,k+1); return mm(A,ma(sr,fr))%mod; }
#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...