Submission #14274

# Submission time Handle Problem Language Result Execution time Memory
14274 2015-05-09T17:25:57 Z operaghost 이상한 수열 (OJUZ10_bizarre) C++
0 / 100
13 ms 9092 KB
#include <stdio.h>
#include <stdlib.h>
#define MIN(a,b)a<b?a:b
int a[50001],visit[2000002],mi=0x7fffffff;
int main()
{
    int n,i,m,cnt=0;
    scanf("%d",&n);
    for(i=1;i<=n;i++){
        scanf("%d",&a[i]);
        if(a[i]>=0&&visit[a[i]]==0)                 cnt++,visit[a[i]]=1;
        else if(a[i]<0&&visit[abs(a[i])+1000000]==0)cnt++,visit[abs(a[i])+1000000]=1;
        if(a[i]>0&&a[i]>=n&&a[i]<mi)mi=a[i];
    }
    scanf("%d",&m);
    //printf("%d %d\n",cnt,mi);
    if(m<=n)printf("%d",a[i]);
    else{
        if(n+mi-cnt+1<m)printf("%d",mi);
        else            printf("%d",cnt+m-n-1);
    }
   return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 9092 KB Output isn't correct
2 Incorrect 0 ms 9092 KB Output isn't correct
3 Incorrect 0 ms 9092 KB Output isn't correct
4 Incorrect 0 ms 9092 KB Output isn't correct
5 Correct 0 ms 9092 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 9092 KB Output isn't correct
2 Incorrect 0 ms 9092 KB Output isn't correct
3 Incorrect 0 ms 9092 KB Output isn't correct
4 Incorrect 0 ms 9092 KB Output isn't correct
5 Correct 0 ms 9092 KB Output is correct
6 Incorrect 0 ms 9092 KB Output isn't correct
7 Incorrect 0 ms 9092 KB Output isn't correct
8 Correct 0 ms 9092 KB Output is correct
9 Incorrect 0 ms 9092 KB Output isn't correct
10 Incorrect 0 ms 9092 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 9092 KB Output isn't correct
2 Incorrect 0 ms 9092 KB Output isn't correct
3 Incorrect 0 ms 9092 KB Output isn't correct
4 Incorrect 0 ms 9092 KB Output isn't correct
5 Incorrect 5 ms 9092 KB Output isn't correct
6 Incorrect 0 ms 9092 KB Output isn't correct
7 Incorrect 8 ms 9092 KB Output isn't correct
8 Incorrect 0 ms 9092 KB Output isn't correct
9 Incorrect 10 ms 9092 KB Output isn't correct
10 Incorrect 13 ms 9092 KB Output isn't correct
11 Correct 5 ms 9092 KB Output is correct
12 Incorrect 0 ms 9092 KB Output isn't correct
13 Incorrect 0 ms 9092 KB Output isn't correct
14 Incorrect 0 ms 9092 KB Output isn't correct
15 Incorrect 0 ms 9092 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 9092 KB Output isn't correct
2 Incorrect 8 ms 9092 KB Output isn't correct
3 Incorrect 0 ms 9092 KB Output isn't correct
4 Incorrect 0 ms 9092 KB Output isn't correct
5 Incorrect 0 ms 9092 KB Output isn't correct
6 Correct 0 ms 9092 KB Output is correct
7 Incorrect 0 ms 9092 KB Output isn't correct
8 Incorrect 0 ms 9092 KB Output isn't correct
9 Incorrect 4 ms 9092 KB Output isn't correct
10 Incorrect 8 ms 9092 KB Output isn't correct
11 Incorrect 0 ms 9092 KB Output isn't correct
12 Incorrect 0 ms 9092 KB Output isn't correct
13 Incorrect 0 ms 9092 KB Output isn't correct
14 Incorrect 8 ms 9092 KB Output isn't correct
15 Incorrect 0 ms 9092 KB Output isn't correct