Submission #701125

# Submission time Handle Problem Language Result Execution time Memory
701125 2023-02-20T06:54:01 Z minhcool Road Construction (JOI21_road_construction) C++17
5 / 100
3630 ms 2097152 KB
#include<bits/stdc++.h>
using namespace std;

#define int long long
#define fi first
#define se second
#define pb push_back
#define mp make_pair

typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<ii, ii> iiii;

const int N = 3e5 + 5;

const int oo = 1e18 + 7, mod = 1e9 + 7;

int n, k;
ii a[N];

priority_queue<int, vector<int>, greater<int>> pq;

void process(){
	cin >> n >> k;
	for(int i = 1; i <= n; i++) cin >> a[i].fi >> a[i].se;
	for(int i = 1; i <= n; i++){
		for(int j = i + 1; j <= n; j++){
			pq.push({abs(a[i].fi - a[j].fi) + abs(a[i].se - a[j].se)});
			//if(pq.size() > k) pq.pop();
		}
	}
	for(int i = 1; i <= k; i++){
		cout << pq.top() << "\n";
		pq.pop();
	}
}

signed main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	process();
}
# Verdict Execution time Memory Grader output
1 Correct 70 ms 7084 KB Output is correct
2 Correct 63 ms 6924 KB Output is correct
3 Correct 53 ms 5052 KB Output is correct
4 Correct 52 ms 5056 KB Output is correct
5 Correct 62 ms 5816 KB Output is correct
6 Correct 11 ms 4556 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 3630 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3566 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3566 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 70 ms 7084 KB Output is correct
2 Correct 63 ms 6924 KB Output is correct
3 Correct 53 ms 5052 KB Output is correct
4 Correct 52 ms 5056 KB Output is correct
5 Correct 62 ms 5816 KB Output is correct
6 Correct 11 ms 4556 KB Output is correct
7 Runtime error 3503 ms 2097152 KB Execution killed with signal 9
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 70 ms 7084 KB Output is correct
2 Correct 63 ms 6924 KB Output is correct
3 Correct 53 ms 5052 KB Output is correct
4 Correct 52 ms 5056 KB Output is correct
5 Correct 62 ms 5816 KB Output is correct
6 Correct 11 ms 4556 KB Output is correct
7 Runtime error 3630 ms 2097152 KB Execution killed with signal 9
8 Halted 0 ms 0 KB -