QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#661596 | #8230. Submissions | Lavender_Field# | WA | 101ms | 73820kb | C++20 | 7.7kb | 2024-10-20 17:01:00 | 2024-10-20 17:01:00 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
struct ques{
int AC_times,submit_times,last_submit;
int first_AC=-1,second_AC=-1,first_submit=-1;
};
struct node{
string name;
int solved,time;
int least_unsolved,del_time_most;
int max_unsolved;
int once_least_solved,most_time_added;
ques pro[27];
}a[N];
bool less_cmp(node i, node j){
if(i.solved != j.solved) return i.solved>j.solved;
return i.time<j.time;
}
bool less_equal_cmp(node i, node j){
if(i.solved != j.solved) return i.solved>j.solved;
return i.time<=j.time;
}
int T,m,cnt,n;
bool has_zero;
map<string,int> ma;
string tmp;
vector<string> ans;
int max_zero_penalty;
void solve(){
scanf("%d",&m);max_zero_penalty=0;
for(int i=1;i<=cnt;i++){
a[i].solved=a[i].time=a[i].least_unsolved=a[i].max_unsolved=0;
a[i].del_time_most=a[i].once_least_solved=a[i].most_time_added=0;
for(int j=1;j<=26;j++){
a[i].pro[j].AC_times=0;
a[i].pro[j].submit_times=0;
a[i].pro[j].first_AC=-1;
a[i].pro[j].second_AC=-1;
a[i].pro[j].first_submit=-1;
a[i].pro[j].last_submit=-1;
}
}
cnt=n=0;
has_zero=0;ans.clear();
ma.clear();
// printf("Start\n");
for(int i=1,t;i<=m;i++){
cin>>tmp;
int teamid;
if(ma.count(tmp)==0){
ma[tmp]=++cnt;
a[cnt].name=tmp;
}
teamid=ma[tmp];
char ch[10];scanf("%s",ch);
int pro_id=ch[0]-'A'+1;
scanf("%d",&t);
scanf("%s",ch);
if(ch[0]=='a'){
a[teamid].pro[pro_id].AC_times++;
a[teamid].pro[pro_id].submit_times++;
if(a[teamid].pro[pro_id].AC_times==1){
a[teamid].pro[pro_id].first_AC=t+20*(a[teamid].pro[pro_id].submit_times-1);
}
else if(a[teamid].pro[pro_id].AC_times==2){
a[teamid].pro[pro_id].second_AC=t+20*(a[teamid].pro[pro_id].submit_times-1);
}
if(a[teamid].pro[pro_id].submit_times==1){
a[teamid].pro[pro_id].first_submit=t+20*(a[teamid].pro[pro_id].submit_times-1);
}
a[teamid].pro[pro_id].last_submit=t+20*(a[teamid].pro[pro_id].submit_times-1);
}
else{
a[teamid].pro[pro_id].submit_times++;
if(a[teamid].pro[pro_id].submit_times==1){
a[teamid].pro[pro_id].first_submit=t+20*(a[teamid].pro[pro_id].submit_times-1);
}
a[teamid].pro[pro_id].last_submit=t+20*(a[teamid].pro[pro_id].submit_times-1);
}
}
// printf("B\n");
for(int j=1;j<=cnt;j++){
// printf("team %d %d\n",j,cnt);
int teamid=j;
a[teamid].least_unsolved=1e9;
a[teamid].del_time_most=0;
a[teamid].once_least_solved=1e9;
a[teamid].most_time_added=0;
a[teamid].max_unsolved=0;
for(int i=1;i<=26;i++){
if(a[teamid].pro[i].submit_times==0) continue;
if(a[teamid].pro[i].AC_times>=1){
a[teamid].solved++;
a[teamid].time+=a[teamid].pro[i].first_AC;
a[teamid].del_time_most=max(a[teamid].del_time_most,a[teamid].pro[i].first_AC-a[teamid].pro[i].first_submit);
if(a[teamid].pro[i].AC_times==1){
a[teamid].once_least_solved=min(a[teamid].once_least_solved,a[teamid].pro[i].first_AC);
}
else{
a[teamid].most_time_added=max(a[teamid].most_time_added,a[teamid].pro[i].second_AC-a[teamid].pro[i].first_AC);
}
}
else{
if(a[teamid].pro[i].submit_times>=1){
a[teamid].least_unsolved=min(a[teamid].least_unsolved,a[teamid].pro[i].first_submit);
a[teamid].max_unsolved=max(a[teamid].max_unsolved,a[teamid].pro[i].last_submit);
}
}
}
if(a[teamid].solved>=1) n++;
else has_zero=1;
if(a[teamid].solved==0){
// cout<<"zero"<<a[teamid].name<<endl;
max_zero_penalty=max(max_zero_penalty,a[teamid].max_unsolved);
}
}
// printf("C\n");
int gold=min((n-1)/10+1,35);
if(n==0) gold=0;
// printf("D gold %d %d\n",gold,n);
sort(a+1,a+1+cnt,less_cmp);
// printf("E gold %d %d\n",gold,n);
for(int i=1;i<=cnt;i++){
// int least_unsolved,del_time_most;
// int once_least_solved,most_time_added;
if(less_equal_cmp(a[i],a[gold])){
ans.push_back(a[i].name);
}
else if(less_equal_cmp(a[i],a[gold+1])){
// cout<<"?"<<a[i].name<<endl;
node t1=a[i];
if(a[i].least_unsolved!=1e9){
t1.solved++;
t1.time+=a[i].least_unsolved;
}
else{
t1.time-=a[i].del_time_most;
}
if(a[i].solved ==0 && t1.solved == 1 && n%10==0 && n<=340) gold++;
if(less_equal_cmp(t1,a[gold])){
ans.push_back(a[i].name);
if(a[i].solved ==0 && t1.solved == 1 && n%10==0 && n<=340) gold--;
continue;
}
if(a[i].solved ==0 && t1.solved == 1 && n%10==0 && n<=340) gold--;
// printf("why %d %d\n",has_zero,n);
if(has_zero && n%10==0){
if(a[i].solved==0 || a[i].solved>=2){
ans.push_back(a[i].name);continue;
}
else{
// printf("zero %d\n",max_zero_penalty);
if(max_zero_penalty>=a[i].time){
ans.push_back(a[i].name);continue;
}
}
}
// printf()
for(int j=1;j<=gold;j++){
node t2=a[j];
if(a[j].once_least_solved!=1e9){
t2.solved--;
t2.time-=a[j].once_least_solved;
}
else{
t2.time+=a[j].most_time_added;
}
if(t2.solved==0 && n%10==1 && n<=341) continue;
if(less_equal_cmp(a[i],t2)){
ans.push_back(a[i].name);
break;
}
}
}
else{
node t1=a[i];
// cout<<"!"<<a[i].name<<endl;
if(a[i].least_unsolved!=1e9){
t1.solved++;
t1.time+=a[i].least_unsolved;
}
else{
// printf("? %d\n",a[i].del_time_most);
t1.time-=a[i].del_time_most;
}
if(a[i].solved ==0 && t1.solved == 1 && n%10==0 && n<=340) gold++;
// printf("compare gold %d\n",gold);
if(less_equal_cmp(t1,a[gold])){
ans.push_back(a[i].name);
if(a[i].solved ==0 && t1.solved == 1 && n%10==0 && n<=340) gold--;
continue;
}
if(a[i].solved ==0 && t1.solved == 1 && n%10==0 && n<=340) gold--;
}
}
printf("%d\n",ans.size());
for(auto x:ans){
cout<<x<<" ";
}
printf("\n");
}
int main(){
// freopen("test.txt","r",stdin);
scanf("%d",&T);
while(T--) solve();
return 0;
}
/*
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 accepted
H H 2 accepted
I I 2 accepted
J J 2 accepted
*/
詳細信息
Test #1:
score: 100
Accepted
time: 4ms
memory: 73328kb
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 TS1 TSxingxing10 4 AllWayTheNorth XuejunXinyoudui1 LetItRot ImYourFan
result:
ok 2 test cases ok. (2 test cases)
Test #2:
score: 0
Accepted
time: 12ms
memory: 73360kb
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: 8ms
memory: 73544kb
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 B C D E F G H I J K 1 A
result:
ok 2 test cases ok. (2 test cases)
Test #4:
score: 0
Accepted
time: 0ms
memory: 73552kb
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: 101ms
memory: 73300kb
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: 63ms
memory: 73416kb
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 Qua1Pti3vKhyQKDUm fYuK1KNkuyO5HRCq xiLm0TUOF3T tsd 2 t3 JP 2 fhYPGC8W82NwJTQL 77sgqpbTIr_Zt1 2 pVWDEz 3BQ 2 tg buCeoOotAkV8DaFD6 1 UkXQ3iaNJ 2 vwfw ALTqPt7JUSLrl 1 QTEzV6tp 3 9cy_y_RNRwex8j7224hz wJlbqIU 4e1l0pO8eFjZwkDo 2 eiuF7a_ 6mbCu5zA 1 xy6QBr8ECi 3 ldaKLZb1oS1sS PezeyUurYoz7N1iGU ...
result:
ok 10000 test cases ok. (10000 test cases)
Test #7:
score: 0
Accepted
time: 78ms
memory: 73412kb
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 h68cyLwQ7drM__pSJub NX6GLK3Nz 3 U7S8zgJhR6 sdf0IGct21OeEFJ yOgwg 1 acesvM9yT 1 2hQb 2 P5 3twK2MJI_ 1 eGCz 3 tLHWIEVr5i7vlKpvlP UXRu8i 39GgHUPovILESCd0 1 20gsbZ25SsYp8 1 ...
result:
ok 10000 test cases ok. (10000 test cases)
Test #8:
score: 0
Accepted
time: 82ms
memory: 73348kb
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 A1R2kF V9UJ5hEaWiwMq3lxwKw9 4 xgdxQ7t 5sFcoMh 2 fLUS3NYE 2 2ra47EFC7LWzxTF2tSH S25TIbMLU5FMV6ys4 2 tczurXngUW uwm 3 gWG1aLfP1Gk DNAv Zh4tWi1QdYjTblw5 1 qN_OnmRhGksD 1 pAJC7fTKPJjaxPP 2 Jr9Sqekor mElj5iV4wfu 1 _Z13N_OO 1 rn 1 HhjFL6Rg 1 2q 5 eO6B_fLKDAZoY vdFavgJoOBT4vr...
result:
ok 10000 test cases ok. (10000 test cases)
Test #9:
score: 0
Accepted
time: 75ms
memory: 73408kb
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 1E0aicZDqPhh Z0cxqdpQ69NGV5wDoht 1 LR6PY6OjDoSaZpT 3 b YX 7f 4 WqSH sgpEsfgf_Fd o7VPp buFAkOkQ_F 1 coTjuCSsnonAgjYkChE 2 clGo2Z4AMe9Qp GC0Lw1Di 2 IrJ_n_Ym FCCHBTUTGJTbTjEb 1 fkBpEQxhBl21ARSTVR 1 fQzlJS9JEIS97gIIG7p4 6 CVVvEx otcG2t pqyDmprb2RmUBafc76eR ljfPMl71hE togGKu7uZ...
result:
ok 10000 test cases ok. (10000 test cases)
Test #10:
score: 0
Accepted
time: 63ms
memory: 73416kb
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 CZNz6k1QgLrHojbY upCvWQnHRgRSQQ pz 3 t ungF4dKzJt290JMWNgeH q 3 4FjAuM44Nzaz6Tc0 6mCVqSBpHVkrNZ SuBp7xLMGCHgk 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: -100
Wrong Answer
time: 13ms
memory: 73820kb
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 0 1 2 3 4 5 6 7 8 9 10 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 0 1 2 3 4 5 6 7 8 9 100 12 0 1 2 3 4 5 6 7 8 9 10 100 36 27 19 20 21 22 23 24 25 26 1 28 29 30 31 32 33 34 0 17 18 2 3 4 5 6 7 8 10 11 12 13 14 15 16 9 35 36 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21...
result:
wrong answer the numbers are different in the case 7. (test case 7)