結果
問題 |
No.482 あなたの名は
|
ユーザー |
![]() |
提出日時 | 2018-03-27 19:38:43 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 280 bytes |
コンパイル時間 | 107 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 31,616 KB |
最終ジャッジ日時 | 2024-06-25 12:51:19 |
合計ジャッジ時間 | 6,128 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 WA * 11 |
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n Syntax OK
ソースコード
n,k=gets.split.map{|e| e.to_i} x=gets.split.map{|e| e.to_i-1} hs={} i=0 while x.empty? == false e=x.shift #p [e,i,k,hs] if e==i i+=1 next end if hs.key?(i)!=false i+=1 next end hs[e]=0 k-=1 i+=1 end if k<0 puts "NO" elsif k%2==0 puts "YES" else puts "NO" end