QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#310959#5419. TrianglesczcWA 0ms3680kbC++231.6kb2024-01-21 20:03:402024-01-21 20:03:41

Judging History

你现在查看的是最新测评结果

  • [2024-01-21 20:03:41]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3680kb
  • [2024-01-21 20:03:40]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int A[8][6]={
    0,0,9,4,0,20,
    0,20,9,4,10,20,
    10,20,9,4,11,4,
    10,20,11,4,20,20,
    20,0,20,20,11,4,
    0,0,10,0,9,4,
    10,0,11,4,9,4,
    10,0,20,0,11,4
};
int B[9][6]={
    0,0,20,0,16,12,
    0,0,16,12,0,20,
    0,20,12,14,13,20,
    20,0,20,13,16,12,
    16,16,16,12,20,13,
    16,16,20,13,20,20,
    16,16,20,20,13,20,
    16,16,13,20,12,14,
    16,16,12,14,16,12
};
int C[10][6]={
    0,0,10,8,0,20,
    20,0,10,8,20,20,
    0,20,10,8,20,20,
    0,0,8,0,5,4,
    10,3,5,4,8,0, 
    10,3,10,8,5,4,
    10,3,8,0,12,0,
    10,3,12,0,15,4,
    10,3,15,4,10,8,
    20,0,15,4,12,0
};
struct node{
	int x,y,x2,y2,x3,y3;
};
queue<node> q;
const int bs=5e7; 
inline void solve(int n,int len,int czc[][6]){
	for(int i=0;i<len;i++){
		q.push((node){czc[i][0]*bs,czc[i][1]*bs,czc[i][2]*bs,czc[i][3]*bs,czc[i][4]*bs,czc[i][5]*bs});
	}
	for(int i=9;i<=n;i++){
		node pyb=q.front();
		q.pop();
		int x=pyb.x,y=pyb.y,x2=pyb.x2,y2=pyb.y2,x3=pyb.x3,y3=pyb.y3;
		int x4=(x+x2)/2,y4=(y+y2)/2,x5=(x2+x3)/2,y5=(y2+y3)/2,x6=(x+x3)/2,y6=(y+y3)/2;
		q.push((node){x2,y2,x5,y5,x6,y6});
		q.push((node){x,y,x4,y4,x6,y6});
		q.push((node){x3,y3,x6,y6,x5,y5});
	}
	puts("Yes");
	while(!q.empty()){
		node pyb=q.front();
		q.pop();
		printf("%d %d %d %d %d %d\n",pyb.x,pyb.y,pyb.x2,pyb.y2,pyb.x3,pyb.y3); 
	}
}
int n;
int main(){
	scanf("%d",&n);
	if(n<8){
		return puts("No"),0;
	}
	if(n%3==2){
		solve(n,8,A);
	}
	if(n%3==0){
		solve(n,9,B);
	}
	if(n%3==1){
		solve(n,10,C);
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3644kb

input:

2

output:

No

result:

ok no solution

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3680kb

input:

24

output:

Yes
0 1000000000 300000000 850000000 325000000 1000000000
650000000 1000000000 325000000 1000000000 625000000 850000000
1000000000 650000000 900000000 625000000 900000000 300000000
1000000000 0 1000000000 325000000 900000000 300000000
800000000 600000000 900000000 300000000 900000000 625000000
80000...

result:

wrong answer triangle 3 not acute