제출 #119826

#제출 시각아이디문제언어결과실행 시간메모리
119826dolphingarlic크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++14
0 / 100
1080 ms253496 KiB
#include <bits/stdc++.h> using namespace std; pair<char, char> v[1000001]; string s, t; int indx = 0; bool got = false; void get() { int ptr = indx - 1; while (ptr != -1) { while (ptr != -1 && v[ptr].first == 'U') ptr -= (int)v[ptr].second + 1; s += v[ptr--].second; } for (int i = 0; i < s.size(); i++) t[i] = s[s.size() - 1 - i]; } void Init() { } void TypeLetter(char L) { v[indx++] = {'T', L}; } void UndoCommands(int U) { v[indx++] = {'U', (char)U}; } char GetLetter(int P) { if (!got) { get(); got = true; } return t[P]; } // int main() { // int t; // cin >> t; // for (int i = 0; i < t; i++) { // char c, d; int e; // cin >> c; // switch (c) { // case 'T': // cin >> d; // TypeLetter(d); // break; // case 'P': // cin >> e; // cout << GetLetter(e) << '\n'; // break; // default: // cin >> e; // UndoCommands(e); // } // } // }

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

scrivener.cpp: In function 'void get()':
scrivener.cpp:16:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < s.size(); i++) t[i] = s[s.size() - 1 - 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...