# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
406707 |
2021-05-18T03:24:27 Z |
wiwiho |
Wiring (IOI17_wiring) |
C++14 |
|
29 ms |
1868 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();
}
if(m >= n){
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 |
1348 KB |
Output is correct |
4 |
Correct |
24 ms |
1476 KB |
Output is correct |
5 |
Correct |
23 ms |
1400 KB |
Output is correct |
6 |
Correct |
28 ms |
1844 KB |
Output is correct |
7 |
Correct |
29 ms |
1852 KB |
Output is correct |
8 |
Incorrect |
28 ms |
1868 KB |
3rd lines differ - on the 1st token, expected: '50045158751955', found: '100090317503910' |
9 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
3rd lines differ - on the 1st token, expected: '316', found: '632' |
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 |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
332 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |