Submission #1036311

# Submission time Handle Problem Language Result Execution time Memory
1036311 2024-07-27T08:37:40 Z beaconmc Wiring (IOI17_wiring) C++14
0 / 100
14 ms 3124 KB
#include "wiring.h"
#include <bits/stdc++.h>

typedef int 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 1 ms 348 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 420 KB Output is correct
3 Incorrect 14 ms 3124 KB 3rd lines differ - on the 1st token, expected: '41596985758595', found: '227496835'
4 Halted 0 ms 0 KB -
# 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 1 ms 348 KB 3rd lines differ - on the 1st token, expected: '25859', found: '-4909'
2 Halted 0 ms 0 KB -