Submission #893426

# Submission time Handle Problem Language Result Execution time Memory
893426 2023-12-27T04:45:57 Z abushbandit_1 Road Construction (JOI21_road_construction) C++17
5 / 100
776 ms 2097152 KB
#include <bits/stdc++.h>

using namespace std;

#define int long long
#define pb push_back
#define all(x) x.begin(),x.end()
#define ff first
#define ss second

const long long INF = 1e18;
const int N = 1e5 + 1;

signed main(){
	
	int n;
	cin >> n;
	int k;
	cin >> k;
	int cnt = 0;
	int x[n],y[n];
	for(int i = 0;i < n;i++){
		cin >> x[i] >> y[i];
		if(y[i] == 0){
			cnt++;
		}
	}
	vector<int> v;
	for(int i = 0;i < n;i++){
		for(int j = i + 1;j < n;j++){
			v.pb(abs(x[i] - x[j]) + abs(y[i] - y[j]));
		}
	}
	sort(all(v));
	for(int i = 0;i < k;i++){
		cout << v[i] << "\n";
	}
		
}
# Verdict Execution time Memory Grader output
1 Correct 57 ms 7044 KB Output is correct
2 Correct 53 ms 7028 KB Output is correct
3 Correct 35 ms 5056 KB Output is correct
4 Correct 34 ms 5060 KB Output is correct
5 Correct 51 ms 5760 KB Output is correct
6 Correct 17 ms 4812 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 775 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 776 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 776 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 57 ms 7044 KB Output is correct
2 Correct 53 ms 7028 KB Output is correct
3 Correct 35 ms 5056 KB Output is correct
4 Correct 34 ms 5060 KB Output is correct
5 Correct 51 ms 5760 KB Output is correct
6 Correct 17 ms 4812 KB Output is correct
7 Runtime error 708 ms 2097152 KB Execution killed with signal 9
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 57 ms 7044 KB Output is correct
2 Correct 53 ms 7028 KB Output is correct
3 Correct 35 ms 5056 KB Output is correct
4 Correct 34 ms 5060 KB Output is correct
5 Correct 51 ms 5760 KB Output is correct
6 Correct 17 ms 4812 KB Output is correct
7 Runtime error 775 ms 2097152 KB Execution killed with signal 9
8 Halted 0 ms 0 KB -