제출 #1079436

#제출 시각아이디문제언어결과실행 시간메모리
1079436Trumling크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++14
26 / 100
105 ms22956 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define F first #define S second #define enter cout<<'\n'; #define INF 99999999999999999 #define MOD 1000000007 #define all(x) x.begin(),x.end() string s; bool tf=0; vector<pair<ll,char>>v; void Init() { } void TypeLetter(char L) { v.pb({v.size()-1,L}); } void UndoCommands(int U) { v.pb({v.size()-U-1,'?'}); } char GetLetter(int P) { if(!tf) { ll idx=v.size()-1; while(idx!=-1) { if(v[idx].S!='?') s+=v[idx].S; idx=v[idx].F; } for(int i=0;i<s.size()/2;i++) swap(s[i],s[s.size()-1-i]); tf=1; } assert(P<s.size()); return s[P]; }

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

scrivener.cpp: In function 'char GetLetter(int)':
scrivener.cpp:43:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   43 |     for(int i=0;i<s.size()/2;i++)
      |                 ~^~~~~~~~~~~
In file included from /usr/include/c++/10/cassert:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:33,
                 from scrivener.cpp:1:
scrivener.cpp:47:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   47 |   assert(P<s.size());
      |          ~^~~~~~~~~
#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...