답안 #70218

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
70218 2018-08-22T13:36:12 Z E869120 고대 책들 (IOI17_books) C++14
0 / 100
3 ms 392 KB
#include "books.h"
#include <bits/stdc++.h>

int n;bool used[1009];

long long minimum_walk(std::vector<int> p, int s) {
	n=p.size();
	int sum=0,L=0;
	for(int i=0;i<n;i++){
		if(used[i]==true) continue;
		int cx=i;L=i;
		while(true){
			sum+=abs(cx-p[cx]);used[cx]=true;
			cx=p[cx];if(cx==i) break;
		}
	}
	return sum+L*2;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 248 KB Output is correct
2 Incorrect 2 ms 360 KB 3rd lines differ - on the 1st token, expected: '6', found: '8'
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 248 KB Output is correct
2 Incorrect 2 ms 360 KB 3rd lines differ - on the 1st token, expected: '6', found: '8'
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 248 KB Output is correct
2 Incorrect 2 ms 360 KB 3rd lines differ - on the 1st token, expected: '6', found: '8'
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 392 KB 3rd lines differ - on the 1st token, expected: '3304', found: '4736'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 248 KB Output is correct
2 Incorrect 2 ms 360 KB 3rd lines differ - on the 1st token, expected: '6', found: '8'
3 Halted 0 ms 0 KB -