結果
| 問題 | No.100 直列あみだくじ |
| コンテスト | |
| ユーザー |
tottoripaper
|
| 提出日時 | 2015-03-16 17:14:47 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 347 bytes |
| 記録 | |
| コンパイル時間 | 203 ms |
| コンパイル使用メモリ | 39,732 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2026-03-18 05:25:33 |
| 合計ジャッジ時間 | 1,569 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 WA * 12 |
ソースコード
#include <cstdio>
int N, A[51];
bool used[51];
int main(){
scanf("%d", &N);
for(int i=1;i<=N;i++){
scanf("%d", A+i);
}
for(int i=1;i<=N;i++){
if(used[i]){continue;}
int t = 1;
for(int j=A[i];j!=i;j=A[j]){used[j] = true; t++;}
if(t == 2){puts("No"); return 0;}
}
puts("Yes");
}
tottoripaper