# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
406708 |
2021-05-18T03:25:26 Z |
wiwiho |
Wiring (IOI17_wiring) |
C++14 |
|
31 ms |
1848 KB |
#include "wiring.h"
#include<bits/stdc++.h>
#define printv(a, b) { \
for(auto pv : a) b << pv << " "; \
b << "\n"; \
}
#define mp make_pair
#define F first
#define S second
#define iter(a) a.begin(), a.end()
#define lsort(a) sort(iter(a))
#define eb emplace_back
using namespace std;
typedef long long ll;
using pii = pair<int, int>;
const ll MAX = 1LL << 60;
ostream& operator<<(ostream& o, pii p){
return o << '(' << p.F << ',' << p.S << ')';
}
ll min_total_length(vector<int> r, vector<int> b) {
int n = r.size(), m = b.size();
assert(r.back() < b.front());
ll ans = 0;
if(n >= m){
for(int i : r) ans += b.front() - i;
for(int i : b) ans += i - b.front();
}
else{
for(int i : r) ans += r.back() - i;
for(int i : b) ans += i - r.back();
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
332 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
22 ms |
1404 KB |
Output is correct |
4 |
Correct |
22 ms |
1400 KB |
Output is correct |
5 |
Correct |
22 ms |
1356 KB |
Output is correct |
6 |
Correct |
29 ms |
1848 KB |
Output is correct |
7 |
Correct |
31 ms |
1732 KB |
Output is correct |
8 |
Correct |
30 ms |
1840 KB |
Output is correct |
9 |
Correct |
29 ms |
1840 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Runtime error |
1 ms |
332 KB |
Execution killed with signal 6 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
332 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
332 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |