本地编译通过,洛谷编译CE
  • 板块学术版
  • 楼主Binah_cyc
  • 当前回复5
  • 已保存回复5
  • 发布时间2023/12/30 21:25
  • 上次更新2023/12/31 01:07:11
查看原帖
本地编译通过,洛谷编译CE
760171
Binah_cyc楼主2023/12/30 21:25

RT

#include <bits/stdc++.h>
using namespace std;
// #define int long long
int n,m,a,b,cnt;
unordered_map<int,bool> mp;
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>n;
	for(int i=1;i<=n;i++) cin>>a,mp[a]=1;
	cin>>m;
	for(int i=1;i<=n;i++) cin>>b,cnt+=mp[b];
	if(cnt==n&&cnt==m) cout<<"A equals B";
	else if(cnt==n) cout<<"A is a proper subset of B";
	else if(cnt==m) cout<<"B is a proper subset of A";
	else if(!cnt) cout<<"A and B are disjoint";
	else cout<"I'm confused!";
	return 0;
}

2023/12/30 21:25
加载中...