离散题目3
Time Limit: 1000MS Memory Limit: 65536KB
Submit Statistic
Problem Description
DaYu在新的学习开始学习新的数学知识,一天DaYu学习集合的时候遇到一个问题,他有两个集合A和B,他想知道A是不是B的子集。
Input
多组输入,每组的第一行有两个数n,m,0 < n,m < 10^5。表示集合A的大小和集合B的大小。第二行输入n个数表示集合A,第三行输入m个数表示集合B,|data_i| < 10^5绝对值注意*
Output
如果A是B的子集,输出”true”,否则输出”false”。
Example Input**
***3 5
1 2 3
1 5 4 3 2
3 5
1 2 3
1 4 5 3 6
Example Output
true
false***
思路(一样,下标定义,不过要防止下标越界,代码如下)
#include <stdio.h>
#include <stdlib.h>
#include<string.h>
int a[300000],b[300000];
int main()
{