标签:script 考试 algorithm sample mon memset round for auto
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 79892 Accepted Submission(s): 22268
#include<iostream> #include<cstring> #include<queue> #include<cstdio> #include<algorithm> #include<cmath> using namespace std; #define maxn 1010 #define INF 99999999 int main() { int n,m; while(~scanf("%d%d",&n,&m)) { if(n==0&&m==0) break; int a[105],b[105],c[105]; for(int i=0;i<n;i++) scanf("%d",&a[i]); memset(c,1,sizeof(c)); for(int i=0;i<m;i++) { scanf("%d",&b[i]); for(int j=0;j<n;j++) { if(a[j]==b[i]) { c[j] = 0; break; } } } sort(a,a+n); int flag = 1; for(int i=0;i<n;i++) { if(c[i]) { printf("%d ",a[i]); flag = 0; } } if(flag) printf("NULL"); printf("\n"); } return 0; }
标签:script 考试 algorithm sample mon memset round for auto
原文地址:http://www.cnblogs.com/l609929321/p/6601392.html