제출 #1009090

#제출 시각아이디문제언어결과실행 시간메모리
1009090Rifal크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++14
0 / 100
60 ms13504 KiB
#include<bits/stdc++.h> #define fi first #define se second using namespace std; vector<pair<int,char>> v; string cur; void Init() {} void TypeLetter(char L) { v.push_back({-1,L}); } void UndoCommands(int U) { v.push_back({U,' '}); } char GetLetter(int P) { if(v.size() <= 5e3) { for(int i = 0; i < v.size(); i++) { if(v[i].fi == -1) { cur.push_back(v[i].se); } else { cur.clear(); int cnt = 0; for(int j = i; j >= 0; j--) { if (cnt > 0) { cnt--; continue; } if (v[i].first == -1) { cur.push_back(v[i].second); } else { cnt = v[i].first; } } reverse(cur.begin(), cur.end()); } } } else { } return cur[P]; }

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

scrivener.cpp: In function 'char GetLetter(int)':
scrivener.cpp:18:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |     for(int i = 0; i < v.size(); i++) {
      |                    ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...