Submission #617889

#TimeUsernameProblemLanguageResultExecution timeMemory
617889AmirElarbiHexagonal Territory (APIO21_hexagon)C++14
0 / 100
1 ms300 KiB
#include <bits/stdc++.h> #define vi vector<int> #define ve vector #define ll long long #define vf vector<float> #define vll vector<pair<ll,ll>> #define ii pair<int,int> #define pll pair<ll,ll> #define vvi vector<vi> #define vii vector<ii> #define gii greater<ii> #define pb push_back #define mp make_pair #define fi first #define se second #define INF 2e9+5 #define eps 1e-7 #define eps1 1e-25 #define optimise ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define MAX_A 1e5+5 #define V 450 using namespace std; const int MOD = 1e9+7; const int nax = 2e5+5; const int lg = 20; #include "hexagon.h" int mul(int a, int b){ return (a*1ll*b)%MOD; } int binpow(int x, int y){ int z = 1; while(y > 0){ if(y%2 == 1) z = mul(x, z); x = mul(x,x); y /= 2; } return z; } int inv(int a){ return binpow(a, MOD-2); } int divide(int a, int b){ return mul(a,inv(b)); } int draw_territory(int N, int A, int B, vi D, vi L){ return mul(A,divide(mul(L[0], L[0]+1), 2)); }
#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...