This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <stdio.h>
int N, M, chk[3000010], cnt;
int main()
{
//freopen("input.txt", "r", stdin);
int i, j;
scanf("%d", &N);
for(i = 1; i <= N; i ++)
{
int inp;
scanf("%d", &inp);
if(!chk[inp + 1000000]) cnt ++, chk[inp + 1000000] = 1;
}
scanf("%d", &M);
for(i = N+1; i <= M; i ++)
{
if(chk[cnt + 1000000])
{
printf("%d\n", cnt);
return 0;
}
chk[cnt + 1000000] = 1;
cnt ++;
}
printf("%d\n", --cnt);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |