Submission #682233

# Submission time Handle Problem Language Result Execution time Memory
682233 2023-01-16T04:57:18 Z vjudge1 Road Construction (JOI21_road_construction) C++17
5 / 100
1507 ms 2097152 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll n,k;
    cin >> n >> k;
    ll x[n+2];
    ll y[n+2];
    vector <ll> v;
    for(ll i=0;i<n;i++){
        cin >> x[i] >> y[i];
    }
    for(ll i=0;i<n;i++){
        for(ll j=i+1;j<n;j++){
            v.push_back(abs(x[i]-x[j])+abs(y[i]-y[j]));
        }
    }
    sort(v.begin(),v.end());
    for(ll i=0;i<k;i++){
        cout << v[i] << "\n";
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 58 ms 6968 KB Output is correct
2 Correct 61 ms 6944 KB Output is correct
3 Correct 39 ms 5024 KB Output is correct
4 Correct 46 ms 5056 KB Output is correct
5 Correct 56 ms 5804 KB Output is correct
6 Correct 21 ms 4556 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 1507 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1479 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1479 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 58 ms 6968 KB Output is correct
2 Correct 61 ms 6944 KB Output is correct
3 Correct 39 ms 5024 KB Output is correct
4 Correct 46 ms 5056 KB Output is correct
5 Correct 56 ms 5804 KB Output is correct
6 Correct 21 ms 4556 KB Output is correct
7 Runtime error 1422 ms 2097152 KB Execution killed with signal 9
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 58 ms 6968 KB Output is correct
2 Correct 61 ms 6944 KB Output is correct
3 Correct 39 ms 5024 KB Output is correct
4 Correct 46 ms 5056 KB Output is correct
5 Correct 56 ms 5804 KB Output is correct
6 Correct 21 ms 4556 KB Output is correct
7 Runtime error 1507 ms 2097152 KB Execution killed with signal 9
8 Halted 0 ms 0 KB -