제출 #1232975

#제출 시각아이디문제언어결과실행 시간메모리
1232975kaltspielerhy크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++20
5 / 100
1096 ms2008 KiB
#include <bits/stdc++.h> using namespace std; vector<pair<int, char>> commandes; vector<int> activate; void Init() {} void TypeLetter(char L) { commandes.push_back({0, L}); activate.push_back(1); } void UndoCommands(int U) { int undo = 1; int valeur = commandes.size()-1; priority_queue<int> file; file.push(U); int cpt = 0; while (!file.empty()) { int obj = file.top(); file.pop(); obj -= cpt; if (obj <= 0) { undo = (undo+1)%2; continue; } cpt++; if (!undo && commandes[valeur].first != 0) file.push(obj+cpt-2); else { if (commandes[valeur].first != 0) { undo = (undo+1)%2; file.push(commandes[valeur].first+cpt); activate[valeur] = (activate[valeur]+1)%2; } else { activate[valeur] = (activate[valeur]+1)%2; } } valeur--; file.push(obj+cpt-2); } commandes.push_back({U, '!'}); activate.push_back(1); } char GetLetter(int P) { int compteur = 0; for (int i = 0; i < commandes.size(); i++) { if (activate[i] && commandes[i].first == 0) { if (compteur == P) return commandes[i].second; compteur++; } } }

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

scrivener.cpp: In function 'char GetLetter(int)':
scrivener.cpp:61:1: warning: control reaches end of non-void function [-Wreturn-type]
   61 | }
      | ^
#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...