제출 #431734

#제출 시각아이디문제언어결과실행 시간메모리
431734luka1234크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define ll long long #define ff first #define ss second using namespace std; int siz[1000001]; char adg[1000001]; int main(){ int n; cin>>n; set<int> s; int mn=1e9; vector<pair<pair<char,char>,int> > a; for(int k=1;k<=n;k++){ char c; cin>>c; if(c=='T'){ char c1; cin>>c1; a.push_back({{'T',c1},-1}); } if(c=='U'){ int v; cin>>v; a.push_back({{'U','S'},v}); } if(c=='P'){ int v; cin>>v; s.insert(v); } } for(int k=0;k<a.size();k++){ char c=a[k].ff.ff; if(c=='T'){ char c1=a[k].ff.ss; siz[k+1]=siz[k]+1; int v=siz[k+1]-1; if(s.find(v)!=s.end()) adg[v]=c1; } if(c=='U'){ int v=a[k].ss; siz[k+1]=siz[k-v]; } } set<int>::iterator it; for(it=s.begin();it!=s.end();it++){ int v=*it; cout<<adg[v]<<"\n"; } return 0; }

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

scrivener.cpp: In function 'int main()':
scrivener.cpp:33:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<std::pair<char, char>, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |  for(int k=0;k<a.size();k++){
      |              ~^~~~~~~~~
scrivener.cpp:12:6: warning: unused variable 'mn' [-Wunused-variable]
   12 |  int mn=1e9;
      |      ^~
/usr/bin/ld: /tmp/ccNoe4Yv.o: in function `main':
scrivener.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccesuoBt.o:grader.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccesuoBt.o: in function `main':
grader.cpp:(.text.startup+0x63): undefined reference to `Init()'
/usr/bin/ld: grader.cpp:(.text.startup+0xff): undefined reference to `TypeLetter(char)'
/usr/bin/ld: 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