QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#37430#993. 100 Boxes Per Hour...axsWA 35ms3820kbC++954b2022-07-01 13:55:142022-07-01 13:55:15

Judging History

This is the latest submission verdict.

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-07-01 13:55:15]
  • Judged
  • Verdict: WA
  • Time: 35ms
  • Memory: 3820kb
  • [2022-07-01 13:55:14]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;
int t;
char s[100],c[100];
int a[100],f[100],g[100];
int main()
{
	scanf("%d",&t);
	while (t--)
	{
		s[1]='R';
		s[2]='G';
		s[3]='B';
		f[1]=1;
		f[2]=2;
		f[3]=0;
		for (int i=1;i<=3;++i)
		{
			scanf("%d",&a[i]);
			g[i]=0;
		}
		sort(a+1,a+1+3);
		bool b=false;
		for (int i=1;i<=100;++i)
		{
			scanf("%s",c);
			for (int j=1;j<=3;++j)
				if (c[0]==s[j])
				{
					++g[j];
					if (j==3&&!b&&g[j]>a[2])
					{
						b=true;
						if (g[1]<=g[2])
						{
							f[1]=0;
							f[3]=1;
							printf("EMPTY 1\n");
							fflush(stdout);
						}
						else
						{
							f[2]=0;
							f[3]=2;
							printf("EMPTY 2\n");
							fflush(stdout);
						}
					}
					if (f[j])
					{
						printf("PLACE %d\n",f[j]);
						fflush(stdout);
					}
					else
					{
						printf("DISCARD\n");
						fflush(stdout);
					}
				}
		}
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 35ms
memory: 3820kb

input:

100
3 33 64
B
G
R
R
G
R
B
R
G
R
R
B
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
R
R
G
84 8 8
B
B
B
R
R
R
R
R
G
G
G
G
G
G
G
G
B
B
B
B
B
B
B
B
B
B
B
B
R
B
B
B
B
B
B
B
B
B
B
B
B...

output:

DISCARD
PLACE 2
PLACE 1
PLACE 1
PLACE 2
PLACE 1
DISCARD
PLACE 1
PLACE 2
PLACE 1
PLACE 1
DISCARD
PLACE 2
PLACE 1
PLACE 1
PLACE 2
PLACE 1
PLACE 1
PLACE 2
PLACE 1
PLACE 1
PLACE 2
PLACE 1
PLACE 1
PLACE 2
PLACE 1
PLACE 1
PLACE 2
PLACE 1
PLACE 1
PLACE 2
PLACE 1
PLACE 1
PLACE 2
PLACE 1
PLACE 1
PLACE 2
PLAC...

result:

wrong answer Bad score