QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#89441 | #5419. Triangles | chanswer | WA | 2ms | 3596kb | C++14 | 1.6kb | 2023-03-20 07:45:14 | 2023-03-20 07:45:16 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int k;
int A[8][6]={
0,0,4,2,0,10,
0,10,4,2,5,10,
5,10,4,2,6,2,
5,10,6,2,10,10,
10,0,10,10,6,2,
0,0,5,0,4,2,
5,0,6,2,2,4,
5,0,10,0,6,2
};
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
};
void gen(auto T[][6],int t){
queue<vector<int>>q;
for(int i=0;i<t;i++) {
vector<int>x;
for(int j=0;j<6;j++)
if(t==8) x.push_back(T[i][j]*((int)1e8));
else x.push_back(T[i][j]*((int)5e7));
q.push(x);
}
while(q.size()<k){
auto x=q.front();
q.pop();
int x1=x[0],y1=x[1],x2=x[2],y2=x[3],x3=x[4],y3=x[5];
int x4=(x1+x2)/2,y4=(y1+y2)/2;
int x5=(x2+x3)/2,y5=(y2+y3)/2;
int x6=(x3+x1)/2,y6=(y3+y1)/2;
q.push({x1,y1,x4,y4,x6,y6});
q.push({x2,y2,x5,y5,x4,y4});
q.push({x3,y3,x6,y6,x5,y5});
q.push({x4,y4,x5,y5,x6,y6});
}
for(;!q.empty();){
auto x=q.front();
q.pop();
printf("%d %d %d %d %d %d\n", x[0],x[1],x[2],x[3],x[4],x[5]);
}
}
int main(){
cin>>k;
if(k<8) {cout<<"No"<<endl;}
else{
cout<<"Yes"<<endl;
if(k%3==2) gen(A,8);
if(k%3==0) gen(B,9);
if(k%3==1) gen(C,10);
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 3436kb
input:
2
output:
No
result:
ok no solution
Test #2:
score: 0
Accepted
time: 2ms
memory: 3536kb
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 0 0 500000000 0 400000000 300000000 1000000000 0 ...
result:
ok 24 acute triangles
Test #3:
score: 0
Accepted
time: 2ms
memory: 3424kb
input:
1
output:
No
result:
ok no solution
Test #4:
score: 0
Accepted
time: 2ms
memory: 3448kb
input:
3
output:
No
result:
ok no solution
Test #5:
score: 0
Accepted
time: 1ms
memory: 3364kb
input:
4
output:
No
result:
ok no solution
Test #6:
score: 0
Accepted
time: 0ms
memory: 3360kb
input:
5
output:
No
result:
ok no solution
Test #7:
score: 0
Accepted
time: 1ms
memory: 3356kb
input:
6
output:
No
result:
ok no solution
Test #8:
score: 0
Accepted
time: 2ms
memory: 3348kb
input:
7
output:
No
result:
ok no solution
Test #9:
score: -100
Wrong Answer
time: 0ms
memory: 3596kb
input:
8
output:
Yes 0 0 400000000 200000000 0 1000000000 0 1000000000 400000000 200000000 500000000 1000000000 500000000 1000000000 400000000 200000000 600000000 200000000 500000000 1000000000 600000000 200000000 1000000000 1000000000 1000000000 0 1000000000 1000000000 600000000 200000000 0 0 500000000 0 400000000 ...
result:
wrong answer triangle 1 not acute