Submission #934683

#TimeUsernameProblemLanguageResultExecution timeMemory
934683MinaRagy06Hexagonal Territory (APIO21_hexagon)C++17
9 / 100
1 ms348 KiB
#include <bits/stdc++.h> #ifdef MINA #include "grader.cpp" #endif #include "hexagon.h" using namespace std; #define ll long long const int mod = 1e9 + 7; int draw_territory(int n, int a, int b, vector<int> d, vector<int> l) { ll sz = l[0] + 1; ll v1 = 1ll * sz * (sz + 1) / 2 % mod * a % mod; ll v2 = 0; if ((sz - 1) % 3 == 0) { v2 = (sz - 1) / 3; v2 = 1ll * v2 * sz % mod * (sz + 1) % mod; } else if (sz % 3 == 0) { v2 = sz / 3; v2 = 1ll * v2 * (sz - 1) % mod * (sz + 1) % mod; } else { v2 = (sz + 1) / 3; v2 = 1ll * v2 * (sz - 1) % mod * sz % mod; } v2 = 1ll * v2 * b % mod; return (v1 + v2) % 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...