QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#310801#5419. Trianglesc20230201AC ✓1ms3804kbC++142.1kb2024-01-21 18:10:132024-01-21 18:10:13

Judging History

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

  • [2024-01-21 18:10:13]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3804kb
  • [2024-01-21 18:10:13]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

int a[8][6]={
{0,0,9,5,10,0},
{0,0,9,5,0,20},
{10,0,9,5,11,5},
{10,0,11,5,20,0},
{20,0,11,5,20,20},
{20,20,10,20,11,5},
{10,20,11,5,9,5},
{10,20,9,5,0,20}
};

int b[9][6]={
{5,5,6,11,0,8},
{5,5,0,8,0,0},
{5,5,0,0,8,0},
{5,5,8,0,10,5},
{5,5,10,5,6,11},
{10,5,8,0,20,0},
{10,5,20,0,20,20},
{10,5,20,20,0,20},
{6,11,0,20,0,8}
};

int c[10][6]={
{0,0,8,0,5,4},
{10,3,5,4,8,0},
{10,3,8,0,12,0},
{10,3,12,0,15,4},
{10,3,5,4,10,8},
{10,3,15,4,10,8},
{20,0,12,0,15,4},
{20,20,10,8,20,0},
{0,20,10,8,20,20},
{0,0,10,8,0,20}
};

struct tri {
	int x1,y1,x2,y2,x3,y3;
};

queue<tri> q;

void pt(int k) {
	while(k) {
		tri t=q.front(); q.pop();
		if((t.x1&1)||(t.x2&1)||(t.x3&1)||(t.y1&1)||(t.y2&1)||(t.y3&1)) {
			cout<<"?\n";
			q.push(t);
			continue;
		}
		q.push((tri){(t.x1+t.x2)/2,(t.y1+t.y2)/2,(t.x1+t.x3)/2,(t.y1+t.y3)/2,(t.x2+t.x3)/2,(t.y2+t.y3)/2});
		q.push((tri){(t.x1+t.x2)/2,(t.y1+t.y2)/2,(t.x1+t.x3)/2,(t.y1+t.y3)/2,t.x1,t.y1});
		q.push((tri){(t.x2+t.x1)/2,(t.y2+t.y1)/2,(t.x2+t.x3)/2,(t.y2+t.y3)/2,t.x2,t.y2});
		q.push((tri){(t.x3+t.x1)/2,(t.y3+t.y1)/2,(t.x3+t.x2)/2,(t.y3+t.y2)/2,t.x3,t.y3});
		k--;
	}
	while(q.size()) {
		tri t=q.front(); q.pop();
		cout<<t.x1<<' '<<t.y1<<' '<<t.x2<<' '<<t.y2<<' '<<t.x3<<' '<<t.y3<<'\n';
	}
	return ;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	for(int i=0;i<8;i++) {
		for(int j=0;j<6;j++) a[i][j]*=5e7;
	}
	for(int i=0;i<9;i++) {
		for(int j=0;j<6;j++) b[i][j]*=5e7;
	}
	for(int i=0;i<10;i++) {
		for(int j=0;j<6;j++) c[i][j]*=5e7;
	}
	int k; cin>>k;
	if(k<8) cout<<"No\n";
	else {
		cout<<"Yes\n";
		if(k%3==0) {
			for(int i=0;i<9;i++) q.push((tri){b[i][0],b[i][1],b[i][2],b[i][3],b[i][4],b[i][5]});
			pt((k-9)/3);
		}
		if(k%3==1) {
			for(int i=0;i<10;i++) q.push((tri){c[i][0],c[i][1],c[i][2],c[i][3],c[i][4],c[i][5]});
			pt((k-10)/3);
		}
		if(k%3==2) {
			for(int i=0;i<8;i++) q.push((tri){a[i][0],a[i][1],a[i][2],a[i][3],a[i][4],a[i][5]});
			pt((k-8)/3);
		}
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3576kb

input:

2

output:

No

result:

ok no solution

Test #2:

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

input:

24

output:

Yes
500000000 250000000 400000000 0 1000000000 0
500000000 250000000 1000000000 0 1000000000 1000000000
500000000 250000000 1000000000 1000000000 0 1000000000
300000000 550000000 0 1000000000 0 400000000
275000000 400000000 125000000 325000000 150000000 475000000
275000000 400000000 125000000 325000...

result:

ok 24 acute triangles

Test #3:

score: 0
Accepted
time: 1ms
memory: 3612kb

input:

1

output:

No

result:

ok no solution

Test #4:

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

input:

3

output:

No

result:

ok no solution

Test #5:

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

input:

4

output:

No

result:

ok no solution

Test #6:

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

input:

5

output:

No

result:

ok no solution

Test #7:

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

input:

6

output:

No

result:

ok no solution

Test #8:

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

input:

7

output:

No

result:

ok no solution

Test #9:

score: 0
Accepted
time: 1ms
memory: 3548kb

input:

8

output:

Yes
0 0 450000000 250000000 500000000 0
0 0 450000000 250000000 0 1000000000
500000000 0 450000000 250000000 550000000 250000000
500000000 0 550000000 250000000 1000000000 0
1000000000 0 550000000 250000000 1000000000 1000000000
1000000000 1000000000 500000000 1000000000 550000000 250000000
50000000...

result:

ok 8 acute triangles

Test #10:

score: 0
Accepted
time: 1ms
memory: 3532kb

input:

9

output:

Yes
250000000 250000000 300000000 550000000 0 400000000
250000000 250000000 0 400000000 0 0
250000000 250000000 0 0 400000000 0
250000000 250000000 400000000 0 500000000 250000000
250000000 250000000 500000000 250000000 300000000 550000000
500000000 250000000 400000000 0 1000000000 0
500000000 25000...

result:

ok 9 acute triangles

Test #11:

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

input:

10

output:

Yes
0 0 400000000 0 250000000 200000000
500000000 150000000 250000000 200000000 400000000 0
500000000 150000000 400000000 0 600000000 0
500000000 150000000 600000000 0 750000000 200000000
500000000 150000000 250000000 200000000 500000000 400000000
500000000 150000000 750000000 200000000 500000000 40...

result:

ok 10 acute triangles

Test #12:

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

input:

11

output:

Yes
0 0 450000000 250000000 0 1000000000
500000000 0 450000000 250000000 550000000 250000000
500000000 0 550000000 250000000 1000000000 0
1000000000 0 550000000 250000000 1000000000 1000000000
1000000000 1000000000 500000000 1000000000 550000000 250000000
500000000 1000000000 550000000 250000000 450...

result:

ok 11 acute triangles

Test #13:

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

input:

12

output:

Yes
250000000 250000000 0 400000000 0 0
250000000 250000000 0 0 400000000 0
250000000 250000000 400000000 0 500000000 250000000
250000000 250000000 500000000 250000000 300000000 550000000
500000000 250000000 400000000 0 1000000000 0
500000000 250000000 1000000000 0 1000000000 1000000000
500000000 25...

result:

ok 12 acute triangles

Test #14:

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

input:

13

output:

Yes
500000000 150000000 250000000 200000000 400000000 0
500000000 150000000 400000000 0 600000000 0
500000000 150000000 600000000 0 750000000 200000000
500000000 150000000 250000000 200000000 500000000 400000000
500000000 150000000 750000000 200000000 500000000 400000000
1000000000 0 600000000 0 750...

result:

ok 13 acute triangles

Test #15:

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

input:

14

output:

Yes
500000000 0 450000000 250000000 550000000 250000000
500000000 0 550000000 250000000 1000000000 0
1000000000 0 550000000 250000000 1000000000 1000000000
1000000000 1000000000 500000000 1000000000 550000000 250000000
500000000 1000000000 550000000 250000000 450000000 250000000
500000000 1000000000...

result:

ok 14 acute triangles

Test #16:

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

input:

15

output:

Yes
250000000 250000000 0 0 400000000 0
250000000 250000000 400000000 0 500000000 250000000
250000000 250000000 500000000 250000000 300000000 550000000
500000000 250000000 400000000 0 1000000000 0
500000000 250000000 1000000000 0 1000000000 1000000000
500000000 250000000 1000000000 1000000000 0 1000...

result:

ok 15 acute triangles

Test #17:

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

input:

16

output:

Yes
500000000 150000000 400000000 0 600000000 0
500000000 150000000 600000000 0 750000000 200000000
500000000 150000000 250000000 200000000 500000000 400000000
500000000 150000000 750000000 200000000 500000000 400000000
1000000000 0 600000000 0 750000000 200000000
1000000000 1000000000 500000000 400...

result:

ok 16 acute triangles

Test #18:

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

input:

17

output:

Yes
500000000 0 550000000 250000000 1000000000 0
1000000000 0 550000000 250000000 1000000000 1000000000
1000000000 1000000000 500000000 1000000000 550000000 250000000
500000000 1000000000 550000000 250000000 450000000 250000000
500000000 1000000000 450000000 250000000 0 1000000000
225000000 12500000...

result:

ok 17 acute triangles

Test #19:

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

input:

18

output:

Yes
250000000 250000000 400000000 0 500000000 250000000
250000000 250000000 500000000 250000000 300000000 550000000
500000000 250000000 400000000 0 1000000000 0
500000000 250000000 1000000000 0 1000000000 1000000000
500000000 250000000 1000000000 1000000000 0 1000000000
300000000 550000000 0 1000000...

result:

ok 18 acute triangles

Test #20:

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

input:

19

output:

Yes
500000000 150000000 600000000 0 750000000 200000000
500000000 150000000 250000000 200000000 500000000 400000000
500000000 150000000 750000000 200000000 500000000 400000000
1000000000 0 600000000 0 750000000 200000000
1000000000 1000000000 500000000 400000000 1000000000 0
0 1000000000 500000000 4...

result:

ok 19 acute triangles

Test #21:

score: 0
Accepted
time: 1ms
memory: 3520kb

input:

20

output:

Yes
1000000000 0 550000000 250000000 1000000000 1000000000
1000000000 1000000000 500000000 1000000000 550000000 250000000
500000000 1000000000 550000000 250000000 450000000 250000000
500000000 1000000000 450000000 250000000 0 1000000000
225000000 125000000 250000000 0 475000000 125000000
225000000 1...

result:

ok 20 acute triangles

Test #22:

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

input:

21

output:

Yes
250000000 250000000 500000000 250000000 300000000 550000000
500000000 250000000 400000000 0 1000000000 0
500000000 250000000 1000000000 0 1000000000 1000000000
500000000 250000000 1000000000 1000000000 0 1000000000
300000000 550000000 0 1000000000 0 400000000
275000000 400000000 125000000 325000...

result:

ok 21 acute triangles

Test #23:

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

input:

22

output:

Yes
500000000 150000000 250000000 200000000 500000000 400000000
500000000 150000000 750000000 200000000 500000000 400000000
1000000000 0 600000000 0 750000000 200000000
1000000000 1000000000 500000000 400000000 1000000000 0
0 1000000000 500000000 400000000 1000000000 1000000000
0 0 500000000 4000000...

result:

ok 22 acute triangles

Test #24:

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

input:

23

output:

Yes
1000000000 1000000000 500000000 1000000000 550000000 250000000
500000000 1000000000 550000000 250000000 450000000 250000000
500000000 1000000000 450000000 250000000 0 1000000000
225000000 125000000 250000000 0 475000000 125000000
225000000 125000000 250000000 0 0 0
225000000 125000000 475000000 ...

result:

ok 23 acute triangles

Test #25:

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

input:

25

output:

Yes
500000000 150000000 750000000 200000000 500000000 400000000
1000000000 0 600000000 0 750000000 200000000
1000000000 1000000000 500000000 400000000 1000000000 0
0 1000000000 500000000 400000000 1000000000 1000000000
0 0 500000000 400000000 0 1000000000
200000000 0 125000000 100000000 325000000 10...

result:

ok 25 acute triangles

Test #26:

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

input:

26

output:

Yes
500000000 1000000000 550000000 250000000 450000000 250000000
500000000 1000000000 450000000 250000000 0 1000000000
225000000 125000000 250000000 0 475000000 125000000
225000000 125000000 250000000 0 0 0
225000000 125000000 475000000 125000000 450000000 250000000
250000000 0 475000000 125000000 5...

result:

ok 26 acute triangles

Test #27:

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

input:

27

output:

Yes
500000000 250000000 1000000000 0 1000000000 1000000000
500000000 250000000 1000000000 1000000000 0 1000000000
300000000 550000000 0 1000000000 0 400000000
275000000 400000000 125000000 325000000 150000000 475000000
275000000 400000000 125000000 325000000 250000000 250000000
275000000 400000000 1...

result:

ok 27 acute triangles

Test #28:

score: 0
Accepted
time: 1ms
memory: 3624kb

input:

28

output:

Yes
1000000000 0 600000000 0 750000000 200000000
1000000000 1000000000 500000000 400000000 1000000000 0
0 1000000000 500000000 400000000 1000000000 1000000000
0 0 500000000 400000000 0 1000000000
200000000 0 125000000 100000000 325000000 100000000
200000000 0 125000000 100000000 0 0
200000000 0 3250...

result:

ok 28 acute triangles

Test #29:

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

input:

29

output:

Yes
500000000 1000000000 450000000 250000000 0 1000000000
225000000 125000000 250000000 0 475000000 125000000
225000000 125000000 250000000 0 0 0
225000000 125000000 475000000 125000000 450000000 250000000
250000000 0 475000000 125000000 500000000 0
225000000 125000000 0 500000000 225000000 62500000...

result:

ok 29 acute triangles

Test #30:

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

input:

30

output:

Yes
500000000 250000000 1000000000 1000000000 0 1000000000
300000000 550000000 0 1000000000 0 400000000
275000000 400000000 125000000 325000000 150000000 475000000
275000000 400000000 125000000 325000000 250000000 250000000
275000000 400000000 150000000 475000000 300000000 550000000
125000000 325000...

result:

ok 30 acute triangles

Test #31:

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

input:

31

output:

Yes
1000000000 1000000000 500000000 400000000 1000000000 0
0 1000000000 500000000 400000000 1000000000 1000000000
0 0 500000000 400000000 0 1000000000
200000000 0 125000000 100000000 325000000 100000000
200000000 0 125000000 100000000 0 0
200000000 0 325000000 100000000 400000000 0
125000000 1000000...

result:

ok 31 acute triangles

Test #32:

score: 0
Accepted
time: 1ms
memory: 3532kb

input:

32

output:

Yes
225000000 125000000 250000000 0 475000000 125000000
225000000 125000000 250000000 0 0 0
225000000 125000000 475000000 125000000 450000000 250000000
250000000 0 475000000 125000000 500000000 0
225000000 125000000 0 500000000 225000000 625000000
225000000 125000000 0 500000000 0 0
225000000 125000...

result:

ok 32 acute triangles

Test #33:

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

input:

33

output:

Yes
300000000 550000000 0 1000000000 0 400000000
275000000 400000000 125000000 325000000 150000000 475000000
275000000 400000000 125000000 325000000 250000000 250000000
275000000 400000000 150000000 475000000 300000000 550000000
125000000 325000000 150000000 475000000 0 400000000
125000000 325000000...

result:

ok 33 acute triangles

Test #34:

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

input:

34

output:

Yes
0 1000000000 500000000 400000000 1000000000 1000000000
0 0 500000000 400000000 0 1000000000
200000000 0 125000000 100000000 325000000 100000000
200000000 0 125000000 100000000 0 0
200000000 0 325000000 100000000 400000000 0
125000000 100000000 325000000 100000000 250000000 200000000
375000000 17...

result:

ok 34 acute triangles

Test #35:

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

input:

35

output:

Yes
225000000 125000000 250000000 0 0 0
225000000 125000000 475000000 125000000 450000000 250000000
250000000 0 475000000 125000000 500000000 0
225000000 125000000 0 500000000 225000000 625000000
225000000 125000000 0 500000000 0 0
225000000 125000000 225000000 625000000 450000000 250000000
0 500000...

result:

ok 35 acute triangles

Test #36:

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

input:

36

output:

Yes
275000000 400000000 125000000 325000000 150000000 475000000
275000000 400000000 125000000 325000000 250000000 250000000
275000000 400000000 150000000 475000000 300000000 550000000
125000000 325000000 150000000 475000000 0 400000000
125000000 325000000 125000000 125000000 0 200000000
125000000 32...

result:

ok 36 acute triangles

Test #37:

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

input:

37

output:

Yes
0 0 500000000 400000000 0 1000000000
200000000 0 125000000 100000000 325000000 100000000
200000000 0 125000000 100000000 0 0
200000000 0 325000000 100000000 400000000 0
125000000 100000000 325000000 100000000 250000000 200000000
375000000 175000000 450000000 75000000 325000000 100000000
37500000...

result:

ok 37 acute triangles

Test #38:

score: 0
Accepted
time: 1ms
memory: 3524kb

input:

38

output:

Yes
225000000 125000000 475000000 125000000 450000000 250000000
250000000 0 475000000 125000000 500000000 0
225000000 125000000 0 500000000 225000000 625000000
225000000 125000000 0 500000000 0 0
225000000 125000000 225000000 625000000 450000000 250000000
0 500000000 225000000 625000000 0 1000000000...

result:

ok 38 acute triangles

Test #39:

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

input:

39

output:

Yes
275000000 400000000 125000000 325000000 250000000 250000000
275000000 400000000 150000000 475000000 300000000 550000000
125000000 325000000 150000000 475000000 0 400000000
125000000 325000000 125000000 125000000 0 200000000
125000000 325000000 125000000 125000000 250000000 250000000
125000000 32...

result:

ok 39 acute triangles

Test #40:

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

input:

40

output:

Yes
200000000 0 125000000 100000000 325000000 100000000
200000000 0 125000000 100000000 0 0
200000000 0 325000000 100000000 400000000 0
125000000 100000000 325000000 100000000 250000000 200000000
375000000 175000000 450000000 75000000 325000000 100000000
375000000 175000000 450000000 75000000 500000...

result:

ok 40 acute triangles

Test #41:

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

input:

41

output:

Yes
250000000 0 475000000 125000000 500000000 0
225000000 125000000 0 500000000 225000000 625000000
225000000 125000000 0 500000000 0 0
225000000 125000000 225000000 625000000 450000000 250000000
0 500000000 225000000 625000000 0 1000000000
475000000 125000000 525000000 125000000 500000000 250000000...

result:

ok 41 acute triangles

Test #42:

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

input:

42

output:

Yes
275000000 400000000 150000000 475000000 300000000 550000000
125000000 325000000 150000000 475000000 0 400000000
125000000 325000000 125000000 125000000 0 200000000
125000000 325000000 125000000 125000000 250000000 250000000
125000000 325000000 0 200000000 0 400000000
125000000 125000000 0 200000...

result:

ok 42 acute triangles

Test #43:

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

input:

43

output:

Yes
200000000 0 125000000 100000000 0 0
200000000 0 325000000 100000000 400000000 0
125000000 100000000 325000000 100000000 250000000 200000000
375000000 175000000 450000000 75000000 325000000 100000000
375000000 175000000 450000000 75000000 500000000 150000000
375000000 175000000 325000000 10000000...

result:

ok 43 acute triangles

Test #44:

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

input:

44

output:

Yes
225000000 125000000 0 500000000 225000000 625000000
225000000 125000000 0 500000000 0 0
225000000 125000000 225000000 625000000 450000000 250000000
0 500000000 225000000 625000000 0 1000000000
475000000 125000000 525000000 125000000 500000000 250000000
475000000 125000000 525000000 125000000 500...

result:

ok 44 acute triangles

Test #45:

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

input:

45

output:

Yes
125000000 325000000 150000000 475000000 0 400000000
125000000 325000000 125000000 125000000 0 200000000
125000000 325000000 125000000 125000000 250000000 250000000
125000000 325000000 0 200000000 0 400000000
125000000 125000000 0 200000000 0 0
125000000 125000000 325000000 125000000 200000000 0
...

result:

ok 45 acute triangles

Test #46:

score: 0
Accepted
time: 1ms
memory: 3516kb

input:

46

output:

Yes
200000000 0 325000000 100000000 400000000 0
125000000 100000000 325000000 100000000 250000000 200000000
375000000 175000000 450000000 75000000 325000000 100000000
375000000 175000000 450000000 75000000 500000000 150000000
375000000 175000000 325000000 100000000 250000000 200000000
450000000 7500...

result:

ok 46 acute triangles

Test #47:

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

input:

47

output:

Yes
225000000 125000000 0 500000000 0 0
225000000 125000000 225000000 625000000 450000000 250000000
0 500000000 225000000 625000000 0 1000000000
475000000 125000000 525000000 125000000 500000000 250000000
475000000 125000000 525000000 125000000 500000000 0
475000000 125000000 500000000 250000000 450...

result:

ok 47 acute triangles

Test #48:

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

input:

48

output:

Yes
125000000 325000000 125000000 125000000 0 200000000
125000000 325000000 125000000 125000000 250000000 250000000
125000000 325000000 0 200000000 0 400000000
125000000 125000000 0 200000000 0 0
125000000 125000000 325000000 125000000 200000000 0
125000000 125000000 325000000 125000000 250000000 25...

result:

ok 48 acute triangles

Test #49:

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

input:

49

output:

Yes
125000000 100000000 325000000 100000000 250000000 200000000
375000000 175000000 450000000 75000000 325000000 100000000
375000000 175000000 450000000 75000000 500000000 150000000
375000000 175000000 325000000 100000000 250000000 200000000
450000000 75000000 325000000 100000000 400000000 0
4500000...

result:

ok 49 acute triangles

Test #50:

score: 0
Accepted
time: 1ms
memory: 3760kb

input:

50

output:

Yes
225000000 125000000 225000000 625000000 450000000 250000000
0 500000000 225000000 625000000 0 1000000000
475000000 125000000 525000000 125000000 500000000 250000000
475000000 125000000 525000000 125000000 500000000 0
475000000 125000000 500000000 250000000 450000000 250000000
525000000 125000000...

result:

ok 50 acute triangles