Submission #520852

# Submission time Handle Problem Language Result Execution time Memory
520852 2022-01-31T07:52:25 Z danikoynov Road Construction (JOI21_road_construction) C++14
0 / 100
67 ms 5040 KB
/**
 ____ ____ ____ ____ ____ ____
||l |||e |||i |||n |||a |||d ||
||__|||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|/__\|

**/

#include<bits/stdc++.h>
#define endl '\n'

using namespace std;
typedef long long ll;

void speed()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
const int maxn = 1010;

int n, k, x[maxn], y[maxn];
void solve()
{
    cin >> n >> k;
    for (int i = 1; i <= n; i ++)
        cin >> x[i] >> y[i];

    if (n <= 1000)
    {
        vector < int > v;
        for (int i = 1; i <= n; i ++)
            for (int 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 (int i = 0; i < k; i ++)
            cout << v[i] << endl;
    }

}

int main()
{
    solve();
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 67 ms 5040 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 432 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 460 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 460 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 67 ms 5040 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 67 ms 5040 KB Output isn't correct
2 Halted 0 ms 0 KB -