Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
366819 黄浙峰老师 【GESP三级】春游 C++ 通过 100 7 MS 248 KB 598 2025-12-07 15:40:45

Tests(10/10):


#include <iostream> using namespace std; bool a[1000]; int main() { int n , m ; cin >> n >> m; // 初始化 a 数组为所有同学均未报到 for (int i = 0; i < n; i++) a[i] = false; // 依次报到 m 次 for (int i = 0; i < m; i++) { int b ; cin >> b; a[b] = true; } // 依次检查 n 位同学是否到达 bool all = true; for (int i = 0; i < n; i++) { if (!a[i]) { if (all) { cout << i; all = false; } else { cout << " " << i; } } } // 处理全部到达的特殊情况 if (all) cout << n; cout << endl; return 0; }


测评信息: