# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
966571 |
2024-04-20T04:35:37 Z |
Amr |
Wiring (IOI17_wiring) |
C++17 |
|
20 ms |
3932 KB |
#include "wiring.h"
#include<bits/stdc++.h>
using namespace std;
#define sz size()
typedef long long ll;
#define all(x) (x).begin(),(x).end()
long long min_total_length(std::vector<int> r, std::vector<int> b) {
ll n = r.sz, m = b.sz;
sort(all(r)); reverse(all(r)); sort(all(b));
ll l1 = 0, l2 = 0;
ll ans = 0;
while(l1<n&&l2<m)
{
ans+=b[l2]-r[l1];
l1++,l2++;
}
if(l1<n)
{
for(int i = l1 ; i < n; i++)
{
ans+= b[0]-r[i];
}
}
else
{
for(int i = l2; i < m; i++)
ans+=b[i]-r[0];
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 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 |
348 KB |
Output is correct |
3 |
Correct |
15 ms |
1548 KB |
Output is correct |
4 |
Correct |
14 ms |
1372 KB |
Output is correct |
5 |
Correct |
14 ms |
1620 KB |
Output is correct |
6 |
Correct |
19 ms |
3920 KB |
Output is correct |
7 |
Correct |
19 ms |
3932 KB |
Output is correct |
8 |
Correct |
20 ms |
3664 KB |
Output is correct |
9 |
Correct |
20 ms |
3928 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
344 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 |
348 KB |
3rd lines differ - on the 1st token, expected: '25859', found: '-4909' |
2 |
Halted |
0 ms |
0 KB |
- |