Submission #48378466
Source Code Expand
Copy
#ABC_20231210_CN,M=map(int,input().split())S=input()m=Mxm=0l=0xl=0for i in range(N):if(S[i]=="0"):m+=xmxm=0l+=xlxl=0elif(S[i]=="1"):if(m>0):m-=1xm+=1elif(l>0):l-=1xl+=1else:
#ABC_20231210_C N,M=map(int,input().split()) S=input() m=M xm=0 l=0 xl=0 for i in range(N): if(S[i]=="0"): m+=xm xm=0 l+=xl xl=0 elif(S[i]=="1"): if(m>0): m-=1 xm+=1 elif(l>0): l-=1 xl+=1 else: xl+=1 elif(S[i]=="2"): if(l>0): l-=1 xl+=1 else: xl+=1 l+=xl print(l)
Submission Info
Submission Time | |
---|---|
Task | C - T-shirts |
User | Konini |
Language | Python (PyPy 3.10-v7.3.12) |
Score | 300 |
Code Size | 474 Byte |
Status | AC |
Exec Time | 60 ms |
Memory | 76852 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example_00.txt, example_01.txt, example_02.txt |
All | example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt, random_25.txt, random_26.txt, random_27.txt, random_28.txt, random_29.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
example_00.txt | AC | 59 ms | 76576 KB |
example_01.txt | AC | 58 ms | 76440 KB |
example_02.txt | AC | 59 ms | 76460 KB |
hand_00.txt | AC | 59 ms | 76324 KB |
hand_01.txt | AC | 59 ms | 76448 KB |
hand_02.txt | AC | 59 ms | 76528 KB |
hand_03.txt | AC | 59 ms | 76408 KB |
hand_04.txt | AC | 59 ms | 76248 KB |
hand_05.txt | AC | 60 ms | 76464 KB |
hand_06.txt | AC | 60 ms | 76268 KB |
hand_07.txt | AC | 58 ms | 76588 KB |
hand_08.txt | AC | 59 ms | 76408 KB |
hand_09.txt | AC | 59 ms | 76496 KB |
random_00.txt | AC | 58 ms | 76520 KB |
random_01.txt | AC | 58 ms | 76228 KB |
random_02.txt | AC | 59 ms | 76612 KB |
random_03.txt | AC | 59 ms | 76540 KB |
random_04.txt | AC | 59 ms | 76492 KB |
random_05.txt | AC | 59 ms | 76452 KB |
random_06.txt | AC | 59 ms | 76324 KB |
random_07.txt | AC | 59 ms | 76396 KB |
random_08.txt | AC | 59 ms | 76472 KB |
random_09.txt | AC | 59 ms | 76756 KB |
random_10.txt | AC | 58 ms | 76788 KB |
random_11.txt | AC | 58 ms | 76448 KB |
random_12.txt | AC | 58 ms | 76488 KB |
random_13.txt | AC | 59 ms | 76596 KB |
random_14.txt | AC | 58 ms | 76464 KB |
random_15.txt | AC | 58 ms | 76320 KB |
random_16.txt | AC | 59 ms | 76852 KB |
random_17.txt | AC | 60 ms | 76444 KB |
random_18.txt | AC | 60 ms | 76664 KB |
random_19.txt | AC | 59 ms | 76512 KB |
random_20.txt | AC | 58 ms | 76408 KB |
random_21.txt | AC | 59 ms | 76548 KB |
random_22.txt | AC | 59 ms | 76700 KB |
random_23.txt | AC | 59 ms | 76644 KB |
random_24.txt | AC | 58 ms | 76452 KB |
random_25.txt | AC | 58 ms | 76584 KB |
random_26.txt | AC | 59 ms | 76660 KB |
random_27.txt | AC | 58 ms | 76596 KB |
random_28.txt | AC | 58 ms | 76620 KB |
random_29.txt | AC | 59 ms | 76756 KB |