답안 #421628

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
421628 2021-06-09T10:13:38 Z tinjyu 육각형 영역 (APIO21_hexagon) C++14
12 / 100
12 ms 2964 KB
#include "hexagon.h"

#include <vector>
#include <iostream>
#include <cmath>
using namespace std;
long long int n,a,b,d[1000005],l[1000005],x[1000005],y[1000005];
int draw_territory(int N, int A, int B,std::vector<int> D, std::vector<int> L) {
	n=N;
	a=A;
	b=B;
	long long int p=0;
	for(int i=0;i<n;i++)
	{
		d[i]=D[i];
		l[i]=L[i];
		p+=l[i];
	}
	long long int nowx=0,nowy=0;
	long long int cnt=1;
	for(int i=0;i<n;i++)
	{
		if(d[i]==1)nowy+=l[i];
		if(d[i]==2)nowy+=l[i],nowx+=l[i];
		if(d[i]==3)nowx+=l[i];
		if(d[i]==4)nowy-=l[i];
		if(d[i]==5)nowy-=l[i],nowx-=l[i];
		if(d[i]==6)nowx-=l[i];
		x[cnt]=nowx;
		y[cnt]=nowy;
		cnt++;
	}
	long long int ans=0;
	for(int i=0;i<cnt;i++)
	{
		ans+=x[i]*y[i+1]-y[i]*x[i+1];		
	}
	ans=abs(ans);
	long long int tmp=(ans-p+2)/2;
	return (tmp+p)*a%1000000007;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 352 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 2 ms 716 KB Output is correct
3 Correct 1 ms 312 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 2 ms 460 KB Output is correct
6 Correct 2 ms 696 KB Output is correct
7 Correct 7 ms 1868 KB Output is correct
8 Correct 1 ms 332 KB Output is correct
9 Correct 1 ms 332 KB Output is correct
10 Correct 1 ms 332 KB Output is correct
11 Correct 10 ms 2812 KB Output is correct
12 Correct 10 ms 2824 KB Output is correct
13 Correct 10 ms 2636 KB Output is correct
14 Correct 12 ms 2964 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 1 ms 332 KB Output is correct
17 Correct 1 ms 332 KB Output is correct
18 Correct 1 ms 332 KB Output is correct
19 Correct 1 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 304 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -