QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#311008 | #5419. Triangles | yuqihao | WA | 1ms | 3872kb | C++14 | 2.0kb | 2024-01-21 20:51:47 | 2024-01-21 20:51:47 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=3000,cm=1e7;
struct point{
int x,y;
friend point operator +(point a,point b){
return {a.x+b.x,a.y+b.y};
}
friend point operator *(point a,int x){
return {a.x*x,a.y*x};
}
friend point operator /(point a,int x){
return {a.x/x,a.y/x};
}
};
struct as{
point a,b,c;
}q[N];
int l,r,k;
signed main(){
scanf("%lld",&k);
if(k<8){
printf("No");
return 0;
}
printf("Yes\n");
l=1,r=0;
if(k%3==0){
k-=9;
q[++r]={{0,100},{42,70},{55,100}};
q[++r]={{0,100},{70,50},{0,0}};
q[++r]={{0,0},{70,50},{100,0}};
q[++r]={{100,0},{70,50},{100,60}};
q[++r]={{100,60},{70,75},{100,100}};
q[++r]={{100,100},{55,100},{70,75}};
q[++r]={{55,100},{70,75},{42,70}};
q[++r]={{42,70},{70,50},{70,75}};
q[++r]={{70,50},{100,60},{70,75}};
}
else if(k%3==1){
k-=10;
q[++r]={{0,0},{40,0},{30,18}};
q[++r]={{30,18},{50,14},{40,0}};
q[++r]={{40,0},{50,14},{60,0}};
q[++r]={{60,0},{50,14},{70,18}};
q[++r]={{60,0},{70,18},{100,0}};
q[++r]={{30,18},{50,14},{50,30}};
q[++r]={{50,30},{70,18},{50,14}};
q[++r]={{0,0},{50,30},{0,100}};
q[++r]={{0,100},{100,100},{50,30}};
q[++r]={{100,100},{50,30},{100,0}};
}
else{
k-=8;
q[++r]={{0,0},{45,20},{50,0}};
q[++r]={{45,20},{50,0},{55,20}};
q[++r]={{50,0},{55,20},{100,0}};
q[++r]={{0,0},{0,100},{45,20}};
q[++r]={{0,100},{45,20},{50,100}};
q[++r]={{50,100},{45,20},{55,20}};
q[++r]={{50,100},{100,100},{55,20}};
q[++r]={{100,100},{55,20},{100,0}};
}
for(int i=l;i<=r;i++){
q[i].a=q[i].a*cm,q[i].b=q[i].b*cm,q[i].c=q[i].c*cm;
}
while(k){
k-=3;
point x1=(q[l].a+q[l].b)/2,x2=(q[l].b+q[l].c)/2,x3=(q[l].a+q[l].c)/2;
q[++r]={x1,x2,x3};
q[++r]={x1,x2,q[l].b};
q[++r]={x1,x2,q[l].a};
q[++r]={x2,x3,q[l].c};
l++;
}
for(int i=l;i<=r;i++){
printf("%lld %lld %lld %lld %lld %lld\n",q[i].a.x,q[i].a.y,q[i].b.x,q[i].b.y,q[i].c.x,q[i].c.y);
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3680kb
input:
2
output:
No
result:
ok no solution
Test #2:
score: -100
Wrong Answer
time: 1ms
memory: 3872kb
input:
24
output:
Yes 1000000000 1000000000 550000000 1000000000 700000000 750000000 550000000 1000000000 700000000 750000000 420000000 700000000 420000000 700000000 700000000 500000000 700000000 750000000 700000000 500000000 1000000000 600000000 700000000 750000000 210000000 850000000 485000000 850000000 275000000 1...
result:
wrong answer triangle 7 not acute