Submission #23480

# Submission time Handle Problem Language Result Execution time Memory
23480 2017-05-10T02:38:15 Z TAMREF 이상한 수열 (OJUZ10_bizarre) C++11
62 / 100
23 ms 11392 KB
#include <bits/stdc++.h>
using namespace std;
int S[200000], A[2000005], cnt[200000];
const int bias=1000000;
int main(){
    int N,M; scanf("%d",&N);
    for(int i=1;i<=N;i++){
        scanf("%d",&S[i]);
        cnt[i]=cnt[i-1]+(A[S[i]+bias]++?0:1);
    } scanf("%d",&M);
    if(M<=N) return !printf("%d\n",S[M]);
    cnt[N+1]=cnt[N];
    for(int i=N+2;i<=M;i++)
        cnt[i]=cnt[i-1]+(A[cnt[i-1]+bias]++?0:1);
    return !printf("%d\n",cnt[M]);
}

Compilation message

bizarre.cpp: In function 'int main()':
bizarre.cpp:6:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     int N,M; scanf("%d",&N);
                            ^
bizarre.cpp:8:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&S[i]);
                          ^
bizarre.cpp:10:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     } scanf("%d",&M);
                     ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 11392 KB Output is correct
2 Correct 0 ms 11392 KB Output is correct
3 Correct 0 ms 11392 KB Output is correct
4 Correct 0 ms 11392 KB Output is correct
5 Correct 0 ms 11392 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 11392 KB Output is correct
2 Correct 0 ms 11392 KB Output is correct
3 Correct 0 ms 11392 KB Output is correct
4 Correct 0 ms 11392 KB Output is correct
5 Correct 0 ms 11392 KB Output is correct
6 Correct 0 ms 11392 KB Output is correct
7 Correct 0 ms 11392 KB Output is correct
8 Correct 0 ms 11392 KB Output is correct
9 Correct 0 ms 11392 KB Output is correct
10 Correct 0 ms 11392 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 13 ms 11392 KB Output is correct
2 Correct 0 ms 11392 KB Output is correct
3 Correct 6 ms 11392 KB Output is correct
4 Correct 3 ms 11392 KB Output is correct
5 Correct 0 ms 11392 KB Output is correct
6 Correct 3 ms 11392 KB Output is correct
7 Correct 0 ms 11392 KB Output is correct
8 Correct 0 ms 11392 KB Output is correct
9 Correct 6 ms 11392 KB Output is correct
10 Correct 16 ms 11392 KB Output is correct
11 Correct 6 ms 11392 KB Output is correct
12 Correct 0 ms 11392 KB Output is correct
13 Correct 3 ms 11392 KB Output is correct
14 Correct 3 ms 11392 KB Output is correct
15 Correct 6 ms 11392 KB Output is correct
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -
2 Runtime error 23 ms 11392 KB Execution killed with signal 11 (could be triggered by violating memory limits)