Submission #39607983


Source Code Expand

/**
 * @file template.cpp
 * @author Emanual20(Emanual20@foxmail.com)
 * @brief For Codeforces, Atcoder or some other OJs else
 * @version 0.1
 * @date 2023-3-11
 * 
 * @copyright Copyright (c) 2022
 * 
 */
#pragma GCC optimize(2)
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;

const int maxn = 2e5 + 10;
const int inf = 0x3f3f3f3f;
int n, a[maxn];
set<int> st;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);

    cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i], st.insert(i);
    }
    for (int i = 1; i <= n; i++){
        if(st.count(i) == 1)
            st.erase(a[i]);
    }
    cout << st.size() << endl;
    for (auto &it : st){
        cout << it << " ";
    }
    return 0;
}

Submission Info

Submission Time
Task B - Call the ID Number
User Emanual
Language C++ (GCC 9.2.1)
Score 200
Code Size 848 Byte
Status AC
Exec Time 140 ms
Memory 13772 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 16
Set Name Test Cases
Sample example0.txt, example1.txt
All 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, example0.txt, example1.txt
Case Name Status Exec Time Memory
000.txt AC 8 ms 3476 KiB
001.txt AC 130 ms 13764 KiB
002.txt AC 77 ms 13764 KiB
003.txt AC 101 ms 13768 KiB
004.txt AC 116 ms 12420 KiB
005.txt AC 16 ms 4564 KiB
006.txt AC 63 ms 8480 KiB
007.txt AC 48 ms 7440 KiB
008.txt AC 70 ms 9020 KiB
009.txt AC 137 ms 13732 KiB
010.txt AC 140 ms 13768 KiB
011.txt AC 137 ms 13772 KiB
012.txt AC 138 ms 13692 KiB
013.txt AC 140 ms 13636 KiB
example0.txt AC 4 ms 3524 KiB
example1.txt AC 2 ms 3616 KiB