Submission #41246

#TimeUsernameProblemLanguageResultExecution timeMemory
41246mirbek01Crayfish scrivener (IOI12_scrivener)C++14
Compilation error
0 ms0 KiB
# include <bits/stdc++.h> #pragma GCC optimize("Ofast") # define pb push_back # define fr first # define sc second # define mk make_pair using namespace std; const long long linf = 1e18 + 7; const int inf = 1e9 + 7; const int N = 1e6 + 5; typedef long long ll; int q, sz; char s[N]; string ans; int main(){ scanf("%d", &q); while(q --){ char ch, a; cin >> ch; if(ch == 'T'){ cin >> a; s[sz ++] = a; } if(ch == 'P'){ int P; cin >> P; ans += s[P]; } if(ch == 'U'){ int u; cin >> u; sz -= u; } } cout << ans << endl; }

Compilation message (stderr)

scrivener.cpp: In function 'int main()':
scrivener.cpp:22:22: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
       scanf("%d", &q);
                      ^
/tmp/cczyfkj6.o: In function `main':
scrivener.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccYgRSSC.o:grader.cpp:(.text.startup+0x0): first defined here
/tmp/ccYgRSSC.o: In function `main':
grader.cpp:(.text.startup+0x5d): undefined reference to `Init()'
grader.cpp:(.text.startup+0xef): undefined reference to `TypeLetter(char)'
grader.cpp:(.text.startup+0x14b): undefined reference to `UndoCommands(int)'
grader.cpp:(.text.startup+0x173): undefined reference to `GetLetter(int)'
collect2: error: ld returned 1 exit status