Submission #879056

# Submission time Handle Problem Language Result Execution time Memory
879056 2023-11-26T08:11:36 Z willychan Road Construction (JOI21_road_construction) C++17
5 / 100
1414 ms 2097152 KB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include<bits/extc++.h>
//__gnu_pbds




int main(){
	ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	int n;cin>>n;
	int k;cin>>k;
	pair<ll,ll> arr[n];
	for(int i=0;i<n;i++) cin>>arr[i].first>>arr[i].second;
	vector<ll> ans;
	for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++){
			ans.push_back(abs(arr[i].first-arr[j].first)+abs(arr[i].second-arr[j].second));
		}
	}
	sort(ans.begin(),ans.end());
	for(int i=0;i<k;i++) cout<<ans[i]<<"\n";

	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 52 ms 7044 KB Output is correct
2 Correct 55 ms 7104 KB Output is correct
3 Correct 33 ms 5004 KB Output is correct
4 Correct 46 ms 5128 KB Output is correct
5 Correct 49 ms 6356 KB Output is correct
6 Correct 23 ms 5844 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 1414 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1055 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1055 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 52 ms 7044 KB Output is correct
2 Correct 55 ms 7104 KB Output is correct
3 Correct 33 ms 5004 KB Output is correct
4 Correct 46 ms 5128 KB Output is correct
5 Correct 49 ms 6356 KB Output is correct
6 Correct 23 ms 5844 KB Output is correct
7 Runtime error 1065 ms 2097152 KB Execution killed with signal 9
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 52 ms 7044 KB Output is correct
2 Correct 55 ms 7104 KB Output is correct
3 Correct 33 ms 5004 KB Output is correct
4 Correct 46 ms 5128 KB Output is correct
5 Correct 49 ms 6356 KB Output is correct
6 Correct 23 ms 5844 KB Output is correct
7 Runtime error 1414 ms 2097152 KB Execution killed with signal 9
8 Halted 0 ms 0 KB -