답안 #70220

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
70220 2018-08-22T13:37:36 Z E869120 고대 책들 (IOI17_books) C++14
0 / 100
3 ms 640 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 || i==p[i]) 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 2 ms 376 KB Output is correct
2 Correct 2 ms 488 KB Output is correct
3 Correct 2 ms 488 KB Output is correct
4 Correct 3 ms 488 KB Output is correct
5 Correct 3 ms 640 KB Output is correct
6 Incorrect 3 ms 640 KB 3rd lines differ - on the 1st token, expected: '8', found: '10'
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 488 KB Output is correct
3 Correct 2 ms 488 KB Output is correct
4 Correct 3 ms 488 KB Output is correct
5 Correct 3 ms 640 KB Output is correct
6 Incorrect 3 ms 640 KB 3rd lines differ - on the 1st token, expected: '8', found: '10'
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 488 KB Output is correct
3 Correct 2 ms 488 KB Output is correct
4 Correct 3 ms 488 KB Output is correct
5 Correct 3 ms 640 KB Output is correct
6 Incorrect 3 ms 640 KB 3rd lines differ - on the 1st token, expected: '8', found: '10'
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 640 KB 3rd lines differ - on the 1st token, expected: '3304', found: '4728'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 488 KB Output is correct
3 Correct 2 ms 488 KB Output is correct
4 Correct 3 ms 488 KB Output is correct
5 Correct 3 ms 640 KB Output is correct
6 Incorrect 3 ms 640 KB 3rd lines differ - on the 1st token, expected: '8', found: '10'
7 Halted 0 ms 0 KB -