結果
| 問題 | No.100 直列あみだくじ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-06-18 14:15:46 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 443 bytes |
| 記録 | |
| コンパイル時間 | 649 ms |
| コンパイル使用メモリ | 70,392 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2026-03-28 17:54:55 |
| 合計ジャッジ時間 | 6,025 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 WA * 7 |
ソースコード
#include <iostream>
#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
using namespace std;
typedef long long int ll;
int a[51];
int main(void){
int n;
cin >> n;
int c = 0;
REP(i, 0, n) {
cin >> a[i];
--a[i];
}
REP(i, 0, n) {
int v = a[i];
int c = 1;
while (v != i) {
v = a[v];
c++;
}
if (c % 2 == 0) {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
}