Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Сборка контеста
- // test.cpp: определяет точку входа для консольного приложения.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <algorithm>
- #include <vector>
- #include <math.h>
- #include <stdio.h>
- #include <set>
- #define nl "\n"
- using namespace std;
- int main(void) {
- int n, m, a, del = 0;
- scanf("%d%d", &n, &m);
- vector<int> cnts(n, 0);
- for (int i = 0; i < m; ++ i) {
- scanf("%d", &a);
- ++ cnts[a - 1];
- bool flag = true;
- for (int j = 0; j < n; ++ j) {
- if (cnts[j] - del <= 0) {
- flag = false;
- break;
- }
- }
- if (flag) {
- ++ del;
- printf("1");
- }
- else
- printf("0");
- }
- printf("\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement