QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#109623 | #2102. Gra w kółko | myee | AC ✓ | 212ms | 35024kb | C++11 | 6.3kb | 2023-05-29 21:54:06 | 2023-05-29 21:54:09 |
Judging History
answer
// 那就是希望。
// 即便需要取模,也是光明。
#include <algorithm>
#include <stdio.h>
#include <vector>
typedef long long llt;
typedef unsigned uint;typedef unsigned long long ullt;
typedef bool bol;typedef char chr;typedef void voi;
typedef double dbl;
template<typename T>bol _max(T&a,T b){return(a<b)?a=b,true:false;}
template<typename T>bol _min(T&a,T b){return(b<a)?a=b,true:false;}
template<typename T>T lowbit(T n){return n&-n;}
template<typename T>T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<typename T>T lcm(T a,T b){return(a!=0||b!=0)?a/gcd(a,b)*b:(T)0;}
template<typename T>T exgcd(T a,T b,T&x,T&y){if(b!=0){T ans=exgcd(b,a%b,y,x);y-=a/b*x;return ans;}else return y=0,x=1,a;}
template<typename T>T power(T base,T index,T mod)
{
T ans=1%mod;
while(index)
{
if(index&1)ans=ans*base%mod;
base=base*base%mod,index>>=1;
}
return ans;
}
#ifdef MYEE
#define endA() return puts("a"),voi()
#define endB() return puts("b"),voi()
#define endC() return puts("c"),voi()
#else
#define endA() return puts("B"),voi()
#define endB() return puts("C"),voi()
#define endC() return puts("R"),voi()
#endif
voi solve(){
uint n,a,b,m;scanf("%u%u%u",&n,&a,&b),m=a+b;
std::vector<std::pair<uint,uint> >V(m),User;
for(uint i=0;i<a;i++)scanf("%u",&V[i].first),V[i].first--;
for(uint i=a;i<m;i++)scanf("%u",&V[i].first),V[i].first--,V[i].second=1;
if(n==m)endB();
std::inplace_merge(V.begin(),V.begin()+a,V.end());
for(uint i=0,p=V[0].first;i<m;i++)V[i].first=(i==m-1?n+p:V[(i+1)%m].first)-V[i].first-1;
bol op1=1,op2=0,op3=0,op4=0;
for(uint i=0;op1&&i<m;i++)op1=V[i].second!=V[(i+1)%m].second;
if(op1)endC();
auto pre=[&](uint p,uint c=1){return(p+m-c%m)%m;};
auto nxt=[&](uint p,uint c=1){return(p+c)%m;};
for(uint i=0;i<m;i++)if(V[i].second==V[pre(i)].second){
if(V[i].second==V[nxt(i)].second){User.push_back(V[i]);continue;}
uint j=i,c=0,d=0;
do d+=V[j].first,c++,j=nxt(j);while(V[j].second!=V[pre(j)].second);
if(c&1)User.push_back({d,V[i].second}),User.push_back(V[pre(j)]);
else{
User.push_back(V[i]);
for(uint t=nxt(i);nxt(t)!=j;t=nxt(t,2))
User.push_back({0,V[t].second}),User.push_back({0,V[t].second}),
User.push_back({0,V[nxt(t)].second}),User.push_back(V[nxt(t)]);
User.push_back(V[pre(j)]);
}
}
V=User,m=V.size();
for(uint i=0;i<m;i++)if(V[i].second==V[nxt(i)].second&&V[i].second==V[nxt(i,2)].second){
(V[i].second?op2:op1)=1;if(V[i].first||V[nxt(i)].first)(V[i].second?op4:op3)=1;
}
bol reved=0;
if(op3&&op4)endC();
if(op3&&!op2)endA();
if(op4&&!op1)endB();
if(op3&&op2){
for(uint i=0;i<m;i++)if(!V[pre(i)].second&&V[i].second&&V[nxt(i)].second&&V[nxt(i,2)].second)
{
uint j=i;while(V[j].second)j=nxt(j);
if(V[pre(j)].first){
if(reved)endC();else reved=1;
if(V[nxt(j)].second&&V[nxt(j,2)].second&&V[nxt(j,3)].second)endC();
}
if(V[pre(i)].first){
if(reved)endC();else reved=1;
if(V[pre(i,2)].second&&V[pre(i,3)].second&&V[pre(i,4)].second)endC();
}
}
endA();
}
if(op4&&op1){
for(uint i=0;i<m;i++)if(V[pre(i)].second&&!V[i].second&&!V[nxt(i)].second&&!V[nxt(i,2)].second)
{
uint j=i;while(!V[j].second)j=nxt(j);
if(V[pre(j)].first||V[pre(i)].first)endC();
}
endB();
}
if(op1){
std::vector<std::pair<uint,uint> >Wins;
for(uint i=0;i<m;i++)if(V[pre(i)].second&&!V[i].second&&!V[nxt(i)].second&&!V[nxt(i,2)].second)
{
uint j=nxt(i,2);while(!V[j].second)j=nxt(j);
if(V[pre(i)].first)Wins.push_back({i,j});
if(V[pre(j)].first)Wins.push_back({i,j});
}
if(Wins.size()){
if(!op2)endA();
uint p=-1,w=0;
for(uint i=0;i<m;i++)if(!V[pre(i)].second&&V[i].second&&V[nxt(i)].second&&V[nxt(i,2)].second){
uint j=nxt(i,2);while(V[j].second)j=nxt(j);
if(V[pre(j)].first){
if(reved||(V[nxt(j)].second&&V[nxt(j,2)].second&&V[nxt(j,3)].second))endC();
else reved=1,p=j,w=0;
}
if(V[pre(i)].first){
if(reved||(V[pre(i,2)].second&&V[pre(i,3)].second&&V[pre(i,4)].second))endC();
else reved=1,p=pre(i),w=1;
}
}
if(!reved||Wins.size()>=2)endA();
for(auto s:Wins)if(s.first==p||pre(s.second)==p)endA();
if(w)V[pre(p)].first+=V[p].first,V[p].first=0;
else V[p].first+=V[pre(p)].first,V[pre(p)].first=0;
if(V[pre(Wins[0].first)].first)
V[pre(Wins[0].first,2)].first+=V[pre(Wins[0].first)].first,V[pre(Wins[0].first)].first=0;
else
V[Wins[0].second].first+=V[pre(Wins[0].second)].first,V[pre(Wins[0].second)].first=0;
uint v=0;
for(uint t=0;t<m;t++)if(V[t].second!=V[nxt(t)].second)
v^=V[t].first;
if(v)endA();else endC();
}
}
if(op2){
for(uint i=0;i<m;i++)if(!V[pre(i)].second&&V[i].second&&V[nxt(i)].second&&V[nxt(i,2)].second){
uint j=nxt(i,2);while(V[j].second)j=nxt(j);
if(V[pre(j)].first){
if(reved||(V[nxt(j)].second&&V[nxt(j,2)].second&&V[nxt(j,3)].second))endB();
else reved=1,V[j].first+=V[pre(j)].first,V[pre(j)].first=0;
}
if(V[pre(i)].first){
if(reved||(V[pre(i,2)].second&&V[pre(i,3)].second&&V[pre(i,4)].second))endB();
else reved=1,V[pre(i,2)].first+=V[pre(i)].first,V[pre(i)].first=0;
}
}
}
uint v=0;
for(uint t=0;t<m;t++)if(V[t].second!=V[nxt(t)].second)
v^=V[t].first;
if(v?!reved:reved)endA();else endB();
}
int main()
{
#ifdef MYEE
freopen("QAQ.in","r",stdin);
// freopen("QAQ.out","w",stdout);
#else
#endif
uint t;scanf("%u",&t);
while(t--)solve();
return 0;
}
// 那就是希望。
// 即便需要取模,也是光明。
详细
Test #1:
score: 100
Accepted
time: 2ms
memory: 3056kb
input:
4 11 3 3 3 8 11 1 6 9 11 4 7 2 7 8 11 1 3 4 5 6 9 10 11 1 5 10 1 3 6 8 11 11 2 4 9 11 1 7 8 10
output:
R C C C
result:
ok 4 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 3040kb
input:
4 11 4 2 1 3 5 6 2 4 13 5 5 3 6 7 8 10 1 2 4 9 13 11 5 1 2 5 7 8 11 10 13 6 4 1 2 4 5 6 7 3 8 9 10
output:
B R B B
result:
ok 4 lines
Test #3:
score: 0
Accepted
time: 1ms
memory: 2892kb
input:
4 13 6 3 3 4 5 11 12 13 1 8 9 11 4 2 2 4 5 11 1 3 13 4 5 4 8 11 13 2 3 6 7 9 13 4 4 1 7 9 12 2 5 8 10
output:
B B C C
result:
ok 4 lines
Test #4:
score: 0
Accepted
time: 2ms
memory: 2848kb
input:
4 13 5 4 1 2 9 11 13 3 5 6 10 13 5 4 1 2 7 11 12 3 5 8 13 13 4 5 2 3 6 12 4 5 7 8 13 11 1 5 5 2 3 4 6 7
output:
R B C C
result:
ok 4 lines
Test #5:
score: 0
Accepted
time: 2ms
memory: 2984kb
input:
4 13 3 6 1 2 11 7 8 9 10 12 13 13 5 4 4 5 7 8 12 1 2 11 13 13 4 4 5 7 10 11 1 6 8 13 11 2 4 5 10 1 4 8 11
output:
B B B C
result:
ok 4 lines
Test #6:
score: 0
Accepted
time: 1ms
memory: 2952kb
input:
4 13 5 5 4 8 10 11 12 1 2 3 5 9 11 4 2 1 5 9 10 8 11 13 5 4 1 3 4 6 12 5 9 10 11 13 5 4 1 9 11 12 13 3 4 8 10
output:
B B B R
result:
ok 4 lines
Test #7:
score: 0
Accepted
time: 0ms
memory: 2948kb
input:
4 15 5 5 1 2 6 11 15 3 4 5 10 14 15 5 5 3 4 5 9 15 1 7 11 12 13 15 5 5 1 6 7 8 10 3 4 5 9 15 15 6 1 1 2 4 5 6 15 3
output:
C R C B
result:
ok 4 lines
Test #8:
score: 0
Accepted
time: 2ms
memory: 2848kb
input:
4 15 3 5 7 9 11 6 8 10 12 13 15 5 5 7 10 11 13 14 1 3 5 8 12 15 5 5 1 3 9 14 15 2 4 5 6 10 15 5 5 1 3 6 11 15 2 4 8 10 12
output:
C R R B
result:
ok 4 lines
Test #9:
score: 0
Accepted
time: 0ms
memory: 3036kb
input:
4 15 6 4 2 3 6 13 14 15 1 4 7 12 15 4 3 1 5 13 14 3 9 15 15 6 4 2 3 4 6 7 15 1 5 12 13 15 8 7 1 2 4 5 7 9 14 15 3 6 8 10 11 12 13
output:
C B B C
result:
ok 4 lines
Test #10:
score: 0
Accepted
time: 2ms
memory: 2848kb
input:
5 15 4 4 2 5 9 12 4 6 10 14 15 3 6 7 11 14 2 3 4 6 9 12 15 5 5 1 2 6 9 15 5 8 12 13 14 15 5 5 8 9 12 13 15 4 5 6 11 14 15 5 5 1 2 5 6 11 3 7 8 9 12
output:
R C B R B
result:
ok 5 lines
Test #11:
score: 0
Accepted
time: 1ms
memory: 2900kb
input:
5 15 1 7 15 1 2 3 4 5 6 14 15 5 5 2 8 9 10 12 1 4 11 14 15 15 5 5 3 4 5 8 14 1 2 6 12 15 15 5 5 4 6 7 8 10 1 2 5 9 15 15 5 5 2 4 7 8 14 1 5 11 12 13
output:
C R B C B
result:
ok 5 lines
Test #12:
score: 0
Accepted
time: 2ms
memory: 3044kb
input:
5 15 6 4 6 7 8 10 11 13 4 5 9 12 15 5 5 1 6 7 8 12 4 11 13 14 15 15 4 6 2 4 10 15 1 6 7 8 9 12 15 5 5 2 7 10 11 12 1 3 9 14 15 15 3 4 5 7 15 2 3 6 13
output:
B B C B C
result:
ok 5 lines
Test #13:
score: 0
Accepted
time: 2ms
memory: 2848kb
input:
5 15 5 5 3 9 13 14 15 1 6 7 8 10 15 5 5 2 3 7 14 15 1 4 5 6 11 15 4 6 7 10 11 15 4 5 6 8 9 12 15 4 6 2 6 12 15 4 8 9 10 13 14 15 5 5 8 10 11 12 15 1 2 3 9 13
output:
R B B C B
result:
ok 5 lines
Test #14:
score: 0
Accepted
time: 1ms
memory: 2824kb
input:
5 15 5 5 2 4 6 9 13 3 7 8 10 14 15 5 5 9 11 12 14 15 1 2 3 10 13 15 4 6 3 12 14 15 2 7 8 9 10 13 15 5 5 1 3 4 7 15 2 6 11 12 14 15 6 4 5 6 8 9 10 13 1 7 12 15
output:
C B C R B
result:
ok 5 lines
Test #15:
score: 0
Accepted
time: 2ms
memory: 2976kb
input:
5 100 15 15 3 6 9 29 33 38 41 44 48 57 66 75 82 93 98 4 8 23 31 35 39 43 46 53 62 73 78 87 96 100 100 17 13 1 15 36 46 51 62 63 64 65 67 69 71 72 73 74 76 90 6 31 43 48 49 50 57 66 68 70 75 89 95 100 16 14 1 3 74 76 78 80 82 83 85 87 89 91 93 95 97 99 2 75 77 79 81 84 86 88 90 92 94 96 98 100 100 19...
output:
R B B R B
result:
ok 5 lines
Test #16:
score: 0
Accepted
time: 0ms
memory: 2900kb
input:
5 100 19 11 9 31 35 46 54 79 80 81 82 84 85 86 88 89 90 91 93 94 95 11 32 33 34 45 52 78 83 87 92 96 100 12 18 11 26 27 36 46 70 71 76 86 93 94 99 10 15 16 30 31 40 57 73 82 83 84 85 87 89 90 91 92 96 100 20 10 4 26 35 62 64 67 73 74 75 76 77 78 79 81 82 83 84 85 86 87 3 25 29 33 36 66 70 71 72 80 1...
output:
C C B C B
result:
ok 5 lines
Test #17:
score: 0
Accepted
time: 2ms
memory: 2868kb
input:
5 100 15 15 2 7 29 41 42 44 46 48 50 52 54 55 60 85 93 1 3 9 37 43 45 47 49 51 53 56 82 91 99 100 100 15 15 1 3 5 7 9 11 13 14 31 41 71 94 95 97 99 2 4 6 8 10 12 28 29 30 34 52 93 96 98 100 100 15 15 5 19 32 62 76 79 80 82 84 86 88 90 92 93 98 13 29 59 60 61 66 78 81 83 85 87 89 91 94 100 100 16 14 ...
output:
R B C B C
result:
ok 5 lines
Test #18:
score: 0
Accepted
time: 1ms
memory: 2980kb
input:
20 1000 11 9 61 151 244 250 278 332 337 369 373 383 894 34 35 36 82 152 270 364 371 524 1000 11 9 44 94 95 96 98 100 102 103 294 575 796 93 97 99 101 104 297 665 815 897 1000 8 12 61 66 426 518 528 553 631 979 58 59 60 62 63 64 65 85 453 541 601 943 1000 8 12 205 271 306 407 441 811 964 968 181 252 ...
output:
R B B B C B B B B B C B R B B B C B B R
result:
ok 20 lines
Test #19:
score: 0
Accepted
time: 1ms
memory: 2816kb
input:
20 1000 10 10 301 599 615 616 618 619 920 924 925 980 299 543 544 545 614 617 887 921 922 923 1000 10 10 154 309 540 659 704 904 905 906 907 973 151 152 153 371 561 660 661 662 903 908 1000 11 9 60 61 62 900 931 932 933 935 936 939 943 36 500 681 930 934 937 940 941 942 1000 11 9 257 258 259 976 980...
output:
R C B B B B B R C C C R R C C C R R B R
result:
ok 20 lines
Test #20:
score: 0
Accepted
time: 0ms
memory: 2860kb
input:
20 1000 10 10 5 419 471 475 630 631 632 634 635 721 2 3 4 420 472 473 474 551 633 636 1000 10 10 221 224 317 318 319 338 652 762 905 977 219 220 222 223 230 320 506 639 664 795 1000 11 9 145 231 232 233 289 353 354 356 357 358 407 105 230 234 235 236 352 355 359 817 1000 14 6 520 759 803 804 805 806...
output:
R B C B B B R B R B B B B C C B B B B R
result:
ok 20 lines
Test #21:
score: 0
Accepted
time: 2ms
memory: 2876kb
input:
5 9999999 150 150 37257 206259 234450 387580 578589 615372 673261 743334 743338 794572 833407 1408702 1572838 2019100 2019101 2019102 2081720 2098388 2132624 2976635 2980948 2980949 2980950 3001093 3001097 3014813 3016187 3016188 3016190 3016192 3016194 3016196 3016198 3016200 3016202 3016204 301620...
output:
B B C B C
result:
ok 5 lines
Test #22:
score: 0
Accepted
time: 2ms
memory: 2872kb
input:
5 9999999 146 154 233597 264788 264792 345011 345012 345013 345017 352995 352996 352997 353001 731941 737266 1075647 1090657 1212195 2034455 2119606 2149245 2149246 2149247 2170518 2170522 2170523 2170524 2170527 2170530 2170532 2170534 2170536 2170538 2170540 2170542 2170544 2170546 2170548 2170550...
output:
B C C C B
result:
ok 5 lines
Test #23:
score: 0
Accepted
time: 2ms
memory: 2880kb
input:
5 9999999 151 149 211277 256407 273121 273125 439630 518109 589143 641230 779454 780839 780840 780841 781054 1026218 1105707 1129751 1253130 1253134 1475664 1492357 1492358 1492360 1492362 1492364 1492366 1492368 1492370 1492372 1492374 1492376 1492378 1492380 1492382 1492384 1492386 1492388 1492390...
output:
R B B R R
result:
ok 5 lines
Test #24:
score: 0
Accepted
time: 4ms
memory: 2904kb
input:
15 1000000 402 598 6442 6777 6778 6779 7330 16610 16636 16637 16638 20242 20555 20559 24243 24375 37188 37216 37217 37218 37643 44575 45077 45081 45298 45299 45300 45626 51754 59650 59780 59781 59782 61935 63052 70074 70125 70126 70127 70242 70246 75875 77923 78337 93469 94143 94147 94609 97257 1078...
output:
R B C B C C B B R R B B B C C
result:
ok 15 lines
Test #25:
score: 0
Accepted
time: 0ms
memory: 3188kb
input:
5 1000000000 2446 2442 145613 1705596 2601367 2682534 2873537 2953597 2953598 2953599 2965967 3221057 3383559 7611830 8935977 9078024 9512246 9512250 9662102 10656933 12081997 13860946 13903101 14181624 14181628 14236051 16044777 16917514 17279177 17279181 19465751 19702320 20477024 20477028 2074225...
output:
C C R C B
result:
ok 5 lines
Test #26:
score: 0
Accepted
time: 6ms
memory: 3188kb
input:
5 1000000000 2445 2443 323359 650680 696403 818033 1698241 1803559 1972901 2227617 2400614 2624850 2651976 2859190 3379673 3631205 4244948 4441255 4671698 4910108 5014345 5301638 5413349 5597936 5858704 6281227 6401714 6811613 7104171 7177000 7280676 7334665 7870129 8334611 8646789 8782435 8963988 9...
output:
B B B B C
result:
ok 5 lines
Test #27:
score: 0
Accepted
time: 0ms
memory: 2968kb
input:
5 1000000000 2444 2444 21234 421451 504494 957488 1057673 1228404 1543011 1800118 1915469 2121356 2363569 2629049 3056060 3550050 3593070 3655700 3803376 3917217 3924620 4254473 4561524 4889002 5237610 5394299 5637398 5750969 5936810 6369030 6748591 7001087 7416532 7639299 7979330 8102208 8880464 89...
output:
R B B C R
result:
ok 5 lines
Test #28:
score: 0
Accepted
time: 19ms
memory: 5648kb
input:
1 400000001 64037 35964 113995 129073 132920 141251 155756 158097 312753 315554 315555 315556 326534 333401 359887 363144 383764 388941 395900 411019 417841 419652 424400 431494 577648 596464 601513 607152 621635 622260 622261 622262 625506 632685 665774 671722 703644 707003 710672 723044 738318 775...
output:
B
result:
ok single line: 'B'
Test #29:
score: 0
Accepted
time: 19ms
memory: 4760kb
input:
1 800000000 50005 49995 37954 162132 203077 235075 267270 286693 286697 317993 317997 330151 405790 423000 450553 499774 539729 539730 539731 555876 562731 576117 576121 588366 588367 588368 597894 677470 715608 761695 787307 787308 787309 795101 795105 837545 843807 893266 893270 916867 965405 9864...
output:
C
result:
ok single line: 'C'
Test #30:
score: 0
Accepted
time: 135ms
memory: 30128kb
input:
1 1000000000 499984 500016 18340 20107 20206 20627 22255 26836 27301 28772 31749 31951 32310 33974 34449 35023 36126 36620 36799 36879 37636 39026 41742 41924 43978 45098 46228 49159 49551 54062 56382 56628 56747 57226 59557 59704 60500 63525 64802 65890 66588 67505 69434 71015 165174 167460 168283 ...
output:
C
result:
ok single line: 'C'
Test #31:
score: 0
Accepted
time: 145ms
memory: 30000kb
input:
1 1000000000 499916 500084 2997 3042 3043 3044 4009 7708 9394 9395 9396 10519 10523 11592 14732 15631 33952 38502 38730 38731 38732 39248 43253 43257 45902 47326 52880 52884 62169 62696 62697 62698 62854 64523 64527 69154 84026 84030 84031 84032 84313 84317 86208 86986 86987 86988 87198 87202 87203 ...
output:
B
result:
ok single line: 'B'
Test #32:
score: 0
Accepted
time: 138ms
memory: 34308kb
input:
1 1000000000 564576 435424 3257 7503 7507 7593 16576 22045 24421 26150 30149 30668 30669 30670 30674 31379 31750 40683 48001 48005 48080 48084 48328 59720 62809 63583 63587 66942 68353 68456 70361 70362 70363 70367 72269 75081 75082 75083 77283 83019 86053 86057 88653 88654 88655 91479 94869 94873 9...
output:
B
result:
ok single line: 'B'
Test #33:
score: 0
Accepted
time: 160ms
memory: 35024kb
input:
1 999999999 642024 357975 3954 3955 3956 4163 4167 4661 4662 4663 5873 8597 15797 15801 23027 24916 24917 24918 26205 30594 30598 30599 30600 30604 35775 36977 37747 55347 55351 62078 62714 62715 62716 71115 75768 81808 81843 83743 86235 86239 89374 90025 94953 95913 125770 127070 136273 139281 1392...
output:
B
result:
ok single line: 'B'
Test #34:
score: 0
Accepted
time: 129ms
memory: 23756kb
input:
1 999999999 499888 500111 4143 5161 6873 6874 6875 9991 9995 12652 13332 13333 13334 13338 14946 18628 18629 18630 23010 23014 26035 28199 28200 28201 28236 33846 39274 42342 42346 45948 52704 53796 61050 63600 63604 66160 72245 73325 73326 73327 73331 73551 80069 80582 80583 80584 80588 81709 84897...
output:
B
result:
ok single line: 'B'
Test #35:
score: 0
Accepted
time: 159ms
memory: 33908kb
input:
1 1000000000 561747 438253 3407 8644 9090 9890 13881 15199 18513 20709 24661 26452 27564 30368 30994 36055 37370 39658 41233 41498 44390 45165 46246 46773 47611 50350 53344 54683 56755 63666 67369 68985 70069 70776 74007 75941 76227 79287 84098 85902 89326 90446 91984 92548 96888 102615 103220 10472...
output:
R
result:
ok single line: 'R'
Test #36:
score: 0
Accepted
time: 212ms
memory: 2824kb
input:
50000 1000000000 8 12 295692976 504701935 504701939 605123456 608837432 608837434 608837439 792339064 504701936 504701937 504701938 608837430 608837431 608837433 608837435 608837436 608837437 608837438 754683356 936727210 1000000000 10 10 4263538 123303026 250024817 348043192 434213501 485746736 587...
output:
C R C B B R B B B B C B B B B B B C B C B B B C B B C C R B B B B B R C C C C C R B R R C C R B C R B B B R C R B B B B C B B C R B B B C C R C C B R B C R B B C R B R C C B R C R B R C B B C B B C R B B B B C C B C R B C B R B R C B B B B B B C C B B B R C B C B C B C B R C B B R R R R C B B R B B ...
result:
ok 50000 lines
Test #37:
score: 0
Accepted
time: 0ms
memory: 2816kb
input:
5 15 4 6 3 7 11 14 1 2 8 12 13 15 15 4 2 6 8 9 11 7 10 15 6 4 2 3 4 6 10 13 9 12 14 15 15 4 6 3 5 8 12 6 7 9 10 11 15 15 5 5 3 4 11 13 14 2 5 7 8 12
output:
C B B B R
result:
ok 5 lines
Test #38:
score: 0
Accepted
time: 1ms
memory: 2896kb
input:
4 15 5 5 3 4 5 9 15 1 7 12 13 14 15 5 5 2 3 6 7 13 1 5 11 14 15 15 5 5 1 6 12 13 15 2 3 5 11 14 15 6 2 1 4 6 8 11 14 3 13
output:
B B C B
result:
ok 4 lines