結果
問題 | No.349 干支の置き物 |
ユーザー |
![]() |
提出日時 | 2016-09-22 16:54:57 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 192 bytes |
コンパイル時間 | 287 ms |
コンパイル使用メモリ | 7,296 KB |
実行使用メモリ | 12,160 KB |
最終ジャッジ日時 | 2024-11-17 13:09:06 |
合計ジャッジ時間 | 3,846 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 9 WA * 20 |
コンパイルメッセージ
Syntax OK
ソースコード
n = gets.to_i a = [] yes = 0 n.times do |i| a[i] = gets.to_s if i >= 1 and a[i] != a[i-1] yes += 1 elsif i >= 1 and a[i] == a[i-1] puts "NO" break end end if yes == n - 1 puts "YES" end