Submission #1081936

# Submission time Handle Problem Language Result Execution time Memory
1081936 2024-08-30T13:02:04 Z ALeonidou Fountain Parks (IOI21_parks) C++17
0 / 100
1 ms 348 KB
#include "parks.h"
#include <bits/stdc++.h>
using namespace std;

#define ll int
#define F first
#define S second
#define pb push_back
#define sz(x) (ll)x.size()

typedef vector <ll> vi;
typedef pair <ll,ll> ii;
typedef vector <ii> vii;

#define dbg(x) cout<<#x<<": "<<x<<endl;
#define dbg2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<endl;
#define dbg3(x,y,z) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<" "<<#z<<": "<<z<<endl;

void printVct(vi &v){
    for (ll i =0; i<sz(v); i++){
        cout<<v[i]<<" ";
    }
    cout<<endl;
}

int construct_roads(vi x, vi y) {
    ll n = sz(x);
    sort(y.begin(), y.end());
    vi u,v,a,b;
    for (ll i= 0; i<n-1; i++){
        if (y[i] != y[i+1] - 2){
            return 0;
        }
        u.pb(y[i]);
        v.pb(y[i+1]);
        a.pb(1);
        b.pb(y[i]+1);
    }
    build(u, v, a, b);
    return 1;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Integer parameter [name=u[j]] equals to 2, violates the range [0, 1]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Integer parameter [name=u[j]] equals to 2, violates the range [0, 1]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Integer parameter [name=u[j]] equals to 2, violates the range [0, 1]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Integer parameter [name=u[j]] equals to 2, violates the range [0, 1]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Integer parameter [name=u[j]] equals to 2, violates the range [0, 1]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Integer parameter [name=u[j]] equals to 2, violates the range [0, 1]
3 Halted 0 ms 0 KB -