| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1367797 | cleversquid | Hexagonal Territory (APIO21_hexagon) | C++20 | 1 ms | 344 KiB |
#include "hexagon.h"
#include <iostream>
#include <vector>
using namespace std;
using ll = long long int;
ll MOD = 1e9+7;
ll INV2 = 500000004;
ll INV3 = 333333336;
ll mul(ll a, ll b){
return ((a%MOD) * (b%MOD)) % MOD;
}
int draw_territory(int N, int A, int B, std::vector<int> D, std::vector<int> L) {
//if n = 3 and b = 0
ll side = L[0];
ll a = side+1;
ll b = side+2;
side%=MOD;
a%=MOD;
b%=MOD;
ll bs = mul(mul(mul(mul(side, a),b), INV3), B);
ll as = mul(mul(mul(a,b), INV2), A);
return (as + bs)%MOD;
}
/*
int main(){
int N, A, B; cin >> N >> A >> B;
vector<int> D;
vector<int> L;
for(int i =0 ; i<N; i++){
int d;
cin >> d;
D.push_back(d);
}
for(int i =0 ; i<N; i++){
int l;
cin >> l;
L.push_back(l);
}
}*/| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
