Submission #1061312

# Submission time Handle Problem Language Result Execution time Memory
1061312 2024-08-16T07:59:22 Z fv3 Ancient Books (IOI17_books) C++14
0 / 100
1 ms 348 KB
#include "books.h"
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

ll minimum_walk(vector<int> P, int S) 
{
	const int N = P.size();	

	ll res = 0;
	for (int i = 0; i < N; i++)
	{
		res += abs(P[i] - i);
	}
	int sort_length = 0;
	while (sort_length < N && P[sort_length] == sort_length)
		sort_length++;

	if (sort_length < N)
		res += sort_length;

	return res;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB 3rd lines differ - on the 1st token, expected: '6', found: '5'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB 3rd lines differ - on the 1st token, expected: '6', found: '5'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB 3rd lines differ - on the 1st token, expected: '6', found: '5'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB 3rd lines differ - on the 1st token, expected: '3304', found: '2744'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB 3rd lines differ - on the 1st token, expected: '6', found: '5'
2 Halted 0 ms 0 KB -