답안 #289229

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
289229 2020-09-02T13:25:50 Z wdjpng 고대 책들 (IOI17_books) C++17
0 / 100
1 ms 256 KB
#include <bits/stdc++.h>
#include "books.h"

#define rep(i,n) for(int i = 0; i < n; i++)
#define lint long long
using namespace std;
vector<int>P;
vector<bool>vis;
int dfs(int v)
{
	if(vis[v]) return 0;
	vis[v]=true;
	return abs(v - P[v]) + dfs(P[v]);
}

long long minimum_walk(std::vector<int> p, int s) {
	return 6;
	int n = p.size();
	while (n<4)
	{
		s++;
	}
	return 6;
	vis.resize(n);
	P=p;
	int count=0;
	int numComp=0;
	rep(i, n)
	{
		if(vis[i]){continue;}
		numComp++;
		count+=dfs(i);
	}

	return count+2*(numComp-1);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Incorrect 0 ms 256 KB 3rd lines differ - on the 1st token, expected: '8', found: '6'
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Incorrect 0 ms 256 KB 3rd lines differ - on the 1st token, expected: '8', found: '6'
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Incorrect 0 ms 256 KB 3rd lines differ - on the 1st token, expected: '8', found: '6'
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 256 KB 3rd lines differ - on the 1st token, expected: '3304', found: '6'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Incorrect 0 ms 256 KB 3rd lines differ - on the 1st token, expected: '8', found: '6'
4 Halted 0 ms 0 KB -