QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#454895#8230. SubmissionsZSH_ZSHAC ✓395ms94868kbC++144.1kb2024-06-25 16:18:522024-06-25 16:18:52

Judging History

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

  • [2024-06-25 16:18:52]
  • 评测
  • 测评结果:AC
  • 用时:395ms
  • 内存:94868kb
  • [2024-06-25 16:18:52]
  • 提交

answer

#include<bits/stdc++.h>
#define rep(i,a,b) for (int i=(a);i<=(b);i++)
#define drep(i,a,b) for (int i=(a);i>=(b);i--)
using namespace std;
typedef long long ll;

#define fir first
#define sec second
typedef pair<int,int> pii;
inline pii operator + (const pii &x,const pii &y){return {x.fir+y.fir,x.sec+y.sec};}
inline pii operator - (const pii &x,const pii &y){return {x.fir-y.fir,x.sec-y.sec};}

struct sub
{
	int id,prob,t,status;
};
inline pii better(const pii &x,const pii &y)
{
	if (x.fir<y.fir) return y;
	if (x.fir>y.fir) return x;
	return {x.fir,min(x.sec,y.sec)};
}

void solve()
{
	int m; cin>>m;
	int n=0;
	map<string,int> teamid;
	vector<string> names;
	vector<array<vector<sub>,26> > V;
	rep(i,1,m)
	{
		string name; 
		char prob;
		int t;
		string status;

		cin>>name>>prob>>t>>status;
		if (!teamid.count(name))
		{
			teamid[name]=n++;
			V.push_back({});
			names.push_back(name);
		}
		int id=teamid[name];
		int p=prob-'A';
		int s=(status[0]=='a')?1:0;
		V[id][p].push_back((sub){id,p,t,s});
	}
	assert(V.size()==n);

	auto getord=[&](const vector<pii> &score)
	{
		vector<int> ord(n);
		rep(i,0,n-1) ord[i]=i;
		sort(ord.begin(),ord.end(),[&](auto i,auto j)
		{
			auto x=score[i];
			auto y=score[j];
			if (better(x,y)!=y) return 1;
			return 0;
		});
		return ord;
	};
	auto sim=[&](const vector<sub> &v) -> pii
	{
		pii now={0,0};
		int wa=0;
		for (auto it:v)
		{
			if (it.status==1)
			{
				return {1,it.t+wa*20};
			}
			else wa++;
		}
		return now;
	};

	vector<int> canwin(n);
	auto simulate=[&]()
	{
		vector<pii> score(n);
		rep(id,0,n-1)
		{
			rep(p,0,25)
			{
				score[id]=score[id]+sim(V[id][p]);
			}
		}

		int valid=0;
		rep(i,0,n-1) if (score[i].fir) valid++;
		vector<int> ord=getord(score);

		if (valid!=0)
		{
			int gold=min(35,(valid+9)/10);
			rep(i,0,gold-1) canwin[ord[i]]=1;
			int j=gold-1;
			while (j+1<n&&score[ord[gold-1]]==score[ord[j+1]]) j++;
			rep(i,gold,j) canwin[ord[i]]=1;
		}

		return score;
	};

	auto score=simulate();
	auto ord=getord(score);

	rep(ii,0,min(n-1,35))
	{
		int id=ord[ii];
		pii best={0,0};
		pii pos={-1,-1};
		rep(p,0,25)
		{
			int f=-1;
			rep(i,0,(int)V[id][p].size()-1) if (V[id][p][i].status==1)
			{
				f=i;
				break;
			}
			if (f==-1) continue;
			auto now=sim(V[id][p]);
			V[id][p][f].status=0;
			auto nxt=sim(V[id][p]);
			V[id][p][f].status=1;

			auto diff=now-nxt;
			if (diff==better(best,diff))
			{
				pos={p,f};
				best=diff;
			}
		}
		if (pos.fir!=-1)
		{
			V[id][pos.fir][pos.sec].status=0;
			simulate();
			V[id][pos.fir][pos.sec].status=1;
		}
	}

	int valid=0;
	rep(i,0,n-1) if (score[i].fir) valid++;

	int luckyt=-1;
	array<int,3> lucky={-1,-1,-1};
	rep(id,0,n-1)
	{
		pii best={0,0};
		rep(p,0,25)
		{
			int f=-1;
			rep(i,0,(int)V[id][p].size()-1) if (V[id][p][i].status==0)
			{
				f=i;
				break;
			}
			if (f==-1) continue;

			auto now=sim(V[id][p]);
			V[id][p][f].status=1;
			auto nxt=sim(V[id][p]);
			V[id][p][f].status=0;
			auto diff=nxt-now;
			if (diff==better(best,diff))
			{
				best=diff;
			}
		}
		auto ns=score[id]+best;

		int nv=(valid-(score[id].fir>0)+(ns.fir>0));
		if (nv)
		{
			int gold=min(35,(nv+9)/10);
			auto g=score[ord[gold-1]];
			if (better(score[ord[gold-1]],ns)==ns)
			{
				canwin[id]=1;
			}
		}

		if (score[id].fir==0&&ns.fir!=0)
		{
			int t=-1;
			pii pos={-1,-1};
			rep(p,0,25)
			{
				rep(i,0,(int)V[id][p].size()-1)
				{
					int tt=V[id][p][i].t+20*i;
					if (t<tt)
					{
						t=tt;
						pos={p,i};
					}
				}
			}
			if (t>luckyt)
			{
				luckyt=t;
				lucky={id,pos.fir,pos.sec};
			}
		}
	}
	if (lucky[0]!=-1)
	{
		V[lucky[0]][lucky[1]][lucky[2]].status=1;
		simulate();
		V[lucky[0]][lucky[1]][lucky[2]].status=0;	
	}

	vector<string> winner;
	rep(i,0,n-1) if (canwin[i]) winner.push_back(names[i]);
	printf("%d\n",winner.size());
	for (auto x:winner) printf("%s ",x.c_str());
	printf("\n");
}

int main()
{
	ios::sync_with_stdio(false); cin.tie(0);

	int T; cin>>T;
	while (T--) solve();

	return 0;
}

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

详细

Test #1:

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

input:

2
5
TSxingxing10 G 0 rejected
TSxingxing10 B 83 accepted
aoliaoligeiliao J 98 accepted
TS1 J 118 accepted
TS1 B 263 accepted
12
AllWayTheNorth A 0 rejected
YaoYaoLingXian Y 10 accepted
XuejunXinyoudui1 X 200 rejected
XuejunXinyoudui1 X 200 accepted
LetItRot L 215 accepted
AllWayTheNorth W 250 accept...

output:

2
TSxingxing10 TS1 
4
AllWayTheNorth XuejunXinyoudui1 LetItRot ImYourFan 

result:

ok 2 test cases ok. (2 test cases)

Test #2:

score: 0
Accepted
time: 0ms
memory: 3816kb

input:

2
2
jiangly_fan A 1 accepted
jiangly B 23 accepted
3
conqueror_of_tourist A 1 accepted
conqueror_of_tourist A 2 accepted
tourist B 23 accepted

output:

2
jiangly_fan jiangly 
1
conqueror_of_tourist 

result:

ok 2 test cases ok. (2 test cases)

Test #3:

score: 0
Accepted
time: 0ms
memory: 4044kb

input:

2
13
A A 1 accepted
A X 1 accepted
K K 1 rejected
B B 2 accepted
C C 2 accepted
D D 2 accepted
E E 2 accepted
F F 2 accepted
G G 2 accepted
H H 2 accepted
I I 2 accepted
J J 2 accepted
K K 2 rejected
12
A A 1 accepted
A X 1 accepted
B B 2 accepted
C C 2 accepted
D D 2 accepted
E E 2 accepted
F F 2 a...

output:

11
A K B C D E F G H I J 
1
A 

result:

ok 2 test cases ok. (2 test cases)

Test #4:

score: 0
Accepted
time: 0ms
memory: 4008kb

input:

2
11
A A 1 accepted
B B 1 accepted
C C 2 accepted
D D 2 accepted
E E 2 accepted
F F 2 accepted
G G 2 accepted
H H 2 accepted
I I 2 accepted
J J 2 accepted
K K 2 accepted
12
A A 1 accepted
A X 1 accepted
K K 1 rejected
B B 2 accepted
C C 2 accepted
D D 2 accepted
E E 2 accepted
F F 2 accepted
G G 2 a...

output:

2
A B 
2
A K 

result:

ok 2 test cases ok. (2 test cases)

Test #5:

score: 0
Accepted
time: 81ms
memory: 4024kb

input:

100000
1
M3JytWoaEXxkACy_mBAQ R 111 accepted
1
sQ O 151 accepted
1
JinbrcS58gNEE5yTSkT B 140 accepted
1
cklwBY V 243 accepted
1
v_o42YmvEKFwy Q 260 rejected
1
ftQVK8S_um22w K 265 accepted
1
_bQBeFeDpYQhvZcLf9l3 Z 147 accepted
1
KvDcEAIDN A 75 rejected
1
H3MUK6 A 101 rejected
1
gxYo_oCFn2J8aIben U 54...

output:

1
M3JytWoaEXxkACy_mBAQ 
1
sQ 
1
JinbrcS58gNEE5yTSkT 
1
cklwBY 
1
v_o42YmvEKFwy 
1
ftQVK8S_um22w 
1
_bQBeFeDpYQhvZcLf9l3 
1
KvDcEAIDN 
1
H3MUK6 
1
gxYo_oCFn2J8aIben 
1
_isnlUGK0ddI 
1
BERcVjyCp 
1
6In2do_50ylch 
1
f0r3SXc6brMjT 
1
7njYOapSwvogA 
1
x 
1
y1w3KvxylfxwprRBYw 
1
aGedzS 
1
iPo0GDhIF 
1
4Vf...

result:

ok 100000 test cases ok. (100000 test cases)

Test #6:

score: 0
Accepted
time: 72ms
memory: 4096kb

input:

10000
42
Bzs0PiQMXGZ5rRZ_2D G 2 accepted
9XtB_VIfbRRL E 11 accepted
FVJL M 13 rejected
a S 19 accepted
tsd Z 20 rejected
MyCqVEg1ONjZ U 22 accepted
6SgZMn N 51 rejected
Qua1Pti3vKhyQKDUm P 54 accepted
i29 M 63 accepted
zPqu D 68 rejected
xx2yiu6x C 71 rejected
fYuK1KNkuyO5HRCq L 76 rejected
tXWpYVqj...

output:

4
tsd Qua1Pti3vKhyQKDUm fYuK1KNkuyO5HRCq xiLm0TUOF3T 
2
t3 JP 
2
fhYPGC8W82NwJTQL 77sgqpbTIr_Zt1 
2
pVWDEz 3BQ 
2
tg buCeoOotAkV8DaFD6 
1
UkXQ3iaNJ 
2
ALTqPt7JUSLrl vwfw 
1
QTEzV6tp 
3
4e1l0pO8eFjZwkDo wJlbqIU 9cy_y_RNRwex8j7224hz 
2
eiuF7a_ 6mbCu5zA 
1
xy6QBr8ECi 
3
ldaKLZb1oS1sS _Yej1PrINtydmOudwo...

result:

ok 10000 test cases ok. (10000 test cases)

Test #7:

score: 0
Accepted
time: 72ms
memory: 4112kb

input:

10000
27
bhAGFVDBjp4_Tvo U 24 accepted
bhAGFVDBjp4_Tvo O 37 rejected
bhAGFVDBjp4_Tvo D 40 accepted
bhAGFVDBjp4_Tvo H 45 accepted
bhAGFVDBjp4_Tvo B 60 rejected
bhAGFVDBjp4_Tvo J 63 accepted
bhAGFVDBjp4_Tvo M 81 rejected
bhAGFVDBjp4_Tvo M 98 rejected
bhAGFVDBjp4_Tvo D 103 rejected
bhAGFVDBjp4_Tvo Q 11...

output:

1
bhAGFVDBjp4_Tvo 
2
euenQ rl 
1
seny 
2
nLWe5xvBqfYkN 8zfFqdixKjh 
1
VDeEtfbb 
1
9PAd7wtbCZMws6u 
1
Wsfc5qold4uacAjI1y 
2
NX6GLK3Nz h68cyLwQ7drM__pSJub 
3
yOgwg U7S8zgJhR6 sdf0IGct21OeEFJ 
1
acesvM9yT 
1
2hQb 
2
3twK2MJI_ P5 
1
eGCz 
3
39GgHUPovILESCd0 tLHWIEVr5i7vlKpvlP UXRu8i 
1
20gsbZ25SsYp8 
1
...

result:

ok 10000 test cases ok. (10000 test cases)

Test #8:

score: 0
Accepted
time: 75ms
memory: 4152kb

input:

10000
2
vVflLovvnhJEO U 3 accepted
Fg P 48 rejected
12
V9UJ5hEaWiwMq3lxwKw9 P 30 accepted
CKsw M 34 rejected
dCZBzKMxgQfgBDZO R 50 rejected
A1R2kF N 54 rejected
A1R2kF X 65 accepted
HEih51ut H 68 rejected
HEih51ut J 75 rejected
l0MCFXNXlH6T2wT I 163 accepted
A1R2kF B 180 accepted
dCZBzKMxgQfgBDZO A ...

output:

1
vVflLovvnhJEO 
2
V9UJ5hEaWiwMq3lxwKw9 A1R2kF 
4
fLUS3NYE 5sFcoMh xgdxQ7t 2 
2
S25TIbMLU5FMV6ys4 2ra47EFC7LWzxTF2tSH 
2
uwm tczurXngUW 
3
gWG1aLfP1Gk DNAv Zh4tWi1QdYjTblw5 
1
qN_OnmRhGksD 
1
pAJC7fTKPJjaxPP 
2
mElj5iV4wfu Jr9Sqekor 
1
_Z13N_OO 
1
rn 
1
HhjFL6Rg 
1
2q 
5
vdFavgJoOBT4vrKWv LjvEZmSkrs...

result:

ok 10000 test cases ok. (10000 test cases)

Test #9:

score: 0
Accepted
time: 71ms
memory: 3848kb

input:

10000
4
BUqwUvN2v7co K 45 accepted
fb4ykhGx9CBzWxLcGYjf F 96 rejected
3X39YaWp0LItH14Owx R 142 rejected
7JGP4qtBonRiKpsKW U 155 rejected
3
Z0cxqdpQ69NGV5wDoht X 92 rejected
1E0aicZDqPhh E 105 accepted
a3fvTkSrKXqQipNGs4h K 261 rejected
6
LR6PY6OjDoSaZpT W 33 accepted
Et8w1E52xfM27 Q 155 accepted
LR6...

output:

1
BUqwUvN2v7co 
2
Z0cxqdpQ69NGV5wDoht 1E0aicZDqPhh 
1
LR6PY6OjDoSaZpT 
3
YX 7f b 
4
WqSH sgpEsfgf_Fd buFAkOkQ_F o7VPp 
1
coTjuCSsnonAgjYkChE 
2
clGo2Z4AMe9Qp GC0Lw1Di 
2
IrJ_n_Ym FCCHBTUTGJTbTjEb 
1
fkBpEQxhBl21ARSTVR 
1
fQzlJS9JEIS97gIIG7p4 
6
pqyDmprb2RmUBafc76eR ljfPMl71hE bLED4G7CY_M CVVvEx togG...

result:

ok 10000 test cases ok. (10000 test cases)

Test #10:

score: 0
Accepted
time: 72ms
memory: 3744kb

input:

10000
7
dBv7DiT L 42 rejected
dBv7DiT P 123 accepted
7Bj2dZF6Gy7csrXYakI T 131 rejected
9KtuO O 190 accepted
BxACEk Q 285 rejected
BxACEk Q 291 rejected
HK0pq9qsGnlkgAQT L 296 accepted
3
NQgnW3CShrFJYkKdjagN G 53 rejected
ZwZCr O 261 accepted
ZwZCr P 270 accepted
6
mbGQ7wcZYr9leKBCsFN Z 4 rejected
7...

output:

2
dBv7DiT 9KtuO 
1
ZwZCr 
2
7s1bgtS 4LUVnW93OFHOl6fJOmXK 
4
_g2LouxyEI_BXaOYQWn pz CZNz6k1QgLrHojbY upCvWQnHRgRSQQ 
3
q ungF4dKzJt290JMWNgeH t 
3
6mCVqSBpHVkrNZ SuBp7xLMGCHgk 4FjAuM44Nzaz6Tc0 
1
xXqqS7r1OU 
1
YEHiJvhHR8OmUWz 
3
m 0WZFvefoPtNo BiasA1Md2ViU 
1
MzQD 
2
MJJ4n2rC7YHRflGzEL L501za_ktc 
1
...

result:

ok 10000 test cases ok. (10000 test cases)

Test #11:

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

input:

7
110
10 A 0 accepted
0 A 100 accepted
1 A 100 accepted
2 A 100 accepted
3 A 100 accepted
4 A 100 accepted
5 A 100 accepted
6 A 100 accepted
7 A 100 accepted
8 A 100 accepted
9 A 100 accepted
0 B 100 accepted
1 B 100 accepted
2 B 100 accepted
3 B 100 accepted
4 B 100 accepted
5 B 100 accepted
6 B 10...

output:

11
10 0 1 2 3 4 5 6 7 8 9 
11
0 1 2 3 4 5 6 7 8 9 10 
11
0 1 2 3 4 5 6 7 8 9 10 
11
100 0 1 2 3 4 5 6 7 8 9 
12
100 0 1 2 3 4 5 6 7 8 9 10 
36
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 
35
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21...

result:

ok 7 test cases ok. (7 test cases)

Test #12:

score: 0
Accepted
time: 110ms
memory: 4172kb

input:

1000
58
8VR4968BiWGrjt0 G 1 accepted
KfduBOJVYor3ixLgzUo Y 5 accepted
r9l9P_xyc7oagiZS0ZJ G 26 accepted
PL3OrMzXRJRVskByRHHl Y 38 accepted
7wL2M4T1PWyv9rJSdzGN N 47 rejected
Vu56KH6ZGwSm E 48 rejected
8VR4968BiWGrjt0 D 53 accepted
SI7h8yP C 57 rejected
aSVEsYSH9PJjsjSAyH N 61 accepted
D3UrdM8xI S 71...

output:

5
8VR4968BiWGrjt0 PL3OrMzXRJRVskByRHHl SI7h8yP mn0iyGyqWOakTAs1Qw umqh9D 
6
9M 6OSsIJ 3A4BJULiR9S f22a5ba_ze2qsm2_2k uxPAbOmdBcWg64Q52 EYdAeGI 
25
19Mbp qF0kRrasPk wd5q6DH XJ9p0AKseAnbt7vmR_ 9sFtbGG4oMjSgmtZh oLi8SUSfzmANlYBZxL io_4OkSzJAGEqNUfs6R Qo8l4lQKg D6SdnJFh6xFQlZehalkc lUs4Rd_AXJR2FP48 qeyR...

result:

ok 1000 test cases ok. (1000 test cases)

Test #13:

score: 0
Accepted
time: 163ms
memory: 7632kb

input:

100
974
qG R 0 accepted
k2K I 0 accepted
NelrCjQd_AHSw107 D 1 accepted
ybeH_JvdmCLMOGl9x K 1 accepted
h3 Q 2 accepted
9qOW O 2 accepted
v1IWHoW7Mkuce6qH Y 2 accepted
mlypVkK5Xl1KXw3o P 2 rejected
zs X 3 accepted
1Fpyq8oUYV_aNp I 3 rejected
e1bM8xUh E 3 rejected
myaSH0LCL4hD5BlAj F 4 rejected
IJETUS2...

output:

65
qG k2K NelrCjQd_AHSw107 ybeH_JvdmCLMOGl9x 9qOW mlypVkK5Xl1KXw3o e1bM8xUh IJETUS2jG jpgL7AOwwgwK4fC LhlGfI4XZ 1qXXQyXNhDyf97IT0n QW b1rD1OQRc v8ok8uFd3 Io5tMwXAJlbYL2Wikqqq 55IlpzN c tHhnCuExgbOb 2tougTgqY91VXB3 Hy551D5ZPfvBDS PlD7x1RoiUUo jjlJFal1mKsc9bV0rJ UL aOtxLwyhTOqQrGSi o_d5R9oBv QXFitGeaP...

result:

ok 100 test cases ok. (100 test cases)

Test #14:

score: 0
Accepted
time: 223ms
memory: 22756kb

input:

10
5371
r0JLpp2hFx T 0 accepted
w19l89 X 0 rejected
PeEB Y 0 accepted
2MwVQe3 Y 0 accepted
CarjodD8k4E K 0 accepted
vNjq0LmY D 0 accepted
Bvi16IvVACG3uREuoO X 0 accepted
yMlDlaWPTluR1dk43nl6 A 0 rejected
4LBA3qILgaib4lrQ X 1 accepted
vRSpyKVAU7e I 1 rejected
627aFcGG4zh8 Z 1 rejected
FHwI U 1 accept...

output:

85
FHwI 5gGJk cvBsYzk5yn SQHfF3xgjBtkER53p ReLcBXGOh VEUvEZytpDQks JH8 yS0d5p8qP uoWF TiH UhNeNpTgJpuTp4im WiikFMuk_mwuntjRW9 KwjId5DA66 vTtpWBju yfY26k6D RYY7Oy5Ma3N_Q 3ntTBJ2G Tsv4prgzdtzBRbKoQO 3L jYd6t8Z6OsPuQA aXGT Piy FlTsTqSJ 9Saa 61F ffjD1wi1E6egT W5kPWYzB 2HT7G5q_UM4CH As_jBpG0uR9t dnPR74xK...

result:

ok 10 test cases ok. (10 test cases)

Test #15:

score: 0
Accepted
time: 395ms
memory: 54676kb

input:

1
100000
OZeDY6m2v P 0 accepted
DolcP A 0 accepted
2Z9Yd M 0 rejected
Vjl F 0 accepted
SPetC8_ru4S3nXJkkD C 0 rejected
XhLC G 0 rejected
wZvhcns7t7EaOero E 0 accepted
HRqRKcO87 I 0 rejected
dwfT7D H 0 rejected
cxvYaN8zSMGpoa9Q9xv U 0 accepted
nvXlrCa1zbx8uokfd T 0 accepted
E_bbU5C9bgpD_wGo P 0 rejec...

output:

213
MGjFY C43v3R4b8LW3Q9 mfyehHY0Z oSiFwlfMwcS3jpkr2 rNd4dEHrSQG ILnoUL _awjT Ak1 fWb7IydN_gKzO2taC KFVkidNTwOdQjL Fs9IUxeK3shPCoujX9Q vjVt Lsm BFz7FBsJB J0eHK1KxAeqQkS AUy I8kswCMax57Ik yExemmGQBoLWHTR kj1hskCNFa 4Va0Qz3xegJa1YTzfwB QIG9FWFdyGBjW QudpmL DeT1w3AJ 6u XU8Ig emPv UdMRp8X 4dQZ7VRS3v8lyV...

result:

ok 1 test cases ok. (1 test case)

Test #16:

score: 0
Accepted
time: 8ms
memory: 5332kb

input:

1
100000
A A 0 accepted
B Z 299 accepted
B Z 299 accepted
B A 299 rejected
B A 299 rejected
B A 299 rejected
B A 299 rejected
B A 299 rejected
B A 299 rejected
B A 299 rejected
B A 299 rejected
B A 299 rejected
B A 299 rejected
B A 299 rejected
B A 299 rejected
B A 299 rejected
B A 299 rejected
B A ...

output:

1
B 

result:

ok 1 test cases ok. (1 test case)

Test #17:

score: 0
Accepted
time: 363ms
memory: 94608kb

input:

1
100000
qyGXWlwMuXY3212 A 20 accepted
l_IeEuuLy9 A 20 accepted
nlyFO0YOiDxyiNjBb A 20 accepted
8H A 20 accepted
ek A 20 accepted
Em63tewQVLljOUO4r A 20 accepted
AHdtZtwK8debApdvxMy8 A 20 accepted
l3aTB A 20 accepted
vyFuSSSLTV5yP A 20 accepted
uzPnnAXshwHCbl7 A 20 accepted
sL A 20 accepted
K099qoYV...

output:

99965
qyGXWlwMuXY3212 l_IeEuuLy9 nlyFO0YOiDxyiNjBb 8H ek Em63tewQVLljOUO4r AHdtZtwK8debApdvxMy8 l3aTB vyFuSSSLTV5yP uzPnnAXshwHCbl7 sL K099qoYVY2sT kck9cpgykQ7 2J1 ra2lVlNGy7f4RxRVM5 E33CcsmaRSM2V cxlks6lG8mJq 7mORI onTYGSrvdP51CMF Cc tUXXuc9 v0u27ogI6NDJt qCjpX_DEplHoejXdhrd nWeD_ Icwv_So VrSV_jfGx...

result:

ok 1 test cases ok. (1 test case)

Test #18:

score: 0
Accepted
time: 389ms
memory: 94868kb

input:

1
100000
xhmAFe A 20 accepted
loPCkhj2qt A 20 accepted
WIx A 20 accepted
T3zIPb A 20 accepted
xEEBg A 20 accepted
Gd0_zLXNJ1l1_Zrqa2 A 20 accepted
cM68n01suqhgjrBA A 20 accepted
LA6 A 20 accepted
AXBqy A 20 accepted
VLc4yxmdrN7S A 20 accepted
6p_z1vz2 A 20 accepted
wujWaUQNU0 A 20 accepted
eHIPyc0l3...

output:

99965
xhmAFe loPCkhj2qt WIx T3zIPb xEEBg Gd0_zLXNJ1l1_Zrqa2 cM68n01suqhgjrBA LA6 AXBqy VLc4yxmdrN7S 6p_z1vz2 wujWaUQNU0 eHIPyc0l3RHlajRl StgmAuYaQ 3 bc5_mjsU 48y2EwB1k0MDb uKwq9gQ2BX2jBrCO5dj MnbI Cbuup2jfG_e_S4Ass 9H1A9Mfu6K8lgut222o BCblgxpBBdAUvQkfgMQ S9mGs45VTW1ITX83dLy f3PRgkhpF464ONTioa ulbRGg...

result:

ok 1 test cases ok. (1 test case)

Extra Test:

score: 0
Extra Test Passed