Submission #995013

#TimeUsernameProblemLanguageResultExecution timeMemory
995013thelegendary08Hexagonal Territory (APIO21_hexagon)C++14
3 / 100
1 ms440 KiB
#include "hexagon.h" #include<bits/stdc++.h> #define ll long long int 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 n = L[0] + 1; ll sz = n * (n + 1)/2; sz %= mod; n--; ll sdist = 0; sdist += n * (n+1) % mod * (2*n+1) % mod / 6 % mod; sdist += n * (n+1) / 2 % mod; sdist %= mod; ll ans = (sz * A % mod) + (sdist * 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...