結果
問題 |
No.100 直列あみだくじ
|
ユーザー |
|
提出日時 | 2017-05-16 14:57:47 |
言語 | D (dmd 2.109.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 378 bytes |
コンパイル時間 | 958 ms |
コンパイル使用メモリ | 120,876 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-12 19:17:27 |
合計ジャッジ時間 | 2,139 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 WA * 21 |
ソースコード
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" ); }