Submission #692085

#TimeUsernameProblemLanguageResultExecution timeMemory
692085Dan4LifeHexagonal Territory (APIO21_hexagon)C++17
3 / 100
1 ms212 KiB
#include "hexagon.h" #include <bits/stdc++.h> using namespace std; using ll = long long; const ll MOD = (ll)1e9+7; int poww(int a, int b){ if(b==0) return 1; int x = poww(a,b/2); x*=x,x%=MOD; if(b&1)x*=a,x%=MOD; return x; } int draw_territory(int N, int A, int B, vector<int> D, vector<int> L) { ll l = L[0]+1; ll ans = (l*(l+1)/2ll)%MOD; ans*=A, ans%=MOD; l--; ans+=(((2*l*l)%MOD)*B)%MOD; return ans%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...