Submission #568397

#TimeUsernameProblemLanguageResultExecution timeMemory
568397amunduzbaevHexagonal Territory (APIO21_hexagon)C++17
9 / 100
1 ms340 KiB
#include "hexagon.h" #ifndef EVAL #include "grader.cpp" #endif #include "bits/stdc++.h" using namespace std; #define ar array const int mod = 1e9 + 7; const int MAXN = 505 * 505; const int N = 4e3 + 5; const int H = 2e3; int bp(int a, int b){ int r = 1; while(b){ if(b & 1) r = r * 1ll * a % mod; b >>= 1, a = a * 1ll * a % mod; } return r; } int draw_territory(int n, int A, int B, vector<int> d, vector<int> l) { if(n == 3){ int L = l[0]; int res = (L + 1) * 1ll * (L + 2) / 2 % mod * A % mod; res = (res + L * 1ll * (L + 1) % mod * (2 * L + 1) % mod * bp(6, mod - 2) % mod * B % mod) % mod; res = (res + L * 1ll * (L + 1) / 2 % mod * B % mod) % mod; return res; } assert(false); //~ int ch[6][3] = { //~ {1, 1}, //~ {1, 0}, //~ {0, -1}, //~ {-1, -1}, //~ {-1, 0}, //~ {0, 1} //~ }; //~ vector<int> is[N]; //~ ar<int, 2> c {}; //~ for(int i=0;i<n;i++){ --d[i]; //~ for(int k=0;k<l[i];k++){ //~ for(int t=0;t<2;t++) c[t] += ch[d[i]][t]; //~ if(c[1] || c[0]) is[c[1] + H].push_back(c[0]); //~ } //~ } //~ for(int i=0;i<N;i++){ //~ sort(is[i].begin(), is[i].end()); //~ } //~ assert(false); //~ auto check = [&](int x, int y){ //~ x += H; //~ auto it = upper_bound(is[x].begin(), is[x].end(), //~ }; 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...