제출 #1157824

#제출 시각아이디문제언어결과실행 시간메모리
1157824arkanefuryRoad Construction (JOI21_road_construction)C++20
5 / 100
6476 ms344960 KiB
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define in insert
#define lb lower_bound
#define F first
#define S second
#define sz size()
#define int long long
#define all(v) v.begin(),v.end()
#define FOR1(x, n) for(int j = x; j <= n; j ++)
#define FOR(x, n, m, d) for(int x = n; x <= m; x += d)
#define FORR(x, n, m, d) for(int x = n; x >= m; x -= d)
#define nikita ios_base::sync_with_stdio(0), cin.tie(0);
const int N =  2e5+5;
int n,m,k,sum=0,x,y, ans, r, cnt, l, mod = 1e9+7, dp[N], a[N], b[N];
string s, str;
void solve(){
    cin >> n >> m;
    multiset<int>st;
    FOR(i, 1, n, 1)cin >> a[i] >> b[i];
    FOR(i, 1, n, 1){
        FOR(j, i+1, n, 1)st.in(abs(a[i] - a[j])+ abs(b[i] - b[j]));
        if(st.sz > 7e6)break;
    }
    for(auto i : st){
        cout <<  i << '\n';
        m--;
        if(!m)break;
    }
}
signed main(){
    nikita
    int tt = 1;
    if(!tt)cin >> tt;
    FOR(i, 1, tt, 1)solve();
}
#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...