Submission #660943

# Submission time Handle Problem Language Result Execution time Memory
660943 2022-11-23T16:23:03 Z urosk Wiring (IOI17_wiring) C++14
13 / 100
23 ms 5324 KB
#include "wiring.h"
#include <bits/stdc++.h>
#define ll long long
#define sz(a) (ll)(a.size())
#define pb push_back
#define popb pop_back
#define all(a) a.begin(),a.end()
#define here cerr<<"===================================\n"
#define endl '\n'
#define ceri(a,l,r) {for(ll i_ = l;i_<=r;i_++) cerr<<a[i_]<< " ";cerr<<endl;}
using namespace std;
#define maxn 100005
ll n,m,ans;
ll a[maxn],c[maxn];
long long min_total_length(vector<int> r, vector<int> b) {
    for(ll x : r) a[++n] = x;
    for(ll x : b) c[++m] = x;
    if(a[n]<c[1]){
        reverse(all(r));
        while(sz(r)>1&&sz(b)>1){
            ans+=abs(r.back()-b.back());
            r.popb(); b.popb();
        }
        if(sz(r)<sz(b)) swap(r,b);
        for(ll x : r) ans+=abs(x-b[0]);
        return ans;
    }
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB 3rd lines differ - on the 1st token, expected: '25859', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 17 ms 4024 KB Output is correct
4 Correct 21 ms 4068 KB Output is correct
5 Correct 17 ms 4044 KB Output is correct
6 Correct 23 ms 5324 KB Output is correct
7 Correct 22 ms 5300 KB Output is correct
8 Correct 23 ms 5288 KB Output is correct
9 Correct 21 ms 5300 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB 3rd lines differ - on the 1st token, expected: '17703', found: '0'
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 308 KB 3rd lines differ - on the 1st token, expected: '27', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB 3rd lines differ - on the 1st token, expected: '25859', found: '0'
2 Halted 0 ms 0 KB -