# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
81188 |
2018-10-24T04:00:40 Z |
GoodTrung |
Wiring (IOI17_wiring) |
C++14 |
|
46 ms |
2140 KB |
#include <bits/stdc++.h>
#define fi first
#define se second
#define NAME "wiring"
using namespace std;
typedef long long LL;
typedef pair <int, int> pii;
typedef double DB;
typedef pair <LL, LL> pLL;
const int NMAX = 1e6+7;
int n, m;
LL min_total_length(vector <int> r, vector <int> b) {
LL res = 0;
n = r.size();
m = b.size();
if(r[n-1] < b[0]) {
for(int i = 0; i < n; ++i)
res -= r[i];
for(int i = 0; i < m; ++i)
res += b[i];
res += LL(max(n - m, 0)) * b[0];
res -= LL(max(m - n, 0)) * r[n-1];
return res;
}
return -1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
3rd lines differ - on the 1st token, expected: '25859', found: '-1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
508 KB |
Output is correct |
2 |
Correct |
2 ms |
508 KB |
Output is correct |
3 |
Correct |
27 ms |
1656 KB |
Output is correct |
4 |
Correct |
27 ms |
1656 KB |
Output is correct |
5 |
Correct |
45 ms |
1656 KB |
Output is correct |
6 |
Correct |
38 ms |
2072 KB |
Output is correct |
7 |
Correct |
41 ms |
2088 KB |
Output is correct |
8 |
Correct |
46 ms |
2088 KB |
Output is correct |
9 |
Correct |
38 ms |
2140 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
2140 KB |
Output is correct |
2 |
Incorrect |
2 ms |
2140 KB |
3rd lines differ - on the 1st token, expected: '17703', found: '-1' |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
2140 KB |
3rd lines differ - on the 1st token, expected: '27', found: '-1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
3rd lines differ - on the 1st token, expected: '25859', found: '-1' |
2 |
Halted |
0 ms |
0 KB |
- |