제출 #425684

#제출 시각아이디문제언어결과실행 시간메모리
425684ismoilov크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++) #define fpp(a,i,c) for(int (a) = (i); (a) <= (c); (a)++) #define fv(a, c) for(int (a) = (1); (a) <= (c); (a)++) #define fz(a, c) for(int (a) = (0); (a) < (c); (a)++) #define fm(a,i,c) for(int (a) = (i); (a) > (c); (a)--) #define fmm(a,i,c) for(int (a) = (i); (a) >= (c); (a)--) #define pb push_back #define in insert #define ss second #define ff first #define vi vector <int> #define fa(a, v) for(auto (a) : (v)) #define mnel(a) *min_element(all(a)) #define mxel(a) *max_element(all(a)) #define si set<int> #define sov(a) sort(all((a))) #define maxx 1000100 char last; vector <string> now(maxx); int cnt = 1; //vector <pair<int, string>> done; void Init() { } void TypeLetter(char L) { now[cnt+1] = now[cnt] + L; cnt ++; } void UndoCommands(int U) { cnt ++; now[cnt] = now[cnt-U-1]; } char GetLetter(int P) { return now[cnt][P]; } int main() { Init(); int n; cin >> n; while(n --){ string s; cin >> s; if(s == "T"){ char l; cin >> l; TypeLetter(l); } if(s == "U"){ int u; cin >> u; UndoCommands(u); } if(s == "P"){ int p; cin >> p; cout << GetLetter(p); } cout << "now " << now[cnt] << "\n"; } }

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

/usr/bin/ld: /tmp/ccXShtlQ.o: in function `main':
scrivener.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccVL638Q.o:grader.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status