답안 #14303

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
14303 2015-05-11T14:31:59 Z pichulia 이상한 수열 (OJUZ10_bizarre) C++
62 / 100
33 ms 49520 KB
#include<stdio.h>
#define M 1000000
int n, m;
long long int a[3100099];
long long int s[3100000];
int main()
{
    int i, j, k, l;
    scanf("%d",&n);
    for(i=1;i<=n;i++){scanf("%lld",&a[i]);s[a[i]+M]++;}
    scanf("%d",&m);
    int cnt=0;
    for(i=0;i<2*M+20;i++)if(s[i])cnt++;
    for(i=n+1;i<2*M+20;i++)
    {
        a[i]=cnt;
        s[cnt+M]++;
        if(s[cnt+M]==1)cnt++;
    }
    if(m<2*M+20)
    {
        printf("%d\n",a[m]);
    }
    else
    {
        long long int p,q;
        p = a[i-2];
        q = a[i-1];
        if(p==q)printf("%lld\n",p);
        else
        {
            q+=(m-i)*(q-p);
            printf("%lld\n",q);
        }
    }
  
}
# 결과 실행 시간 메모리 Grader output
1 Correct 18 ms 49520 KB Output is correct
2 Correct 19 ms 49520 KB Output is correct
3 Correct 18 ms 49520 KB Output is correct
4 Correct 14 ms 49520 KB Output is correct
5 Correct 16 ms 49520 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 18 ms 49520 KB Output is correct
2 Correct 18 ms 49520 KB Output is correct
3 Correct 17 ms 49520 KB Output is correct
4 Correct 15 ms 49520 KB Output is correct
5 Correct 17 ms 49520 KB Output is correct
6 Correct 14 ms 49520 KB Output is correct
7 Correct 13 ms 49520 KB Output is correct
8 Correct 14 ms 49520 KB Output is correct
9 Correct 18 ms 49520 KB Output is correct
10 Correct 13 ms 49520 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 23 ms 49520 KB Output is correct
2 Correct 20 ms 49520 KB Output is correct
3 Correct 26 ms 49520 KB Output is correct
4 Correct 13 ms 49520 KB Output is correct
5 Correct 17 ms 49520 KB Output is correct
6 Correct 12 ms 49520 KB Output is correct
7 Correct 13 ms 49520 KB Output is correct
8 Correct 25 ms 49520 KB Output is correct
9 Correct 33 ms 49520 KB Output is correct
10 Correct 22 ms 49520 KB Output is correct
11 Correct 19 ms 49520 KB Output is correct
12 Correct 20 ms 49520 KB Output is correct
13 Correct 25 ms 49520 KB Output is correct
14 Correct 23 ms 49520 KB Output is correct
15 Correct 15 ms 49520 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 24 ms 49520 KB Output isn't correct
2 Correct 13 ms 49520 KB Output is correct
3 Incorrect 12 ms 49520 KB Output isn't correct
4 Incorrect 17 ms 49520 KB Output isn't correct
5 Incorrect 12 ms 49520 KB Output isn't correct
6 Correct 27 ms 49520 KB Output is correct
7 Correct 19 ms 49520 KB Output is correct
8 Incorrect 17 ms 49520 KB Output isn't correct
9 Correct 21 ms 49520 KB Output is correct
10 Incorrect 27 ms 49520 KB Output isn't correct
11 Correct 12 ms 49520 KB Output is correct
12 Incorrect 19 ms 49520 KB Output isn't correct
13 Correct 29 ms 49520 KB Output is correct
14 Incorrect 24 ms 49520 KB Output isn't correct
15 Incorrect 11 ms 49520 KB Output isn't correct