제출 #115569

#제출 시각아이디문제언어결과실행 시간메모리
115569faustaadpCrayfish scrivener (IOI12_scrivener)C++17
12 / 100
1071 ms15100 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;
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;
	te++;
//	cek();
}

void UndoCommands(int U) 
{
	A[te]=A[te-U-1];
	te++;
//	cek();
}

char GetLetter(int P) 
{
	ll ii;
	for(ii=te-1;ii>=0;ii--)
		if(A[ii].se==P)
			return char(A[ii].fi);
//	return hai[P];
}

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

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