結果

問題 No.602 隠されていたゲーム2
ユーザー syarosyaro
提出日時 2017-12-02 00:34:12
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 240 bytes
コンパイル時間 43 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 29,912 KB
最終ジャッジ日時 2024-05-06 00:20:13
合計ジャッジ時間 4,078 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
11,904 KB
testcase_01 AC 75 ms
12,032 KB
testcase_02 AC 73 ms
12,032 KB
testcase_03 AC 72 ms
12,160 KB
testcase_04 AC 74 ms
12,160 KB
testcase_05 AC 73 ms
11,904 KB
testcase_06 AC 73 ms
12,160 KB
testcase_07 AC 73 ms
12,032 KB
testcase_08 AC 73 ms
12,032 KB
testcase_09 AC 73 ms
12,160 KB
testcase_10 AC 75 ms
12,032 KB
testcase_11 AC 74 ms
12,032 KB
testcase_12 AC 74 ms
12,160 KB
testcase_13 AC 76 ms
12,160 KB
testcase_14 AC 76 ms
12,032 KB
testcase_15 WA -
testcase_16 AC 101 ms
14,752 KB
testcase_17 AC 134 ms
17,664 KB
testcase_18 AC 243 ms
26,496 KB
testcase_19 AC 282 ms
29,796 KB
testcase_20 AC 273 ms
28,532 KB
testcase_21 WA -
testcase_22 AC 283 ms
29,664 KB
testcase_23 AC 187 ms
29,912 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

eval"N,*D,X,Y="+gets(p).split*?,
q=X.abs+Y.abs
o,e=D.partition(&:odd?).map &:sort
f=o.map{|o|(e.bsearch{|e|e>o}||9e9)-o}+e.map{|e|(o.bsearch{|o|o>e}||9e9)-e}
p q<1?0:D.member?(q)?1:(q%2<1?q>D.max*2:(o.max||9e9)+(e.max||9e9)<q||f.min>q)?-1:2
0