Submission #14901

#TimeUsernameProblemLanguageResultExecution timeMemory
14901kyma123이상한 수열 (OJUZ10_bizarre)C++98
24 / 100
27 ms9724 KiB
#include <iostream> using namespace std; int arr[2000002], s, series[50001]; int main() { int n, m, a, i; cin >> n; for(i = 0; i < n; i++) { cin >> a; a += 1000000; series[i] = a; if(!arr[a]) s++; arr[a]++; } cin >> m; if(m < n) { cout << series[m - 1]; return 0; } for(i = n; i < m; i++) { if(arr[s + 1000000]) { break; } s++; } cout << s - (i == m); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...