結果

問題 No.4 おもりと天秤
ユーザー gigurururugigurururu
提出日時 2014-11-04 16:04:26
言語 Ruby
(3.2.2)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 140 bytes
コンパイル時間 132 ms
コンパイル使用メモリ 11,516 KB
実行使用メモリ 20,000 KB
最終ジャッジ日時 2023-09-08 16:02:33
合計ジャッジ時間 3,274 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,208 KB
testcase_01 AC 82 ms
15,016 KB
testcase_02 AC 80 ms
15,136 KB
testcase_03 AC 79 ms
15,304 KB
testcase_04 AC 81 ms
15,104 KB
testcase_05 AC 120 ms
19,336 KB
testcase_06 AC 80 ms
15,316 KB
testcase_07 AC 122 ms
19,764 KB
testcase_08 AC 80 ms
15,208 KB
testcase_09 AC 82 ms
15,068 KB
testcase_10 AC 126 ms
20,000 KB
testcase_11 AC 80 ms
15,064 KB
testcase_12 AC 79 ms
15,284 KB
testcase_13 AC 79 ms
15,008 KB
testcase_14 AC 79 ms
15,060 KB
testcase_15 AC 79 ms
15,012 KB
testcase_16 AC 80 ms
15,104 KB
testcase_17 AC 80 ms
15,304 KB
testcase_18 AC 98 ms
17,372 KB
testcase_19 AC 117 ms
19,108 KB
testcase_20 AC 116 ms
18,900 KB
testcase_21 AC 116 ms
18,932 KB
testcase_22 AC 116 ms
19,200 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

gets
l={}
s=0
gets.split.map(&:to_i).map{|i|
  s+=i
  l.keys.map{|j|l[j+i]=1}
  l[i]=1
}
puts s%2==0&&l[s/2]?"possible":"impossible"
0