Submission #1036313

# Submission time Handle Problem Language Result Execution time Memory
1036313 2024-07-27T08:38:07 Z beaconmc Wiring (IOI17_wiring) C++14
13 / 100
23 ms 4188 KB
#include "wiring.h"
#include <bits/stdc++.h>

typedef long long ll;
#define FOR(i,x,y) for(ll i=x; i<y; i++)
#define FORNEG(i,x,y) for(ll i=x; i>y; i--)

using namespace std;

long long min_total_length(std::vector<int> r, std::vector<int> b) {
	sort(r.begin(), r.end());
	sort(b.begin(), b.end());

	while (r.size() > b.size()){
		b.push_back(b[0]);
	}
	while (r.size() < b.size()){
		r.push_back(r[r.size()-1]);
	}
	ll sumr=0,sumb=0;
	for(auto&i : r) sumr += i;
	for (auto&i : b) sumb += i;

	return sumb - sumr;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 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 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 14 ms 1804 KB Output is correct
4 Correct 14 ms 3480 KB Output is correct
5 Correct 13 ms 3572 KB Output is correct
6 Correct 18 ms 4156 KB Output is correct
7 Correct 18 ms 4188 KB Output is correct
8 Correct 23 ms 3928 KB Output is correct
9 Correct 20 ms 3668 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 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 0 ms 348 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 0 ms 344 KB 3rd lines differ - on the 1st token, expected: '25859', found: '-4909'
2 Halted 0 ms 0 KB -