mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1851.cpp
This commit is contained in:
parent
2512e71dc9
commit
bcbb7fac92
40
QUSTOJ/1851.cpp
Normal file
40
QUSTOJ/1851.cpp
Normal file
|
@ -0,0 +1,40 @@
|
|||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
using namespace std;
|
||||
int a[2048];
|
||||
int b[2048];
|
||||
int x[4096];
|
||||
int c;
|
||||
int d;
|
||||
int main()
|
||||
{
|
||||
int t;
|
||||
scanf("%d",&t);
|
||||
for(int i=0;i<t;i++)
|
||||
{
|
||||
scanf("%d",&a[c++]);
|
||||
}
|
||||
scanf("%d",&t);
|
||||
for(int i=0;i<t;i++)
|
||||
{
|
||||
scanf("%d",&b[d++]);
|
||||
}
|
||||
int* p=set_difference(a,a+c,b,b+d,x);
|
||||
int dd=p-x;
|
||||
if(dd==0)
|
||||
{
|
||||
printf("NULL\n");
|
||||
/// 题目似乎有问题...
|
||||
/// printf("0\n");
|
||||
return 0;
|
||||
}
|
||||
for(int i=0;i<dd-1;i++)
|
||||
{
|
||||
printf("%d ",x[i]);
|
||||
}
|
||||
printf("%d\n",x[dd-1]);
|
||||
printf("%d\n",dd);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user