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,B[2000000],S;
bool chk[4000000];
int main()
{
scanf ("%d",&N);
for (int i=0;i<N;i++){
scanf ("%d",&B[i]);
if (!chk[B[i]+1000000]){
chk[B[i]+1000000] = 1;
S++;
}
}
for (int i=N;i<2000000;i++){
int u = S;
B[i] = u;
if (!chk[u+1000000]){
chk[u+1000000] = 1;
S++;
}
}
int M,A;
scanf ("%d",&M); M--;
if (M < 2000000) A = B[M];
else A = B[1999999] + (M - 1999999) * (B[1999999] - B[1999998]);
printf ("%d\n",A);
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... |