제출 #115570

#제출 시각아이디문제언어결과실행 시간메모리
115570faustaadp크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> typedef long long ll; #define pb push_back #define mp make_pair #define fi first #define se second using namespace std; char last; char hai[1010101]; pair<ll,ll> A[1010101]; ll te,pre[1010101]; void cek() { ll ii; for(ii=0;ii<te;ii++) cout<<ii<<" "<<char(A[ii].fi)<<" "<<A[ii].se<<"\n"; cout<<"\n"; } void Init() {} void TypeLetter(char L) { ll bes=0; if(te>0) bes=A[te-1].se+1; A[te]=mp(L,bes); hai[bes]=L; pre[te]=te-1; te++; // cek(); } void UndoCommands(int U) { A[te]=A[te-U-1]; pre[te]=pre[te-U-1]; te++; // cek(); } char GetLetter(int P) { ll ii; for(ii=te-1;ii=pre[ii]) if(A[ii].se==P) return char(A[ii].fi); // return hai[P]; }

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

scrivener.cpp: In function 'char GetLetter(int)':
scrivener.cpp:44:16: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  for(ii=te-1;ii=pre[ii])
              ~~^~~~~~~~
scrivener.cpp:44:24: error: expected ';' before ')' token
  for(ii=te-1;ii=pre[ii])
                        ^
scrivener.cpp:48:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^