Submission #488834

#TimeUsernameProblemLanguageResultExecution timeMemory
488834cfalasHexagonal Territory (APIO21_hexagon)C++14
3 / 100
1 ms288 KiB
#include "hexagon.h" #include<bits/stdc++.h> using namespace std; #define mp make_pair #define INF 10000000 #define MOD 1000000007 #define MID ((l+r)/2) #define HASHMOD 2305843009213693951 #define ll long long #define ull unsigned long long #define F first #define S second typedef pair<ll, ll> ii; typedef pair<ii, int> iii; typedef vector<int> vi; typedef vector<ii> vii; typedef map<int, int> mii; #define EPS 1e-6 #define FOR(i,n) for(int i=0;i<((int)(n));i++) #define FORi(i,a,b) for(int i=((int)(a));i<((int)(b));i++) #define FOA(v, a) for(auto v : a) int t, n; vi a, b; ll mpow(ll a, ll b){ if(b==0) return 1; if(b==1) return a; ll z = mpow(a, b/2); z*=z; z%=MOD; if(b%2) z*=a; return z%MOD; } ll modinv(ll x){ return mpow(x, MOD-2); } int draw_territory(int N, int A, int B, std::vector<int> D, std::vector<int> L) { ll ans = L[0] + 1; ans *= L[0] + 2; ans %= MOD; ans *= modinv(2); ans %= MOD; ans *= A; ans %= MOD; return ans; }
#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...