think:
1暴力for循环
2初级桶排序思想
离散题目3
Time Limit: 1000MS Memory Limit: 65536KB
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
以下为accepted代码——初级桶排序思想
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
int main()
{
int n, m, i, x, flag;
int vid[140000], ans[140000];
while