Submission #14093

#TimeUsernameProblemLanguageResultExecution timeMemory
14093ansol4328이상한 수열 (OJUZ10_bizarre)C++98
62 / 100
12 ms8972 KiB
#include<stdio.h> #define X 1000000 int check[2000005]; int main() { int n, m[50005], k, i, cnt=0, a; scanf("%d",&n); for(i=1 ; i<=n ; i++) { scanf("%d",&m[i]); if(check[m[i]+X]==0) cnt++, check[m[i]+X]=1; } scanf("%d",&k); if(n>=k) printf("%d",m[k]); else { a=n; while(a<=k-2) { if(check[cnt+X]==0) { check[cnt+X]=1; cnt++; } else break; a++; } printf("%d",cnt); } 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...