답안 #568397

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
568397 2022-05-25T11:17:37 Z amunduzbaev 육각형 영역 (APIO21_hexagon) C++17
9 / 100
1 ms 340 KB
#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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 300 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Runtime error 1 ms 340 KB Execution killed with signal 6
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 296 KB Output is correct
5 Runtime error 1 ms 340 KB Execution killed with signal 6
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -