QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#310737 | #5419. Triangles | c20230201 | WA | 1ms | 3808kb | C++14 | 2.1kb | 2024-01-21 17:19:57 | 2024-01-21 17:19:59 |
Judging History
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,9,0,8,4},
{10,3,8,4,9,0},
{10,3,9,0,11,0},
{10,3,11,0,12,4},
{10,3,8,4,10,5},
{10,3,12,4,10,5},
{20,0,11,0,12,4},
{20,20,10,5,20,0},
{0,20,10,5,20,20},
{0,0,10,5,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;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3588kb
input:
2
output:
No
result:
ok no solution
Test #2:
score: 0
Accepted
time: 1ms
memory: 3596kb
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: 0ms
memory: 3588kb
input:
1
output:
No
result:
ok no solution
Test #4:
score: 0
Accepted
time: 0ms
memory: 3732kb
input:
3
output:
No
result:
ok no solution
Test #5:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
4
output:
No
result:
ok no solution
Test #6:
score: 0
Accepted
time: 1ms
memory: 3808kb
input:
5
output:
No
result:
ok no solution
Test #7:
score: 0
Accepted
time: 1ms
memory: 3796kb
input:
6
output:
No
result:
ok no solution
Test #8:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
7
output:
No
result:
ok no solution
Test #9:
score: 0
Accepted
time: 0ms
memory: 3572kb
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: 0ms
memory: 3588kb
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: -100
Wrong Answer
time: 1ms
memory: 3640kb
input:
10
output:
Yes 0 0 450000000 0 400000000 200000000 500000000 150000000 400000000 200000000 450000000 0 500000000 150000000 450000000 0 550000000 0 500000000 150000000 550000000 0 600000000 200000000 500000000 150000000 400000000 200000000 500000000 250000000 500000000 150000000 600000000 200000000 500000000 25...
result:
wrong answer triangle 2 not acute