Submission #13936266


Source Code Expand

N,*C = $<.map(&:to_i)
p N-C.inject([]){|a,c|
	i = a.size.downto(1).find{|i| a[i-1] < c }||0
	a[i] = c if ! a[i] || c < a[i]
	next a
}.size

Submission Info

Submission Time
Task D - トランプ挿入ソート
User ds14050
Language Ruby (2.3.3)
Score 100
Code Size 145 Byte
Status AC
Exec Time 227 ms
Memory 4348 KiB

Compile Error

./Main.rb:3: warning: shadowing outer local variable - i

Judge Result

Set Name smallA smallB all
Score / Max Score 10 / 10 40 / 40 50 / 50
Status
AC × 19
AC × 37
AC × 55
Set Name Test Cases
smallA test_01_ABC.txt, test_04_ABC.txt, test_07_ABC.txt, test_10_ABC.txt, test_13_ABC.txt, test_16_ABC.txt, test_19_ABC.txt, test_22_ABC.txt, test_25_ABC.txt, test_28_ABC.txt, test_31_ABC.txt, test_32_ABC.txt, test_35_ABC.txt, test_38_ABC.txt, test_41_ABC.txt, test_44_ABC.txt, test_47_ABC.txt, test_50_ABC.txt, test_53_ABC.txt
smallB test_01_ABC.txt, test_02_AB.txt, test_04_ABC.txt, test_05_AB.txt, test_07_ABC.txt, test_08_AB.txt, test_10_ABC.txt, test_11_AB.txt, test_13_ABC.txt, test_14_AB.txt, test_16_ABC.txt, test_17_AB.txt, test_19_ABC.txt, test_20_AB.txt, test_22_ABC.txt, test_23_AB.txt, test_25_ABC.txt, test_26_AB.txt, test_28_ABC.txt, test_29_AB.txt, test_31_ABC.txt, test_32_ABC.txt, test_33_AB.txt, test_35_ABC.txt, test_36_AB.txt, test_38_ABC.txt, test_39_AB.txt, test_41_ABC.txt, test_42_AB.txt, test_44_ABC.txt, test_45_AB.txt, test_47_ABC.txt, test_48_AB.txt, test_50_ABC.txt, test_51_AB.txt, test_53_ABC.txt, test_54_AB.txt
all test_01_ABC.txt, test_02_AB.txt, test_03_A.txt, test_04_ABC.txt, test_05_AB.txt, test_06_A.txt, test_07_ABC.txt, test_08_AB.txt, test_09_A.txt, test_10_ABC.txt, test_11_AB.txt, test_12_A.txt, test_13_ABC.txt, test_14_AB.txt, test_15_A.txt, test_16_ABC.txt, test_17_AB.txt, test_18_A.txt, test_19_ABC.txt, test_20_AB.txt, test_21_A.txt, test_22_ABC.txt, test_23_AB.txt, test_24_A.txt, test_25_ABC.txt, test_26_AB.txt, test_27_A.txt, test_28_ABC.txt, test_29_AB.txt, test_30_A.txt, test_31_ABC.txt, test_32_ABC.txt, test_33_AB.txt, test_34_A.txt, test_35_ABC.txt, test_36_AB.txt, test_37_A.txt, test_38_ABC.txt, test_39_AB.txt, test_40_A.txt, test_41_ABC.txt, test_42_AB.txt, test_43_A.txt, test_44_ABC.txt, test_45_AB.txt, test_46_A.txt, test_47_ABC.txt, test_48_AB.txt, test_49_A.txt, test_50_ABC.txt, test_51_AB.txt, test_52_A.txt, test_53_ABC.txt, test_54_AB.txt, test_55_A.txt
Case Name Status Exec Time Memory
sample_01.txt AC 7 ms 1788 KiB
sample_02.txt AC 7 ms 1788 KiB
sample_03.txt AC 7 ms 1788 KiB
test_01_ABC.txt AC 7 ms 1788 KiB
test_02_AB.txt AC 10 ms 1916 KiB
test_03_A.txt AC 227 ms 2300 KiB
test_04_ABC.txt AC 7 ms 1788 KiB
test_05_AB.txt AC 10 ms 1788 KiB
test_06_A.txt AC 17 ms 1916 KiB
test_07_ABC.txt AC 7 ms 1788 KiB
test_08_AB.txt AC 10 ms 1788 KiB
test_09_A.txt AC 220 ms 2300 KiB
test_10_ABC.txt AC 7 ms 1788 KiB
test_11_AB.txt AC 8 ms 1788 KiB
test_12_A.txt AC 103 ms 2172 KiB
test_13_ABC.txt AC 7 ms 1788 KiB
test_14_AB.txt AC 10 ms 1916 KiB
test_15_A.txt AC 224 ms 2300 KiB
test_16_ABC.txt AC 7 ms 1788 KiB
test_17_AB.txt AC 9 ms 1788 KiB
test_18_A.txt AC 13 ms 1916 KiB
test_19_ABC.txt AC 7 ms 1788 KiB
test_20_AB.txt AC 10 ms 1916 KiB
test_21_A.txt AC 221 ms 2300 KiB
test_22_ABC.txt AC 7 ms 1788 KiB
test_23_AB.txt AC 9 ms 1788 KiB
test_24_A.txt AC 168 ms 2172 KiB
test_25_ABC.txt AC 7 ms 1788 KiB
test_26_AB.txt AC 10 ms 1788 KiB
test_27_A.txt AC 224 ms 2300 KiB
test_28_ABC.txt AC 7 ms 1788 KiB
test_29_AB.txt AC 10 ms 1788 KiB
test_30_A.txt AC 175 ms 4348 KiB
test_31_ABC.txt AC 7 ms 1788 KiB
test_32_ABC.txt AC 7 ms 1788 KiB
test_33_AB.txt AC 9 ms 1916 KiB
test_34_A.txt AC 44 ms 2684 KiB
test_35_ABC.txt AC 7 ms 1788 KiB
test_36_AB.txt AC 9 ms 1788 KiB
test_37_A.txt AC 14 ms 1916 KiB
test_38_ABC.txt AC 7 ms 1788 KiB
test_39_AB.txt AC 9 ms 1916 KiB
test_40_A.txt AC 43 ms 2300 KiB
test_41_ABC.txt AC 7 ms 1788 KiB
test_42_AB.txt AC 8 ms 1788 KiB
test_43_A.txt AC 12 ms 1916 KiB
test_44_ABC.txt AC 7 ms 1788 KiB
test_45_AB.txt AC 9 ms 1916 KiB
test_46_A.txt AC 47 ms 2428 KiB
test_47_ABC.txt AC 7 ms 1788 KiB
test_48_AB.txt AC 7 ms 1788 KiB
test_49_A.txt AC 13 ms 1916 KiB
test_50_ABC.txt AC 7 ms 1788 KiB
test_51_AB.txt AC 9 ms 1788 KiB
test_52_A.txt AC 48 ms 2300 KiB
test_53_ABC.txt AC 7 ms 1788 KiB
test_54_AB.txt AC 7 ms 1788 KiB
test_55_A.txt AC 48 ms 2300 KiB