#32817:


yp11151049@yphs.tp.edu.tw (801-24)

學校 : 臺北市私立延平高級中學
編號 : 197224
來源 : [203.72.178.1]
最後登入時間 :
2024-05-27 17:51:24
e546. 12650 - Dangerous Dive -- UVA | From: [203.72.178.1] | 發表日期 : 2022-11-09 17:39

#include <iostream>
#include <cstring>
using namespace std;
 
int main() {
    int N, R, x;
    while (cin >> N >> R){
        int a[N];
        memset(a, 0, sizeof(a));
        for (int i = 0; i < R; i++){
            cin >> x;
            a[x-1] = 1;
        }
        bool flag = true;
        for (int i = 0; i < N; i++){
            if (!a[i]) {
                flag = false;
                cout << i+1 << " ";
            }
        }
        if (flag) cout << "*\n";
        else cout << "\n";
    }
    return 0;
}
 
ZeroJudge Forum