Submission #19661633
Source Code Expand
Copy
import sys def main(): input = sys.stdin.readline R, G, B = map(int, input().split()) RGB = R + G + B GB = G + B ofs = 1000 INF = 10**18 dp = [[INF] * (ofs + 1000) for _ in range(RGB + 1)] dp[RGB][0] = 0 for i in range(1, ofs + 1000): for r in range(RGB + 1): dp[r][i] = dp[r][i - 1] if r == RGB: continue t = INF if r >= GB: t = abs(ofs - 100 - i) elif r >= B: t = abs(ofs - i) else: t = abs(ofs + 100 - i) dp[r][i] = min(dp[r][i], dp[r + 1][i - 1] + t) print(dp[0][-1]) if __name__ == '__main__': main()
Submission Info
Submission Time | |
---|---|
Task | D - マーブル |
User | w0mbat |
Language | PyPy3 (7.3.0) |
Score | 0 |
Code Size | 666 Byte |
Status | MLE |
Exec Time | 145 ms |
Memory | 82304 KB |
Judge Result
Set Name | sub1 | sub2 | All | ||||||
---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 10 | 0 / 30 | 0 / 60 | ||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
sub1 | sample_01_ABC.txt, test_ABC_01.txt, test_ABC_02.txt, test_ABC_03.txt, test_ABC_04.txt, test_ABC_05.txt, test_ABC_06.txt, test_ABC_07.txt, test_ABC_08.txt, test_ABC_09.txt, test_ABC_10.txt, test_ABC_11.txt, test_ABC_12.txt, test_ABC_13.txt, test_ABC_14.txt, test_ABC_15.txt, test_ABC_16.txt, test_ABC_17.txt, test_ABC_18.txt, test_ABC_19.txt, test_ABC_20.txt, test_ABC_21.txt, test_ABC_22.txt, test_ABC_23.txt, test_ABC_24.txt, test_ABC_25.txt, test_ABC_26.txt, test_ABC_27.txt, test_ABC_28.txt |
sub2 | sample_01_ABC.txt, sample_02_BC.txt, test_ABC_01.txt, test_ABC_02.txt, test_ABC_03.txt, test_ABC_04.txt, test_ABC_05.txt, test_ABC_06.txt, test_ABC_07.txt, test_ABC_08.txt, test_ABC_09.txt, test_ABC_10.txt, test_ABC_11.txt, test_ABC_12.txt, test_ABC_13.txt, test_ABC_14.txt, test_ABC_15.txt, test_ABC_16.txt, test_ABC_17.txt, test_ABC_18.txt, test_ABC_19.txt, test_ABC_20.txt, test_ABC_21.txt, test_ABC_22.txt, test_ABC_23.txt, test_ABC_24.txt, test_ABC_25.txt, test_ABC_26.txt, test_ABC_27.txt, test_ABC_28.txt, test_BC_29.txt, test_BC_30.txt, test_BC_31.txt, test_BC_32.txt, test_BC_33.txt, test_BC_34.txt, test_BC_35.txt, test_BC_36.txt, test_BC_37.txt, test_BC_38.txt, test_BC_39.txt, test_BC_40.txt, test_BC_41.txt, test_BC_42.txt, test_BC_43.txt, test_BC_44.txt, test_BC_45.txt, test_BC_46.txt, test_BC_47.txt, test_BC_48.txt, test_BC_49.txt, test_BC_50.txt, test_BC_51.txt, test_BC_52.txt, test_BC_53.txt, test_BC_54.txt, test_BC_55.txt |
All | sample_01_ABC.txt, sample_02_BC.txt, sample_03_C.txt, test_ABC_01.txt, test_ABC_02.txt, test_ABC_03.txt, test_ABC_04.txt, test_ABC_05.txt, test_ABC_06.txt, test_ABC_07.txt, test_ABC_08.txt, test_ABC_09.txt, test_ABC_10.txt, test_ABC_11.txt, test_ABC_12.txt, test_ABC_13.txt, test_ABC_14.txt, test_ABC_15.txt, test_ABC_16.txt, test_ABC_17.txt, test_ABC_18.txt, test_ABC_19.txt, test_ABC_20.txt, test_ABC_21.txt, test_ABC_22.txt, test_ABC_23.txt, test_ABC_24.txt, test_ABC_25.txt, test_ABC_26.txt, test_ABC_27.txt, test_ABC_28.txt, test_BC_29.txt, test_BC_30.txt, test_BC_31.txt, test_BC_32.txt, test_BC_33.txt, test_BC_34.txt, test_BC_35.txt, test_BC_36.txt, test_BC_37.txt, test_BC_38.txt, test_BC_39.txt, test_BC_40.txt, test_BC_41.txt, test_BC_42.txt, test_BC_43.txt, test_BC_44.txt, test_BC_45.txt, test_BC_46.txt, test_BC_47.txt, test_BC_48.txt, test_BC_49.txt, test_BC_50.txt, test_BC_51.txt, test_BC_52.txt, test_BC_53.txt, test_BC_54.txt, test_BC_55.txt, test_C_56.txt, test_C_57.txt, test_C_58.txt, test_C_59.txt, test_C_60.txt, test_C_61.txt, test_C_62.txt, test_C_63.txt, test_C_64.txt, test_C_65.txt, test_C_66.txt, test_C_67.txt, test_C_68.txt, test_C_69.txt, test_C_70.txt, test_C_71.txt, test_C_72.txt, test_C_73.txt, test_C_74.txt, test_C_75.txt, test_C_76.txt, test_C_77.txt, test_C_78.txt, test_C_79.txt, test_C_80.txt, test_C_81.txt, test_C_82.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01_ABC.txt | MLE | 89 ms | 68628 KB |
sample_02_BC.txt | MLE | 84 ms | 69164 KB |
sample_03_C.txt | MLE | 135 ms | 80356 KB |
test_ABC_01.txt | MLE | 76 ms | 68480 KB |
test_ABC_02.txt | MLE | 72 ms | 68384 KB |
test_ABC_03.txt | MLE | 73 ms | 68256 KB |
test_ABC_04.txt | MLE | 73 ms | 68244 KB |
test_ABC_05.txt | MLE | 73 ms | 68344 KB |
test_ABC_06.txt | MLE | 74 ms | 68660 KB |
test_ABC_07.txt | MLE | 73 ms | 68124 KB |
test_ABC_08.txt | MLE | 75 ms | 68352 KB |
test_ABC_09.txt | MLE | 76 ms | 68272 KB |
test_ABC_10.txt | MLE | 76 ms | 68312 KB |
test_ABC_11.txt | MLE | 77 ms | 68348 KB |
test_ABC_12.txt | MLE | 75 ms | 68104 KB |
test_ABC_13.txt | MLE | 74 ms | 68280 KB |
test_ABC_14.txt | MLE | 73 ms | 68520 KB |
test_ABC_15.txt | MLE | 75 ms | 68516 KB |
test_ABC_16.txt | MLE | 72 ms | 68528 KB |
test_ABC_17.txt | MLE | 77 ms | 68512 KB |
test_ABC_18.txt | MLE | 78 ms | 68172 KB |
test_ABC_19.txt | MLE | 77 ms | 68336 KB |
test_ABC_20.txt | MLE | 73 ms | 68596 KB |
test_ABC_21.txt | MLE | 68 ms | 68068 KB |
test_ABC_22.txt | MLE | 68 ms | 68156 KB |
test_ABC_23.txt | MLE | 70 ms | 68000 KB |
test_ABC_24.txt | MLE | 75 ms | 68492 KB |
test_ABC_25.txt | MLE | 74 ms | 68344 KB |
test_ABC_26.txt | MLE | 76 ms | 68444 KB |
test_ABC_27.txt | MLE | 72 ms | 68264 KB |
test_ABC_28.txt | MLE | 73 ms | 68216 KB |
test_BC_29.txt | MLE | 77 ms | 68616 KB |
test_BC_30.txt | MLE | 82 ms | 68892 KB |
test_BC_31.txt | MLE | 81 ms | 69048 KB |
test_BC_32.txt | MLE | 85 ms | 69692 KB |
test_BC_33.txt | MLE | 85 ms | 70028 KB |
test_BC_34.txt | MLE | 88 ms | 69896 KB |
test_BC_35.txt | MLE | 78 ms | 69360 KB |
test_BC_36.txt | MLE | 82 ms | 69760 KB |
test_BC_37.txt | MLE | 81 ms | 69460 KB |
test_BC_38.txt | MLE | 84 ms | 69396 KB |
test_BC_39.txt | MLE | 80 ms | 69020 KB |
test_BC_40.txt | MLE | 86 ms | 69564 KB |
test_BC_41.txt | MLE | 88 ms | 69880 KB |
test_BC_42.txt | MLE | 90 ms | 70256 KB |
test_BC_43.txt | MLE | 83 ms | 69140 KB |
test_BC_44.txt | MLE | 76 ms | 69028 KB |
test_BC_45.txt | MLE | 79 ms | 69160 KB |
test_BC_46.txt | MLE | 85 ms | 69708 KB |
test_BC_47.txt | MLE | 84 ms | 69496 KB |
test_BC_48.txt | MLE | 87 ms | 70116 KB |
test_BC_49.txt | MLE | 85 ms | 69712 KB |
test_BC_50.txt | MLE | 86 ms | 69984 KB |
test_BC_51.txt | MLE | 85 ms | 69692 KB |
test_BC_52.txt | MLE | 78 ms | 68684 KB |
test_BC_53.txt | MLE | 75 ms | 68940 KB |
test_BC_54.txt | MLE | 78 ms | 68792 KB |
test_BC_55.txt | MLE | 93 ms | 70840 KB |
test_C_56.txt | MLE | 101 ms | 72896 KB |
test_C_57.txt | MLE | 121 ms | 75940 KB |
test_C_58.txt | MLE | 123 ms | 77468 KB |
test_C_59.txt | MLE | 116 ms | 75704 KB |
test_C_60.txt | MLE | 99 ms | 72400 KB |
test_C_61.txt | MLE | 114 ms | 74768 KB |
test_C_62.txt | MLE | 111 ms | 74184 KB |
test_C_63.txt | MLE | 116 ms | 74964 KB |
test_C_64.txt | MLE | 110 ms | 73752 KB |
test_C_65.txt | MLE | 119 ms | 75620 KB |
test_C_66.txt | MLE | 112 ms | 74900 KB |
test_C_67.txt | MLE | 117 ms | 76236 KB |
test_C_68.txt | MLE | 104 ms | 72668 KB |
test_C_69.txt | MLE | 105 ms | 73240 KB |
test_C_70.txt | MLE | 110 ms | 74180 KB |
test_C_71.txt | MLE | 120 ms | 76548 KB |
test_C_72.txt | MLE | 133 ms | 79492 KB |
test_C_73.txt | MLE | 125 ms | 76852 KB |
test_C_74.txt | MLE | 121 ms | 77180 KB |
test_C_75.txt | MLE | 119 ms | 75668 KB |
test_C_76.txt | MLE | 119 ms | 77560 KB |
test_C_77.txt | MLE | 120 ms | 77944 KB |
test_C_78.txt | MLE | 119 ms | 77556 KB |
test_C_79.txt | MLE | 97 ms | 73400 KB |
test_C_80.txt | MLE | 96 ms | 72948 KB |
test_C_81.txt | MLE | 93 ms | 73028 KB |
test_C_82.txt | MLE | 145 ms | 82304 KB |