QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#310766#5419. Trianglesc20230201WA 0ms3784kbC++142.2kb2024-01-21 17:31:072024-01-21 17:31:07

Judging History

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

  • [2024-01-21 17:31:07]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3784kb
  • [2024-01-21 17:31:07]
  • 提交

answer

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

int a[8][6]={
{0,0,90,50,100,0},
{0,0,90,50,0,200},
{100,0,90,50,110,50},
{100,0,110,50,200,0},
{200,0,110,50,200,200},
{200,200,100,200,110,50},
{100,200,110,50,90,50},
{100,200,90,50,0,200}
};

int b[9][6]={
{0,0,39,40,80,0},
{0,0,39,40,0,70},
{0,70,80,90,39,40},
{0,70,80,90,0,200},
{80,0,100,50,200,0},
{100,50,200,0,200,200},
{0,200,100,50,200,200},
{39,40,80,90,100,50},
{39,40,100,50,80,0}
};

int c[10][6]={
{0,0,90,0,80,40},
{100,30,80,40,90,0},
{100,30,90,0,110,0},
{100,30,110,0,120,40},
{100,30,80,40,100,50},
{100,30,120,40,100,50},
{200,0,110,0,120,40},
{200,200,100,50,200,0},
{0,200,100,50,200,200},
{0,0,100,50,0,200}
};

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]*=5e6;
	}
	for(int i=0;i<9;i++) {
		for(int j=0;j<6;j++) b[i][j]*=5e6;
	}
	for(int i=0;i<10;i++) {
		for(int j=0;j<6;j++) c[i][j]*=5e6;
	}
	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;
}

詳細信息

Test #1:

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

input:

2

output:

No

result:

ok no solution

Test #2:

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

input:

24

output:

Yes
500000000 250000000 1000000000 0 1000000000 1000000000
0 1000000000 500000000 250000000 1000000000 1000000000
195000000 200000000 400000000 450000000 500000000 250000000
195000000 200000000 500000000 250000000 400000000 0
97500000 100000000 200000000 0 297500000 100000000
97500000 100000000 2000...

result:

wrong answer triangle 13 not acute