답안 #879056

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
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;
}
# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1414 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1055 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1055 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 -
# 결과 실행 시간 메모리 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 -