QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#120647 | #4327. Šeširi | zhouhuanyi# | 21 | 177ms | 4064kb | C++11 | 1016b | 2023-07-07 08:47:33 | 2024-05-26 02:57:42 |
Judging History
answer
#include<iostream>
#include<cstdio>
#include<cmath>
#define N 18
#define eps 1e-9
using namespace std;
int read()
{
char c=0;
int sum=0;
while (c<'0'||c>'9') c=getchar();
while ('0'<=c&&c<='9') sum=sum*10+c-'0',c=getchar();
return sum;
}
int n,delta[N+1];
double X[N+1],Y[N+1];
const double Pi=asin(1)*2;
int main()
{
int cnt,rst,d;
double sx,sy;
n=read();
for (int i=1;i<=n;++i) X[i]=cos(2*i*Pi/n),Y[i]=sin(2*i*Pi/n);
for (int i=1;i<=n;++i)
{
for (int j=0;j<(1<<(n-1));++j)
{
sx=sy=rst=d=0,cnt=n-2;
for (int k=1;k<=n;++k)
if (i!=k)
delta[k]=(j>>cnt)&1,cnt--;
cnt=1;
for (int k=i+1;k<=n;++k)
{
if (delta[k]) rst++,sx+=X[cnt],sy+=Y[cnt];
cnt++;
}
for (int k=1;k<=i-1;++k)
{
if (delta[k]) rst++,sx+=X[cnt],sy+=Y[cnt];
cnt++;
}
if (abs(sy)<eps) d=abs(sx)>=eps;
else d=(sy<0)^(rst&1);
printf("%c",(!d)?'B':'C');
}
puts("");
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 7
Accepted
Test #1:
score: 7
Accepted
time: 0ms
memory: 4064kb
input:
4
output:
BBCCCBBC BCCBBCBC BCBBCBCC BBCCCBBC
result:
ok good plan!
Subtask #2:
score: 7
Accepted
Test #2:
score: 7
Accepted
time: 0ms
memory: 3860kb
input:
5
output:
BBBCCCCBCCBBBCCC BBCCCBBCBCCBCBCC BCCBBCCCBCBCCBBC BCBCBBCBCBCCCCBC BBBCCCCBCCBBBCCC
result:
ok good plan!
Subtask #3:
score: 0
Wrong Answer
Test #3:
score: 0
Wrong Answer
time: 0ms
memory: 3936kb
input:
6
output:
BBBCCCCBCBCBBCCCCCBBBBCCBCCBCBBC BBCCCCBCCBBCBCCBBCCBBBCCCBBCCBBC BCCBCBBCBCBCCBCBBCCCBCCBCBBCBCBC BCCBBBCCBCBCCBBBCBBCCCBBCCCBBCCC BCBCBBCBCBCBCCBCCBBCCCBBBCCBCBCC BBBCCCCBCBCBBCCCCCBBBBCCBCCBCBBC
result:
wrong answer your plan fails on CCCBBB
Subtask #4:
score: 7
Accepted
Test #4:
score: 7
Accepted
time: 0ms
memory: 3932kb
input:
7
output:
BBBCBCCBCCCBCBBCCBCBBBBCBCCCCBCBCCCBBBBCBCCCCCCBBCCCCBBBCBBCBCCC BBBCCCCBCCBBBCCCCCBBBCCCBCCBCBBCBCCBCBBCBBBCCCBBCBBCCCCBCCBBBCCC BBCCCBBCCBBCBCCBBCCBBBCBCBCCCBBCBCCBCBCCCBCCCBBCCBBCBCCBBCCBCBCC BCCBCBBCBCBCCCCBBCCCCCCBCBBCBCCCBCBCBCCBCBBBBCBCCBBCBCBCBCCBCBBC BCCBBBCCBCCCCBBCBBBCCBBBCBBBBCCBCBBCCCCB...
result:
ok good plan!
Subtask #5:
score: 0
Wrong Answer
Test #5:
score: 0
Wrong Answer
time: 0ms
memory: 3904kb
input:
8
output:
BBBCBCCBCCCBCBBCCBCBCBBCBCBCCCCBCBBBBBBCBCCCCCCBBCCBCBCBCBBCBCCCCCCBBBBCBCBCCCCBBCCCCBCBCBBBBCBCBCCCCBBBCBBCBCCCCBBCBCCBBCCBCBBC BBBCCCCBCCCBBBCCCBBBBCCCBCCCCBBCCCBBBBCCBCCCCBBBBCCBCBBCCBBCBCCBBCCBCBBCBBBCCCCBBBBCCCCBCBBBBCCCCBBCCCCBCCBBBBCCCCBBBCCCBCCBCBBC BBCCCCBCCBBCBCCBCBBCBCCBBCCBCBBCBCCBBBCCBB...
result:
wrong answer your plan fails on CCCBBBBB
Subtask #6:
score: 0
Wrong Answer
Test #6:
score: 0
Wrong Answer
time: 0ms
memory: 3980kb
input:
9
output:
BBBCBCCBBCCBCBBCCCCBCBBCCBBCBCCBCBCBCBBCBBBCBCCBBCCCCCCBCBCBCBBCCBCBBBBCBBBCBCCBBCCCCCCBCBCBBBBCBCCBCBCBCBBBBCBCCBBCBCCCBCCBCBCBCCCBCBBCBBBCBCCBBCBCCCCBCCCBCBBCBCCCCCCBCBBBBBBCCBBCBCCCBCCCCCCBBCCCCBCBCBBBBBBCCBBCBCCCBCCBCBCBCBBCBCCCBCCBCBBBBCCBCBBCCBBCBCCC BBBCBCCBCCCBCBBCCCCBBBBCBCCCCCCBCCBBBBBCBCC...
result:
wrong answer your plan fails on CCCCCCCBB
Subtask #7:
score: 0
Wrong Answer
Test #7:
score: 0
Wrong Answer
time: 1ms
memory: 4004kb
input:
10
output:
BBBCBCCBBCCBCBBCCCCBCBBCCBBCBCCBCBCBCBBCCBBCBCCBBCBCBCCBCCCBCBBCCBBBCBBCBBBCBCCBBCCCCCCBCCCBCBBCBCCBCCCBCBCBCBBCCBBCBCBCBCCCCCCBCBCBBBBCBBBCBCCBBCCCCCCBCCCBCBBCBCCCCBCBCBCBCBBCCBBCBCBCBCCCCCCBBCCBCBBBCBBBBBBCCBBCBCCCBCCCCCCBCBBCBCCBBCCBCBCBBCCBCBBCCBBCBCCCCCCBCBBCBBBCBCCBBCBCBCCBCCCBCBBCBCCCCCCBCBCB...
result:
wrong answer your plan fails on CCCBBBBBBB
Subtask #8:
score: 0
Wrong Answer
Test #8:
score: 0
Wrong Answer
time: 1ms
memory: 4000kb
input:
11
output:
BBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBCCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCBCBCBBCCBBCBCCBBBBCBCCBBCCBCBBCBCCCCCCBCCCBCBBCCBCBCBBCCBBCBCCBCBBBCBBCBBBCBCCBBCBCBCCBBCCBCBBCBCCCCCCBCCCBCBBCCBBBCBBCBBBCBCCBBCCBCBCBCBBBCBBCCBBCBBBCBCBCBCCBCBBCBCCCBCCCCCCBBCCBCBCBCBBBCBBCCBCBCBBCBBBCBCCBBCBCBCCBBCCBCBBCBCCCCCCBCCCB...
result:
wrong answer your plan fails on CCCCCCCCBBB
Subtask #9:
score: 0
Wrong Answer
Test #9:
score: 0
Wrong Answer
time: 2ms
memory: 3944kb
input:
12
output:
BBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBCCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCBCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCBCBCBCCBBCCBCBBCCCCBCBBCCBBCBCCBCBBBCBBCCBBCBCCBBBBCBCCBBCCBCBBCBCCCBCCBCCCBCBBCCCCBCBBCCBBCBCCBBCCBCCCBCCCBCBBCCBCBCBBCCBBCBCCBCBBCBBBCBCBCBCCBBCCCBCCBCCCBCBBCCBBBBBBCBBBCBCCBBBBCBCCBBCCBCBBCBCCCCCCBCCCB...
result:
wrong answer your plan fails on CCCBBBBBBBBB
Subtask #10:
score: 0
Wrong Answer
Test #10:
score: 0
Wrong Answer
time: 4ms
memory: 3940kb
input:
13
output:
BBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBCBCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCBBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBBCCCBCCBBCCBCBBCCCCBCBBCCBBCBCCBCBCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCBBBCBBCCBBCBCCBBBBCBCCBBCCBCBBCBCBCBCCBBCCB...
result:
wrong answer your plan fails on CCCCCBBBBBBBB
Subtask #11:
score: 0
Wrong Answer
Test #11:
score: 0
Wrong Answer
time: 8ms
memory: 3984kb
input:
14
output:
BBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBCBCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBBCBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBCCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCBBBCBBCCBBCBCCBCBBCBCCBBCCBCBBCBBBCBCCBBCCB...
result:
wrong answer your plan fails on CCCBBBBBBBBBBB
Subtask #12:
score: 0
Wrong Answer
Test #12:
score: 0
Wrong Answer
time: 18ms
memory: 3976kb
input:
15
output:
BBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBCCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCBCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCBBCBCCBBCCB...
result:
wrong answer your plan fails on CCCCCBBBBBBBBBB
Subtask #13:
score: 0
Wrong Answer
Test #13:
score: 0
Wrong Answer
time: 39ms
memory: 3944kb
input:
16
output:
BBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBCCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCBCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCBBCBCCBBCCB...
result:
wrong answer your plan fails on CCCBBBBBBBBBBBBB
Subtask #14:
score: 0
Wrong Answer
Test #14:
score: 0
Wrong Answer
time: 77ms
memory: 3976kb
input:
17
output:
BBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCBBCBCCBBCCB...
result:
wrong answer your plan fails on CCCCCBBBBBBBBBBBB
Subtask #15:
score: 0
Wrong Answer
Test #15:
score: 0
Wrong Answer
time: 177ms
memory: 3944kb
input:
18
output:
BBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCCCBCBBCCBBCBCCBCBBCBCCBBCCBCBBCCBBCBCCBBCCB...
result:
wrong answer your plan fails on CCCBBBBBBBBBBBBBBB