QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#310966#5419. TrianglesczcTL 1ms3972kbC++231.6kb2024-01-21 20:09:102024-01-21 20:09:11

Judging History

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

  • [2024-01-21 20:09:11]
  • 评测
  • 测评结果:TL
  • 用时:1ms
  • 内存:3972kb
  • [2024-01-21 20:09: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});
	}
	while(1){
		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,x4,y4});
		q.push((node){x,y,x4,y4,x6,y6});
		q.push((node){x3,y3,x6,y6,x5,y5});
		q.push((node){x4,y4,x5,y5,x6,y6});
		if((int)q.size()==n) break;
	}
	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: 100
Accepted
time: 1ms
memory: 3972kb

input:

2

output:

No

result:

ok no solution

Test #2:

score: 0
Accepted
time: 0ms
memory: 3876kb

input:

24

output:

Yes
800000000 800000000 1000000000 650000000 1000000000 1000000000
800000000 800000000 1000000000 1000000000 650000000 1000000000
800000000 800000000 650000000 1000000000 600000000 700000000
800000000 800000000 600000000 700000000 800000000 600000000
1000000000 0 900000000 300000000 500000000 0
0 0 ...

result:

ok 24 acute triangles

Test #3:

score: 0
Accepted
time: 0ms
memory: 3664kb

input:

1

output:

No

result:

ok no solution

Test #4:

score: 0
Accepted
time: 0ms
memory: 3932kb

input:

3

output:

No

result:

ok no solution

Test #5:

score: 0
Accepted
time: 0ms
memory: 3732kb

input:

4

output:

No

result:

ok no solution

Test #6:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

5

output:

No

result:

ok no solution

Test #7:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

6

output:

No

result:

ok no solution

Test #8:

score: 0
Accepted
time: 0ms
memory: 3740kb

input:

7

output:

No

result:

ok no solution

Test #9:

score: -100
Time Limit Exceeded

input:

8

output:


result: