QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#400957#993. 100 Boxes Per Hour...MagicDark (Yi Yao, Haikun Zhao, Xingqian Wang)TL 0ms0kbC++171.1kb2024-04-27 19:12:402024-04-27 19:12:41

Judging History

This is the latest submission verdict.

  • [2024-04-27 19:12:41]
  • Judged
  • Verdict: TL
  • Time: 0ms
  • Memory: 0kb
  • [2024-04-27 19:12:40]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;
int cn[3],v1,v2;
string E="RGB";
int ip(char c){for(int i=0;i<3;i++)if(c==E[i])return i;return -1;}
void sol(){
    int a,b,c;scanf("%d%d%d",&a,&b,&c);
    if(a>b)swap(a,b);if(b>c)swap(b,c);if(a>b)swap(a,b);
    v1=v2=-1;
    memset(cn,0,sizeof(cn));
    for(int t=1;t<=100;t++){
        char C[2];scanf("%s",C);int x=C[0];
        if(a+b>=43){
            if(x)printf("PLACE %d\n",x);
            else puts("DISCARD");
        }
        else if(a<20){
            cn[x]++;
            if(cn[x]>=20){
                if(v1==-1||v1==x)puts("PLACE 1"),v1=x;
                else if(v2==-1||v2==x)puts("PLACE 2"),v2=x;
                else puts("DISCARD");
            }
        }
        else{
            cn[x]++;
            if(cn[x]>=23&&v1!=-1&&v2!=-1&&v1!=x&&v2!=x)puts("EMPTY 1"),v1=x;
            if(v1==-1||v1==x)puts("PLACE 1"),v1=x;
            else if(v2==-1||v2==x)puts("PLACE 2"),v2=x;
            else puts("DISCARD");
        }
        fflush(stdout);
    }
}
int main(){
    int T;scanf("%d",&T);while(T--)sol();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Time Limit Exceeded

input:

100
3 33 64
B

output:


result: