QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#89440#5419. TriangleschanswerWA 2ms3588kbC++141.6kb2023-03-20 07:39:392023-03-20 07:39:41

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-20 07:39:41]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3588kb
  • [2023-03-20 07:39:39]
  • 提交

answer

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

int A[8][6]={
	0,0,4,4,0,10,
	0,10,4,4,5,10,
	5,10,4,4,6,4,
	5,10,6,4,10,10,
	10,0,10,10,6,4,
	0,0,5,0,4,4,
	5,0,6,4,4,4,
	5,0,10,0,6,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
};
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: 3356kb

input:

2

output:

No

result:

ok no solution

Test #2:

score: 0
Accepted
time: 2ms
memory: 3588kb

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: 3352kb

input:

1

output:

No

result:

ok no solution

Test #4:

score: 0
Accepted
time: 2ms
memory: 3428kb

input:

3

output:

No

result:

ok no solution

Test #5:

score: 0
Accepted
time: 2ms
memory: 3352kb

input:

4

output:

No

result:

ok no solution

Test #6:

score: 0
Accepted
time: 2ms
memory: 3360kb

input:

5

output:

No

result:

ok no solution

Test #7:

score: 0
Accepted
time: 2ms
memory: 3400kb

input:

6

output:

No

result:

ok no solution

Test #8:

score: 0
Accepted
time: 0ms
memory: 3408kb

input:

7

output:

No

result:

ok no solution

Test #9:

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

input:

8

output:

Yes
0 0 400000000 400000000 0 1000000000
0 1000000000 400000000 400000000 500000000 1000000000
500000000 1000000000 400000000 400000000 600000000 400000000
500000000 1000000000 600000000 400000000 1000000000 1000000000
1000000000 0 1000000000 1000000000 600000000 400000000
0 0 500000000 0 400000000 ...

result:

wrong answer triangle 1 not acute