改了N遍了,就是60分,#3#5WA,到底是怎么回事?大佬求救QWQ
查看原帖
改了N遍了,就是60分,#3#5WA,到底是怎么回事?大佬求救QWQ
947270
Soul_Seeker楼主2023/5/16 19:54
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
bool a[70], b[70], flag;
int x, y, n;
int main() {
	cin >> x;
	for (int i = 1; i <= 63; i++) {
		a[i] = 0;
		b[i] = 0;
	}
	for (int i = 0; i < x; i++) {
		cin >> n;
		a[n] = 1;
	}
	cin >> y;
	for (int i = 0; i < y; i++) {
		cin >> n;
		b[n] = 1;
	}
	cout << x << endl;
	for (int i = 0; i <= 63; i++)
		if (a[i] && b[i])cout << i << " ";
	cout << endl;
	for (int i = 0; i <= 63; i++)
		if (a[i] || b[i])cout << i << " ";
	cout << endl;
	for (int i = 0; i <= 63; i++)
		if (a[i] == 0)cout << i << " ";
	cout << endl;
	for (int i = 0; i <= 63; i++) {
		if (a[i] && b[i])flag = 1;
		else flag = 0;
	}
	if (flag)cout << 1 << endl;
	else cout << 0 << endl;
	flag = 1;
	for (int i = 0; i <= 63; i++)
		if (a[i] && b[i] == 0)flag = 0;
	if (flag)cout << 1 << endl;
	else cout << 0 << endl;
	if (a[0])cout << 1<<endl;
	else cout << 0<<endl;
	return 0;
}
2023/5/16 19:54
加载中...