Submission #981713

#TimeUsernameProblemLanguageResultExecution timeMemory
981713IUA_HasinHexagonal Territory (APIO21_hexagon)C++17
9 / 100
1 ms500 KiB
#include "hexagon.h" #include <bits/stdc++.h> #define ll long long using namespace std; const ll mod = 1e9+7; int draw_territory(int N, int A, int B, std::vector<int> D, std::vector<int> L) { ll len = L[0]+1; ll count = ((len)*(len+1))/2; count = count%mod; ll a1 = len-1; ll a2 = len; ll a3 = len+1; if(a1%3==0){ a1 = a1/3; } else if(a2%3==0){ a2 = a2/3; } else { a3 = a3/3; } ll d = a1*a2; d = d%mod; d = d*a3; d = d%mod; ll a = d*B; a = a%mod; ll b = count*A; b = b%mod; ll ans = a+b; ans = ans%mod; //cout << len << " " << count << " " << d << " " << a << " " << b << " " << ans << endl; 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...