답안 #140159

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
140159 2019-08-02T07:58:54 Z ggoh 곤돌라 (IOI14_gondola) C
컴파일 오류
0 ms 0 KB
#include "gondola.h"
#include <bits/stdc++.h>

int ch[250005],i;
int valid(int n, int inputSeq[])
{
    int ST=-1,st,C=1;
    for(i=0;i<n;i++)ch[i]=0;
    for(i=0;i<n;i++)
    {
      if(ch[inputSeq[i]]==1){C=0;break;}
      ch[inputSeq[i]]=1;
    }
    for(i=0;i<n;i++)
    {
        if(inputSeq[i]<=n)
        {
            st=i-inputSeq[i]+1;st=(st+n)%n;
            if(ST==-1)ST=st;
            else if(ST!=st){C=0;break;}
        }
    }
    return C;
}

//----------------------

int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
    int m=-1,sz=0;
    for(i=1;i<=250000;i++)ch[i]=0;
    for(i=0;i<n;i++)
    {
        m=std::max(gondolaSeq[i],m);
        ch[gondolaSeq[i]]=1;
    }
    for(i=1;i<=m;i++)
    {
        if(ch[i]==0)replacementSeq[sz++]=i;
    }
    return sz;
}

//----------------------

int countReplacement(int n, int inputSeq[])
{
  return -3;
}

Compilation message

gondola.c:2:10: fatal error: bits/stdc++.h: No such file or directory
 #include <bits/stdc++.h>
          ^~~~~~~~~~~~~~~
compilation terminated.
grader.c: In function 'main':
grader.c:37:1: error: a label can only be part of a statement and a declaration is not a statement
 int ans =(  countReplacement(n, gondolaSequence));
 ^~~