QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#310964 | #5419. Triangles | czc | WA | 0ms | 3764kb | C++23 | 1.7kb | 2024-01-21 20:06:55 | 2024-01-21 20:06:55 |
Judging History
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,x6,y6});
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;
}
assert((int)q.size()==n);
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;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3636kb
input:
2
output:
No
result:
ok no solution
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3764kb
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 400000000 300000...
result:
wrong answer triangle 5 not acute