Submission #466524

#TimeUsernameProblemLanguageResultExecution timeMemory
466524rainboyHexagonal Territory (APIO21_hexagon)C++17
9 / 100
1 ms280 KiB
#include "hexagon.h" #include <vector> using namespace std; typedef vector<int> vi; const int MD = 1000000007, V2 = 500000004, V6 = 166666668; int choose2(int n) { return (long long) n * (n - 1) % MD * V2 % MD; } int choose3(int n) { return (long long) n * (n - 1) % MD * (n - 2) % MD * V6 % MD; } int draw_territory(int n, int a, int b, vi dd, vi ll) { int c = choose2(ll[0] + 2), d = choose3(ll[0] + 2) * 2 % MD; return ((long long) c * a + (long long) d * b) % MD; }
#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...