Submission #759574

#TimeUsernameProblemLanguageResultExecution timeMemory
759574aykhnCrayfish scrivener (IOI12_scrivener)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "grader.cpp" // author: aykhn using namespace std; typedef long long ll; #define TC int t; cin >> t; while (t--) _(); #define OPT ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define all(v) v.begin(), v.end() #define pii pair<int, int> #define mpr make_pair #define eb emplace_back #define pb push_back #define ts to_string #define fi first #define se second #define ins insert #define int ll #define inf 0x3F3F3F3F #define infll 0x3F3F3F3F3F3F3F3FLL #define bpc __builtin_popcount string s; vector<pair<int, char>> calls; int x; string f(int i) { if (i < 0) return ""; if (calls[i].fi == 1) return f(i - 1) + calls[i].se; return f(i - 1 - calls[i].se); } void Init() { s = ""; } void TypeLetter(char L) { calls.pb(mpr(1, L)); } void UndoCommands(int U) { calls.pb(mpr(2, U)); } char GetLetter(int P) { x++; if (x == 1) { s = f(calls.size() - 1); } return s[P]; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccpwLXfB.o: in function `main':
scrivener.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccyrKyrB.o:grader.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccpwLXfB.o: in function `main':
scrivener.cpp:(.text.startup+0x1b7): undefined reference to `UndoCommands(int)'
/usr/bin/ld: scrivener.cpp:(.text.startup+0x1db): undefined reference to `GetLetter(int)'
/usr/bin/ld: /tmp/ccyrKyrB.o: in function `main':
grader.cpp:(.text.startup+0x15f): undefined reference to `UndoCommands(int)'
/usr/bin/ld: grader.cpp:(.text.startup+0x18b): undefined reference to `GetLetter(int)'
collect2: error: ld returned 1 exit status