結果

問題 No.389 ロジックパズルの組み合わせ
ユーザー miraxialmiraxial
提出日時 2016-07-08 23:49:15
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 231 bytes
コンパイル時間 377 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 40,320 KB
最終ジャッジ日時 2024-04-21 08:41:48
合計ジャッジ時間 15,101 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
12,032 KB
testcase_01 AC 93 ms
12,288 KB
testcase_02 AC 92 ms
12,288 KB
testcase_03 WA -
testcase_04 AC 97 ms
12,288 KB
testcase_05 AC 97 ms
12,160 KB
testcase_06 AC 97 ms
12,160 KB
testcase_07 AC 98 ms
12,288 KB
testcase_08 AC 93 ms
12,288 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 AC 104 ms
12,288 KB
testcase_20 AC 96 ms
12,288 KB
testcase_21 AC 96 ms
12,288 KB
testcase_22 AC 99 ms
12,288 KB
testcase_23 AC 96 ms
12,288 KB
testcase_24 AC 95 ms
12,288 KB
testcase_25 AC 95 ms
12,032 KB
testcase_26 AC 98 ms
12,288 KB
testcase_27 AC 101 ms
12,160 KB
testcase_28 AC 98 ms
12,160 KB
testcase_29 AC 95 ms
12,160 KB
testcase_30 AC 96 ms
12,288 KB
testcase_31 AC 98 ms
12,160 KB
testcase_32 AC 98 ms
12,160 KB
testcase_33 AC 97 ms
12,416 KB
testcase_34 AC 100 ms
12,160 KB
testcase_35 AC 96 ms
12,032 KB
testcase_36 AC 94 ms
12,160 KB
testcase_37 AC 94 ms
12,160 KB
testcase_38 AC 98 ms
12,160 KB
testcase_39 AC 97 ms
12,032 KB
testcase_40 AC 98 ms
12,288 KB
testcase_41 AC 96 ms
12,160 KB
testcase_42 AC 95 ms
12,288 KB
testcase_43 AC 97 ms
12,160 KB
testcase_44 AC 96 ms
12,288 KB
testcase_45 AC 95 ms
12,288 KB
testcase_46 AC 94 ms
12,288 KB
testcase_47 AC 104 ms
12,032 KB
testcase_48 AC 98 ms
12,288 KB
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 WA -
testcase_59 WA -
testcase_60 WA -
testcase_61 WA -
testcase_62 WA -
testcase_63 WA -
testcase_64 WA -
testcase_65 WA -
testcase_66 WA -
testcase_67 WA -
testcase_68 WA -
testcase_69 AC 91 ms
12,032 KB
testcase_70 AC 94 ms
12,288 KB
testcase_71 AC 92 ms
12,160 KB
testcase_72 AC 91 ms
12,160 KB
testcase_73 AC 91 ms
12,032 KB
testcase_74 AC 92 ms
12,288 KB
testcase_75 AC 90 ms
12,032 KB
testcase_76 AC 93 ms
12,160 KB
testcase_77 AC 91 ms
12,288 KB
testcase_78 AC 92 ms
12,288 KB
testcase_79 AC 87 ms
12,160 KB
testcase_80 AC 88 ms
12,288 KB
testcase_81 AC 96 ms
12,416 KB
testcase_82 AC 94 ms
12,032 KB
testcase_83 AC 87 ms
12,160 KB
testcase_84 AC 91 ms
12,288 KB
testcase_85 AC 86 ms
12,288 KB
testcase_86 AC 89 ms
12,160 KB
testcase_87 AC 89 ms
12,160 KB
testcase_88 AC 89 ms
12,160 KB
testcase_89 RE -
testcase_90 RE -
testcase_91 RE -
testcase_92 RE -
testcase_93 RE -
testcase_94 AC 111 ms
23,552 KB
testcase_95 RE -
testcase_96 RE -
testcase_97 RE -
testcase_98 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

m=gets.to_i
a=gets.split.map &:to_i
def d a,b
  if b==1
    a
  else
    a*d(a-1,b-1)
  end
end
if a==[0]
  p 1
else
t=m-a.inject(:+)-a.length+1
if t<0
  p :NA
else
  p d(a.length+t,a.length)/d(a.length,a.length)%1000000007
end
end
0