Submission #980534

#TimeUsernameProblemLanguageResultExecution timeMemory
980534vjudge1Hexagonal Territory (APIO21_hexagon)C++17
9 / 100
1 ms604 KiB
#include "hexagon.h" #include<bits/stdc++.h> #define sz size() #define ll long long using namespace std; const ll M = 1e9 + 7; int draw_territory(int N, int A, int B, vector<int> D, vector<int> L) { ll l = L[0] + 1; ll ans = 0; if(l % 3 == 0) ans = l / 3 * (l - 1) % M * (l + 1) % M; if(l % 3 == 1) ans = (l - 1) / 3 * l % M * (l + 1) % M; if(l % 3 == 2) ans = (l + 1) / 3 * l % M * (l - 1) % M; ans = ans * B % M; ll res = 0; res = l * (l + 1) / 2 % M * (ll)A % M; res = (res + ans) % M; return int(res); } //void solve() //{ //} // //signed main() //{ // ios_base::sync_with_stdio(0); // cin.tie(0), cout.tie(0); //// solve(); //}
#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...