結果
| 問題 |
No.101 ぐるぐる!あみだくじ!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2014-12-11 23:34:17 |
| 言語 | Ruby (3.4.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 176 bytes |
| コンパイル時間 | 318 ms |
| コンパイル使用メモリ | 7,296 KB |
| 実行使用メモリ | 20,736 KB |
| 最終ジャッジ日時 | 2024-06-11 20:39:56 |
| 合計ジャッジ時間 | 7,982 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | AC * 11 TLE * 1 -- * 25 |
コンパイルメッセージ
Syntax OK
ソースコード
def g;gets.split.map(&:to_i)end
l=[*0..n=g[0]]
g[0].times{
a,b=g
l[a],l[b]=l[b],l[a]
}
cnt=1
now=l.dup
until now==[*0..n]
now.map!{|i|l[i]}
cnt+=1
end
p cnt