QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#569641#9320. Find the Easiest ProblemwcdrAC ✓33ms6184kbC++172.8kb2024-09-17 03:04:112024-09-17 03:04:13

Judging History

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

  • [2024-09-17 03:04:13]
  • 评测
  • 测评结果:AC
  • 用时:33ms
  • 内存:6184kb
  • [2024-09-17 03:04:11]
  • 提交

answer

#include<random>
#include<iostream>
#include<iomanip>
#include<cmath>
#include<ctime>
#include<cctype>
#include<cstdio>
#include<cstdlib>
#include<climits>
//#define NDEBUG
#include<cassert>
#include<cstring>
#include<complex>
#include<algorithm>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<vector>
#include<bitset>
//#define LL __int128
#define LL long long
#define ULL unsigned LL
#define uint unsigned int
//#define int LL
//#define double long double
#define mkp make_pair
#define par pair<int,int>
#define psb push_back
#define epb emplace_back
#define f(x) ((x).first)
#define s(x) ((x).second)
using namespace std;
#define Lbt(x) ((x)&(-(x)))
#define Swap(x,y) (x^=y^=x^=y)
const int Mxxx=1e5;
inline char gc()
{
	return getchar();
	static char buf[Mxxx],*p1=buf,*p2=buf;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,Mxxx,stdin),p1==p2)?EOF:*p1++;
}
inline char pc(char ch,bool fl=false)
{
//	return fl?0:putchar(ch),0;
	static char buf[Mxxx],*p1=buf,*p2=buf+Mxxx;
	return (fl||((*p1++=ch)&&p1==p2))&&(fwrite(buf,1,p1-buf,stdout),p1=buf),0;
}
#define output pc('!',true)
inline int read()
{
	char ch=gc();
	int gans=0,gflag=0;
	for(;ch<'0'||'9'<ch;gflag|=ch=='-',ch=gc());
	for(;'0'<=ch&&ch<='9';gans=(gans<<1)+(gans<<3)+(ch^48),ch=gc());
	return gflag?-gans:gans;
}
template<typename T>
inline char read(T&gans)
{
	char ch=gc();
	int gflag=0;gans=0;
	for(;ch<'0'||'9'<ch;gflag|=ch=='-',ch=gc());
	for(;'0'<=ch&&ch<='9';gans=(gans<<1)+(gans<<3)+(ch^48),ch=gc());
	return gans=gflag?-gans:gans,ch;
}
template<typename T>
inline void write(T x)
{
	if(x>9)write(x/10);
	pc(x%10^48);
}
template<typename T>
inline void writenum(T x,char ch)
{
	if(x<0)pc('-'),x=-x;
	write(x);pc(ch);
}
inline void writechar(char x,char ch)
{
	pc(x);pc(ch);
}
template<typename T>
inline T Max(T x,T y)
{
	return x>y?x:y;
}
template<typename T>
inline T Min(T x,T y)
{
	return x<y?x:y;
}
template<typename T>
inline T Abs(T x)
{
	return x<0?-x:x;
}
template<typename T>
inline void ckmx(T&x,T y)
{
	x=Max(x,y);
}
template<typename T>
inline void ckmn(T&x,T y)
{
	x=Min(x,y);
}
int TT;
int n,tt[26];map<string,int>mp[26];
signed main()
{
	#ifndef ONLINE_JUDGE
	freopen("_.in","r",stdin);
//	freopen("_.out","w",stdout);
	#endif
	int i,p;static string str,ID,Result;
	for(TT=read();TT;TT--)
	{
		n=read();
		for(i=0;i<26;i++)tt[i]=0,mp[i].clear();
		for(i=1;i<=n;i++)
		{
			cin>>str>>ID>>Result;
			if(Result[0]=='a')
			{
				if(!(mp[p=ID[0]-'A'][str]++))tt[p]++;
			}
		}
		for(p=i=0;i<26;i++)if(tt[i]>tt[p])p=i;
		writechar('A'+p,10);
	}
	return output;
}
/*
2
5
teamA A accepted
teamB B rejected
teamC A accepted
teamB B accepted
teamD C accepted
4
teamA A rejected
teamB A accepted
teamC B accepted
teamC B accepted
*/

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3860kb

input:

2
5
teamA A accepted
teamB B rejected
teamC A accepted
teamB B accepted
teamD C accepted
4
teamA A rejected
teamB A accepted
teamC B accepted
teamC B accepted

output:

A
A

result:

ok 2 lines

Test #2:

score: 0
Accepted
time: 19ms
memory: 3640kb

input:

1000
44
WaiooyIXa O accepted
WaiooyIXa P accepted
ZYYsNWag P accepted
DPIawQg D rejected
IzPdjnM Z rejected
Ra D rejected
kwQyGxLo I rejected
DPIawQg L accepted
kwQyGxLo I accepted
mmWxDuADCB D rejected
PXwVAOgwiz P rejected
ZYYsNWag U accepted
IzPdjnM Z accepted
TgBNO P rejected
kwQyGxLo J accepted...

output:

Z
E
Z
I
B
I
G
H
S
K
J
I
H
R
Z
C
K
O
I
P
A
B
I
A
A
N
A
B
A
O
F
O
R
T
H
G
K
E
S
D
F
D
R
C
U
V
W
P
A
O
J
E
A
B
U
M
C
T
L
G
V
A
Z
N
E
O
Q
F
B
G
J
I
E
M
A
A
E
A
K
J
J
S
E
W
Z
K
F
I
S
P
M
H
G
G
H
W
I
P
T
D
O
A
F
N
C
S
Y
Z
S
G
J
F
Q
F
O
C
B
B
U
C
I
A
E
I
P
K
C
R
X
N
D
N
L
Q
L
I
X
I
H
U
J
Z
D
K
G
F
T
F
B
H
...

result:

ok 1000 lines

Test #3:

score: 0
Accepted
time: 18ms
memory: 3788kb

input:

1000
39
OnYbTl Y accepted
m I accepted
NJN T accepted
lTGE D accepted
mi K accepted
ttcHrVD W accepted
hvGveRIr J rejected
zTwvbWhhQT S rejected
VlAcLAHas E accepted
hM H accepted
wltR G rejected
JJWtQ H accepted
zVwBtj L rejected
ZVqAWCsj I rejected
BwuM B accepted
IpUXa R rejected
OdSv D rejected
...

output:

H
R
M
I
S
J
D
D
A
E
X
S
I
D
D
A
I
N
G
O
F
G
G
B
A
J
E
H
D
I
G
M
O
N
C
G
F
L
V
D
C
S
B
U
H
W
L
J
C
O
B
D
L
N
D
V
K
M
Z
C
T
H
K
U
I
T
R
R
Q
D
B
E
F
A
Q
O
F
M
C
T
M
E
Y
L
K
Q
K
E
A
O
E
J
O
B
N
R
A
E
D
I
A
Q
W
A
M
A
Z
W
K
M
I
J
B
F
L
X
E
R
G
A
I
H
Q
P
T
E
K
L
Q
U
C
A
F
C
A
S
N
G
G
U
L
J
J
A
A
J
A
B
A
E
...

result:

ok 1000 lines

Test #4:

score: 0
Accepted
time: 19ms
memory: 3860kb

input:

1000
15
vCproSIO G rejected
vCproSIO H rejected
ySoEaGKbVz R rejected
ySoEaGKbVz M accepted
vCproSIO Z rejected
ySoEaGKbVz C rejected
YVCmuO H accepted
XHHVYm Y rejected
YVCmuO H rejected
vCproSIO S accepted
ySoEaGKbVz J accepted
YVCmuO P rejected
ySoEaGKbVz E rejected
XHHVYm O accepted
vCproSIO T r...

output:

H
A
F
A
N
J
B
C
H
T
B
L
G
Z
J
H
F
A
B
H
A
O
V
E
B
O
L
B
J
D
I
Y
M
B
Q
B
F
E
T
B
T
C
C
X
E
P
S
M
A
Q
G
D
A
A
H
I
H
E
D
C
A
A
V
C
B
C
D
E
B
F
I
D
C
M
J
P
N
F
V
K
E
K
K
B
B
F
Q
L
B
E
Q
A
R
E
V
C
Y
D
I
C
H
N
H
G
G
M
A
H
E
D
U
N
N
M
R
K
C
B
F
O
H
V
I
A
U
R
Y
D
A
A
A
G
E
N
N
L
C
A
E
C
B
Z
P
W
K
U
D
H
D
V
...

result:

ok 1000 lines

Test #5:

score: 0
Accepted
time: 12ms
memory: 4412kb

input:

1
27400
RPRPRNWL O accepted
UTqhXsDpY R rejected
BabD A rejected
eNM Y rejected
HzIyx S accepted
phWEJVQ N rejected
NbisS Q accepted
cTIsPKm Y rejected
sElDxdT T accepted
BJuQR Q rejected
vfPJs W rejected
eF Z accepted
KyOHzFtXm B accepted
wZlyz T accepted
acDVjN C accepted
M X rejected
sW A accepte...

output:

P

result:

ok single line: 'P'

Test #6:

score: 0
Accepted
time: 10ms
memory: 3668kb

input:

1
29702
Wsfzx N rejected
yZkJOvtRG B rejected
Wsfzx A accepted
yZkJOvtRG C rejected
F G accepted
kyUxIv U accepted
li R rejected
F Q rejected
F Y accepted
F I accepted
yZkJOvtRG J rejected
Wsfzx C rejected
Wsfzx V accepted
yZkJOvtRG L rejected
F X rejected
kyUxIv K accepted
li G accepted
Wsfzx Z acc...

output:

A

result:

ok single line: 'A'

Test #7:

score: 0
Accepted
time: 27ms
memory: 3568kb

input:

1
99584
I Y rejected
I F accepted
I Z rejected
I G accepted
I J rejected
I A rejected
I C rejected
I R rejected
I J accepted
I L rejected
I A rejected
I L accepted
I E rejected
I O accepted
I P accepted
I F rejected
I O accepted
I E accepted
I W accepted
I X rejected
I G accepted
I R rejected
I A re...

output:

A

result:

ok single line: 'A'

Test #8:

score: 0
Accepted
time: 9ms
memory: 4600kb

input:

1
26160
QmDDKxIel A rejected
gmxZDM O rejected
thXodr Z accepted
sznPsL Z accepted
VynmaLp B rejected
MfJQRamC T rejected
W W accepted
WFqnF T accepted
QRys Y accepted
Q H accepted
XUiMDH H accepted
fPcwpz U rejected
oEqrrOAv D rejected
aeW O accepted
M B accepted
JYzynly O accepted
JJqNf G rejected...

output:

E

result:

ok single line: 'E'

Test #9:

score: 0
Accepted
time: 24ms
memory: 3564kb

input:

1000
81
pnnCvDUIH B rejected
rdcJWGYGhk B accepted
VBFvmoYLn B accepted
jdMRRJuIpZ B rejected
WLewtGWJw A rejected
zGAkWsrfG A accepted
MDzQocBGr A rejected
XufUaIWaKT A accepted
JachfkiYL A rejected
zvDlkMINf B rejected
NMfFDEVhG A rejected
axiTyJnXu B accepted
wLkSOTqqV A rejected
amkUqtOyMB B rej...

output:

B
B
B
B
B
A
B
A
A
A
B
B
B
A
A
B
B
A
B
A
A
A
B
A
A
B
B
B
A
A
A
B
B
A
A
B
A
B
B
B
A
B
A
B
B
A
B
A
A
A
A
A
B
A
B
B
A
A
A
A
B
A
B
A
A
A
B
A
A
B
B
A
A
A
B
B
A
A
B
B
B
A
A
A
A
A
A
B
A
B
B
B
B
A
A
B
B
B
B
B
A
B
A
A
B
A
A
B
A
A
B
A
B
A
A
A
B
B
A
A
B
A
B
B
A
B
A
B
A
A
A
B
B
A
A
A
B
B
A
A
A
A
B
A
B
A
A
A
A
A
...

result:

ok 1000 lines

Test #10:

score: 0
Accepted
time: 33ms
memory: 6184kb

input:

1
61839
BGQriOTlZ B rejected
ZIqGhTsmH B rejected
DxIVjUqBr A rejected
afbRvvloO A accepted
LskKGrpIx A rejected
zGnHxzKmA B rejected
bHSaQfYtu A rejected
xPTMHyQgD B rejected
xWrkTqLhH B accepted
tGUVjSpmjI A accepted
bBBZKwbsw A accepted
IAaiNrLMLe B accepted
bglBZRQuk B accepted
DtLTczAkJo A reje...

output:

B

result:

ok single line: 'B'

Extra Test:

score: 0
Extra Test Passed