| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 946260 | jakebrain88 | Snake (CEOI08_snake) | C++17 | 1 ms | 340 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "snakelib.h"
using namespace std; 
int main(){
	//const int hd=12122;
	int K=get_speed();
	char A1,A2;
	//int as=0,ae=hd-1,bs=1,be=hd,ls=1,le=hd; 
	int l=0,hl=0,r=12122,tr=12122,q=12,tm,hm;
	while(q--){
		tm=(l+tr)/2;hm=(hl+r)/2;
		ask_snake(tm,hm,&A1,&A2);
		if(A1=='s') l=tm,tr=tm+K;
		else{
			if(A1=='f')tr=tm+K-1;
			else l=tm+1;
		}
		if(A2=='s') hl=hm,r=hm+K;
		else{
			if(A2=='f')r=hm+K-1;
			else hl=hm+1;
		}
		if(A1=='s' && A2=='s'){
			tell_length(hm-tm+1);
			return 0;
		}
	}	
	tell_length(hl-l+(r-hl - tr+l) / 2);
	return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
