Submission #72938

# Submission time Handle Problem Language Result Execution time Memory
72938 2018-08-27T09:13:03 Z Navick Wiring (IOI17_wiring) C++17
13 / 100
43 ms 2144 KB
#include <bits/stdc++.h>
#include "wiring.h"

#define F first
#define S second
#define pii pair <int, int>
#define pb push_back

using namespace std;

typedef long long ll;

const int maxN = 210;
const ll oo = 1e16;

ll dp[maxN][maxN];

long long min_total_length(std::vector<int> r, std::vector<int> b) {
	int n = r.size(), m = b.size();
	
	ll ans = 0;
	for (int i=0; i<m; i++) ans += b[i];
	for (int i=0; i<n; i++) ans -= r[i];

	if(n > m)
		ans += (ll)b[0] * (n - m);
	else ans -= (ll)r[n - 1] * (m - n);

	return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 248 KB 3rd lines differ - on the 1st token, expected: '25859', found: '-4909'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 484 KB Output is correct
2 Correct 3 ms 492 KB Output is correct
3 Correct 33 ms 1540 KB Output is correct
4 Correct 35 ms 1636 KB Output is correct
5 Correct 30 ms 1636 KB Output is correct
6 Correct 39 ms 2100 KB Output is correct
7 Correct 43 ms 2100 KB Output is correct
8 Correct 36 ms 2144 KB Output is correct
9 Correct 39 ms 2144 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2144 KB Output is correct
2 Incorrect 2 ms 2144 KB 3rd lines differ - on the 1st token, expected: '17703', found: '-19052'
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2144 KB 3rd lines differ - on the 1st token, expected: '27', found: '12'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 248 KB 3rd lines differ - on the 1st token, expected: '25859', found: '-4909'
2 Halted 0 ms 0 KB -