結果
| 問題 | No.3217 Shiki no Shiki |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-22 02:43:44 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 364 bytes |
| 記録 | |
| コンパイル時間 | 1,831 ms |
| コンパイル使用メモリ | 177,464 KB |
| 実行使用メモリ | 9,928 KB |
| 最終ジャッジ日時 | 2026-09-22 02:43:52 |
| 合計ジャッジ時間 | 4,640 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 2 WA * 21 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(void){
int n; cin >> n;
vector<int> p(n+1), ok(n+1);
for(int i=1; i<=n; i++) cin >> p[i];
for(int i=1; i<=n; i++) ok[p[p[i]]]++;
int ans=0;
for(int i=1; i<=n; i++) ans+=(ok[i]>0);
cout << ans << endl;
return 0;
}