Submission #566956

#TimeUsernameProblemLanguageResultExecution timeMemory
566956MazaalaiHexagonal Territory (APIO21_hexagon)C++17
3 / 100
1 ms212 KiB
#include "hexagon.h" #include <bits/stdc++.h> using ll = long long; using namespace std; int dx[] = {-1, 0, 1, 1, 0, -1}; int dy[] = {0, 1, 1, 0, -1, -1}; int n, A, B; const int MOD = 1e9 + 7; int draw_territory(int _n, int _A, int _B, std::vector<int> d, std::vector<int> l) { n = _n; A = _A; B = _B; if (n == 3) { ll x = l[0]+1; ll res = ( ( (x+1) * (x) / 2 % MOD * A % MOD) + (B * ( (x * (x+1) / 2) % MOD + x * (x + 1) / 2 * (x + x + 1) / 3 ) % MOD ) % MOD )%MOD; return (res % MOD + MOD) % 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...