結果
| 問題 |
No.100 直列あみだくじ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2014-12-12 00:34:57 |
| 言語 | Ruby (3.4.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 219 bytes |
| コンパイル時間 | 285 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 12,544 KB |
| 最終ジャッジ日時 | 2024-06-11 20:54:09 |
| 合計ジャッジ時間 | 5,056 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 RE * 1 |
| other | WA * 12 RE * 33 |
コンパイルメッセージ
Syntax OK
ソースコード
n=gets.to_i;f=[nil]*n;a=gets.split.map{|e|e.to_i-1};b=n.times.map{|i|if f[i] then -1 else x=a[i];c=1;while x!=i do f[x]=1;x=a[x];c+=1;end;c;end};p b;puts b.select{|e|e%2==0}.group_by{|e|e}.all?{|k,v|v%2==0} ? :Yes : :No