제출 #68019

#제출 시각아이디문제언어결과실행 시간메모리
68019naderjemel낙하산 고리들 (IOI12_rings)C++14
컴파일 에러
0 ms0 KiB
#include <grader.cpp> #include <bits/stdc++.h> using namespace std; const int LOG = 21; struct node { char c; int s; node *anc[LOG]; node(){ for(int i=0;i<LOG;i++) anc[i] = NULL; s=0; } }*tree [1000005]; int id; void Init(){ id=1; tree[0] = new node(); } void TypeLetter(char L) { int n=id++; tree[n] = new node(); tree[n]->s = tree[n-1]->s+1; tree[n]->c = L; tree[n]->anc[0]=tree[n-1]; for(int i=1;i<LOG;i++) tree[n]->anc[i] = (tree[n]->anc[i-1]) ? (tree[n]->anc[i-1])->anc[i-1] : NULL; } void UndoCommands(int U) { int ret=id-1-U; int n=id++; tree[n]=tree[ret]; } char GetLetter(int P) { int n=id-1; node *h = new node(); h=tree[n]; int up=tree[n]->s - 1 - P; for(int i=LOG-1;i>=0;i--){ if(up - (1<<i) >= 0){ up-=(1<<i); h=h->anc[i]; } } return h->c; }

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

/tmp/ccXLl9o7.o: In function `main':
rings.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccortGaw.o:grader.cpp:(.text.startup+0x0): first defined here
/tmp/ccortGaw.o: In function `main':
grader.cpp:(.text.startup+0x80): undefined reference to `Init(int)'
grader.cpp:(.text.startup+0xb2): undefined reference to `Link(int, int)'
grader.cpp:(.text.startup+0xd5): undefined reference to `CountCritical()'
/tmp/ccXLl9o7.o: In function `main':
rings.cpp:(.text.startup+0x80): undefined reference to `Init(int)'
rings.cpp:(.text.startup+0xb2): undefined reference to `Link(int, int)'
rings.cpp:(.text.startup+0xd5): undefined reference to `CountCritical()'
collect2: error: ld returned 1 exit status