結果

問題 No.1747 Many Formulae 2
ユーザー Eki1009Eki1009
提出日時 2021-11-19 21:25:15
言語 Ruby
(3.2.2)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 123 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 11,332 KB
実行使用メモリ 15,528 KB
最終ジャッジ日時 2023-08-30 07:17:13
合計ジャッジ時間 3,692 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
15,220 KB
testcase_01 AC 92 ms
15,184 KB
testcase_02 AC 99 ms
15,404 KB
testcase_03 AC 91 ms
15,180 KB
testcase_04 AC 93 ms
15,528 KB
testcase_05 AC 94 ms
15,224 KB
testcase_06 AC 92 ms
15,204 KB
testcase_07 AC 97 ms
15,384 KB
testcase_08 AC 91 ms
15,204 KB
testcase_09 AC 92 ms
15,388 KB
testcase_10 AC 93 ms
15,340 KB
testcase_11 AC 92 ms
15,328 KB
testcase_12 AC 90 ms
15,304 KB
testcase_13 AC 91 ms
15,492 KB
testcase_14 AC 91 ms
15,396 KB
testcase_15 AC 99 ms
15,448 KB
testcase_16 AC 96 ms
15,384 KB
testcase_17 AC 92 ms
15,360 KB
testcase_18 AC 93 ms
15,084 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:4: warning: assigned but unused variable - t
Syntax OK

ソースコード

diff #

require'prime'
s=gets.chop.chars
n=s.size-1
p (0...1<<n).count{|i|t=eval((0..n).map{|j|s[j]+(i>>j&1>0??+:'')}.join).prime?}
0