답안 #975771

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
975771 2024-05-05T20:16:04 Z marinaluca 크레이피쉬 글쓰는 기계 (IOI12_scrivener) C++14
컴파일 오류
0 ms 0 KB
char c[1000010];
int a[1000010], lev[1000010], st[20][1000010], t;
void Init(){}
void Typeletter (char L){
  int i;
    c[a[++t] = t] = L;
    lev[t] = lev[st[0][t] = a[t - 1]] + 1;
    for (i = 1; i < 20; ++ i)
        st[i][t] = st[i - 1][st[i - 1][t]];
}
void UndoCommands(int U){a[++t]=a[t-U-1];}

char GetLetter(int P){
    int aa = a[t], i;
    for (i = 20; i --;)
        if (lev[st[i][aa]] > P)
          aa = st[i][aa];
    return c[aa];
}

Compilation message

scrivener.cpp: In function 'void UndoCommands(int)':
scrivener.cpp:11:28: warning: operation on 't' may be undefined [-Wsequence-point]
   11 | void UndoCommands(int U){a[++t]=a[t-U-1];}
      |                            ^~~
scrivener.cpp:11:28: warning: operation on 't' may be undefined [-Wsequence-point]
/usr/bin/ld: /tmp/ccqE7xI7.o: in function `main':
grader.cpp:(.text.startup+0xff): undefined reference to `TypeLetter(char)'
collect2: error: ld returned 1 exit status