Submission #13961

#TimeUsernameProblemLanguageResultExecution timeMemory
13961kriii이상한 수열 (OJUZ10_bizarre)C++14
100 / 100
15 ms12800 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...