結果
問題 |
No.100 直列あみだくじ
|
ユーザー |
|
提出日時 | 2017-05-16 14:57:32 |
言語 | D (dmd 2.109.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 378 bytes |
コンパイル時間 | 846 ms |
コンパイル使用メモリ | 118,168 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-12 19:17:10 |
合計ジャッジ時間 | 1,922 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 45 |
ソースコード
import std.stdio, std.array, std.string, std.conv, std.algorithm; import std.typecons, std.range, std.random, std.math, std.container; import std.numeric, std.bigint, core.bitop; void main() { auto N = readln.chomp.to!int; auto A = readln.split.map!(x => x.to!int-1).array; auto cnt = N.iota.map!(i => i == A[i]).sum; writeln( N - cnt == 2 ? "NO" : "YES" ); }