제출 #1157684

#제출 시각아이디문제언어결과실행 시간메모리
1157684timoniRoad Construction (JOI21_road_construction)C++20
0 / 100
10107 ms363620 KiB
// made by Tima
// 2025 will be a golden year...
//BREAK YOUR LIMITS!!!!
#include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp>
#define ll long long
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define int long long
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
#define pii pair<int,int>
#define tpii pair <pair <int,int> , int>
using namespace std;
using namespace __gnu_pbds;
const int N = 3e5 + 5;
int mod = 1e9 + 7;
const int INF = 1e18;
int n,k,a[N],b[N];
void Gold(){
	cin >> n >> k;
	for(int i = 1 ; i <= n ; i++){
		cin >> a[i] >> b[i];
	}
	set <int> q;
	for(int i = 1 ; i <= n ; i++){
		for(int j = i + 1 ; j <= n ; j++){
			q.insert(abs(a[i] - a[j]) + abs(b[i] - b[j]));
		}
	}
	int cnt = 0;
	for(auto it : q){
		cnt++;
		cout << it << '\n';
		if(cnt == k){
			break;
		}
	}
}
signed main(/*Zhunussov Temirlan*/){
	//freopen("txt.in","r",stdin);freopen("txt.out","w",stdout);
	ios_base::sync_with_stdio(0);cin.tie(0);
	srand(time(0));
	int TT = 1;
	// cin >> TT;
	for(int i = 1 ; i <= TT ; i++){
		//cout << "Case " << i << ": ";
		Gold();
	}
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...