QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#310957#5419. TrianglesczcWA 0ms3572kbC++231.6kb2024-01-21 20:03:102024-01-21 20:03:10

Judging History

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

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

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;
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3572kb

input:

2

output:

NO

result:

wrong answer Token parameter [name=s] equals to "NO", doesn't correspond to pattern "Yes|No"