제출 #62504

#제출 시각아이디문제언어결과실행 시간메모리
62504zetapi크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define int long long #define itr ::iterator typedef pair<int,int> pii; const int MAX=1e5; char last; char X[MAX]; int ind,size[MAX],par[MAX]; void Init() { } void TypeLetter(char L) { ++ind; X[ind]=L; par[ind]=ind-1; size[ind]=size[par[ind]]+1; return ; } void UndoCommands(int U) { ++ind; par[ind]=ind-U-1; size[ind]=size[par[ind]]; return ; } char GetLetter(int P) { P++; int cur=ind; while(cur) { if(size[cur]==P and X[cur]>='a' and X[cur]<='z') return X[cur]; cur=par[cur]; } } /*signed main() { ios_base::sync_with_stdio(false); TypeLetter('a'); TypeLetter('b'); TypeLetter('d'); UndoCommands(2); UndoCommands(1); cout<<GetLetter(2); //cout<<ind<<" "<<par[ind]<<"\n"; return 0; }*/

컴파일 시 표준 에러 (stderr) 메시지

scrivener.cpp: In function 'char GetLetter(long long int)':
scrivener.cpp:51:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
/tmp/ccySpmqi.o: In function `main':
grader.cpp:(.text.startup+0x14b): undefined reference to `UndoCommands(int)'
grader.cpp:(.text.startup+0x177): undefined reference to `GetLetter(int)'
collect2: error: ld returned 1 exit status