论此题有多少错误
2025-06-08 15:51:10
发布于:北京
为什么加上这段代码能过,不加不能过???这n10是什么鬼????
if(n10){
cout<<10;
return 0;
}
全部评论 3
我不知道,可能有特判吧??
2025-12-17 来自 上海
1应该是测试点错了
2025-06-08 来自 广东
1我已经在题目纠错里反馈了
2025-06-09 来自 北京
1我也反馈了
2025-07-06 来自 浙江
1
是不是第四个测试点
第四个测试点洛谷过得了但acgo过不了
已举报2026-01-28 来自 湖南
0啊?我过了:
#include <bits/stdc++.h>
using namespace std;int main() {
int n, m, d;
cin >> n >> m;
int a[1000] = {0}; //0表示未到达,1表示已到达
for (int i = 0; i < m; i++) {
cin >> d;
a[d] = 1;
}
bool is = 0;
for (int i = 0; i < n; i++) {
if (a[i] == 0) {
is = 1;
cout << i << " ";
}
}
if (is == 0) {
cout << n;
}
return 0;
}
??????1周前 来自 江苏
1我的是:
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<bool> arrived(N, false);
int count_arrived = 0;
for (int i = 0; i < M; i++) {
int num;
cin >> num;
if (!arrived[num]) {
arrived[num] = true;
count_arrived++;
}
}
if (count_arrived == N) {
cout << N << endl;
} else {
bool is_first = true;
for (int i = 0; i < N; i++) {
if (!arrived[i]) {
if (!is_first) {
cout << " ";
}
cout << i;
is_first = false;
}
}
cout << endl;
}
return 0;
}1周前 来自 湖南
0




















有帮助,赞一个