Submission #727188

#TimeUsernameProblemLanguageResultExecution timeMemory
727188SanguineChameleonHexagonal Territory (APIO21_hexagon)C++17
9 / 100
1 ms304 KiB
#include "hexagon.h" #include <bits/stdc++.h> using namespace std; const long long mod = 1e9 + 7; const long long one_half = (mod + 1) / 2; const long long one_third = (mod + 1) / 3; int draw_territory(int N, int A, int B, vector<int> D, vector<int> L) { if (N == 3) { int len = L[0] + 1; long long A_sum = 1LL * len * (len + 1) % mod * one_half % mod; long long B_sum = 1LL * len * (len - 1) % mod * one_half % mod + (len - 1) * len % mod * (len * 2 - 1) % mod * one_half % mod * one_third % mod; return (A_sum * A + B_sum * B) % mod; } return 0; }
#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...