Submission #536503

#TimeUsernameProblemLanguageResultExecution timeMemory
536503smessarisHexagonal Territory (APIO21_hexagon)C++14
3 / 100
1704 ms472 KiB
#include<bits/stdc++.h> #define pb push_back #define ios ios::sync_with_stdio(0);cin.tie(0); using namespace std; using ll = long long; const int mod = 1e9 + 7; const int MAX = 2e5 + 5; int draw_territory(int N, int A, int B,vector<int> D, vector<int> L){ ll ans = ((((L[0] + 1) * 1LL * (L[0] + 2)) / 2) % mod); ans *= A; ans %= mod; for(int i=0;i<(L[0] + 1);i++){ ans += (((i * (i + 1)) % mod) * B) % mod; ans %= mod; } sort(L.begin(),L.end()); assert(L[0] == L.back()); 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...