about summary refs log tree commit diff
path: root/others/easy20160714/11.c
blob: 61238ef0e3c0fc5cab82389e5f163ef27a597b62 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <stdio.h>

int main()
{
	FILE *f = fopen("INP.TXT", "r");
	short n, i, a;
	char b[10000] = {};

	fscanf(f, "%hd", &n);

	for (i = 0; i < n; i++) {
		fscanf(f, "%hd", &a);
		if (a <= n)
			b[a - 1] = 1;
	}

	fclose(f);

	a = 1;
	for (i = 0; i < n; i++)
		if (!b[i]) {
			a = 0;
			break;
		}

	f = fopen("OUT.TXT", "w");
	fputs(a ? "YES\n" : "NO\n", f);
	fclose(f);

	return 0;
}