답안 #611882

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
611882 2022-07-29T08:18:19 Z Shithila 고대 책들 (IOI17_books) C++14
0 / 100
1 ms 340 KB
#include "books.h"
long long minimum_walk(std::vector<int> p, int s) {
	int len=p.size();
	int correct=true;
	int count=0;
	for(int i=len-1;i>0;i--)
	{
		if(p[i]!=i)
		{
			correct=false;
			break;
		}
		count++;
	}
	if(correct==true) return 0;
	else if(count==0 && len>3)
	{
		correct=true;
		for(int i=len-1;i>1;i--)
	{
		if(p[i]!=len-i-1)
		{
			correct=false;
			break;
		}
	}
	if(correct==false)
	{
		int ans=len-count-1;
		ans=ans+ans;
		return ans;
	}
	else return 2*len;
	}
	else
	{
		int ans=len-count-1;
		ans=ans+ans;
		return ans;
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 1 ms 340 KB 3rd lines differ - on the 1st token, expected: '8', found: '6'
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 1 ms 340 KB 3rd lines differ - on the 1st token, expected: '8', found: '6'
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 1 ms 340 KB 3rd lines differ - on the 1st token, expected: '8', found: '6'
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB 3rd lines differ - on the 1st token, expected: '3304', found: '1998'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 1 ms 340 KB 3rd lines differ - on the 1st token, expected: '8', found: '6'
4 Halted 0 ms 0 KB -