제출 #41246

#제출 시각아이디문제언어결과실행 시간메모리
41246mirbek01크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++14
컴파일 에러
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; }

컴파일 시 표준 에러 (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