Submission #520853

# Submission time Handle Problem Language Result Execution time Memory
520853 2022-01-31T07:53:40 Z danikoynov Road Construction (JOI21_road_construction) C++14
5 / 100
71 ms 6916 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;
ll 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 < ll > 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 Correct 71 ms 6904 KB Output is correct
2 Correct 63 ms 6916 KB Output is correct
3 Correct 41 ms 4996 KB Output is correct
4 Correct 44 ms 5060 KB Output is correct
5 Correct 61 ms 5796 KB Output is correct
6 Correct 25 ms 4640 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 71 ms 6904 KB Output is correct
2 Correct 63 ms 6916 KB Output is correct
3 Correct 41 ms 4996 KB Output is correct
4 Correct 44 ms 5060 KB Output is correct
5 Correct 61 ms 5796 KB Output is correct
6 Correct 25 ms 4640 KB Output is correct
7 Incorrect 1 ms 312 KB Output isn't correct
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 71 ms 6904 KB Output is correct
2 Correct 63 ms 6916 KB Output is correct
3 Correct 41 ms 4996 KB Output is correct
4 Correct 44 ms 5060 KB Output is correct
5 Correct 61 ms 5796 KB Output is correct
6 Correct 25 ms 4640 KB Output is correct
7 Incorrect 1 ms 204 KB Output isn't correct
8 Halted 0 ms 0 KB -