結果

問題 No.1747 Many Formulae 2
ユーザー maimai
提出日時 2021-11-19 22:38:37
言語 Ruby
(3.3.0)
結果
AC  
実行時間 105 ms / 2,000 ms
コード長 144 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 11,440 KB
実行使用メモリ 15,672 KB
最終ジャッジ日時 2023-08-30 09:26:56
合計ジャッジ時間 3,895 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
15,192 KB
testcase_01 AC 95 ms
15,148 KB
testcase_02 AC 102 ms
15,672 KB
testcase_03 AC 101 ms
15,328 KB
testcase_04 AC 98 ms
15,428 KB
testcase_05 AC 98 ms
15,184 KB
testcase_06 AC 97 ms
15,412 KB
testcase_07 AC 101 ms
15,288 KB
testcase_08 AC 94 ms
15,360 KB
testcase_09 AC 100 ms
15,348 KB
testcase_10 AC 101 ms
15,232 KB
testcase_11 AC 101 ms
15,440 KB
testcase_12 AC 103 ms
15,104 KB
testcase_13 AC 98 ms
15,084 KB
testcase_14 AC 95 ms
15,092 KB
testcase_15 AC 105 ms
15,424 KB
testcase_16 AC 105 ms
15,416 KB
testcase_17 AC 99 ms
15,156 KB
testcase_18 AC 95 ms
15,172 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'prime'
s=gets.chomp
p ['','+'].repeated_permutation(s.size-1).count{|ss|eval(s.chars.zip(ss).reduce(''){|a,t|a+t[0]+t[1].to_s}).prime?}
0