Submission #115501

# Submission time Handle Problem Language Result Execution time Memory
115501 2019-06-08T00:32:59 Z E869120 Boxes with souvenirs (IOI15_boxes) C++14
0 / 100
2 ms 384 KB
#include "boxes.h"
#include <bits/stdc++.h>
using namespace std;

long long delivery(int N, int K, int L, int p[]) {
	long long minx = (1LL << 60);
	minx = min(minx, 2LL * (L - p[0]));
	minx = min(minx, 2LL * p[N - 1]);
	for (int i = 0; i < N - 1; i++) minx = min(minx, 2LL * (L - (p[i + 1] - p[i])));
	/*for (int i = -1; i < N; i++) {
		long long sum = 0;
		for (int j = i; j >= 0; j -= K) sum += 1LL * p[j];
		for (int j = i + 1; j < N; j += K) sum += 1LL * (L - p[j]);
		minx = min(minx, 2LL * sum);
	}*/
	return minx;
}

Compilation message

boxes.cpp: In function 'long long int delivery(int, int, int, int*)':
boxes.cpp:5:31: warning: unused parameter 'K' [-Wunused-parameter]
 long long delivery(int N, int K, int L, int p[]) {
                               ^
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Incorrect 2 ms 256 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Incorrect 2 ms 256 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Incorrect 2 ms 256 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Incorrect 2 ms 256 KB Output isn't correct
3 Halted 0 ms 0 KB -