제출 #944929

#제출 시각아이디문제언어결과실행 시간메모리
944929XiaoyangRoad Construction (JOI21_road_construction)C++17
5 / 100
56 ms7100 KiB
#include <bits/stdc++.h> using namespace std; #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") typedef long long ll; #define fi first #define se second #define pll pair<ll,ll> #define pb push_back #define debug(x) cerr<<#x<<"="<<x<<endl; #define MP make_pair #define rep(i,a,b) for(ll i=a;i<b;i++) #define SZ(x) (ll)x.size() #define ALL(x) x.begin(),x.end() #define endl "\n" const ll inf=1e18; ll lowbit(ll x){return x&(-x);} const ll maxn=1111; ll x[maxn],y[maxn]; int main(){ ios::sync_with_stdio(0); cin.tie(0); ll n,k;cin>>n>>k; rep(i,1,n+1)cin>>x[i]>>y[i]; vector<ll>costs; rep(i,1,n+1){ rep(j,i+1,n+1){ costs.pb(abs(x[i]-x[j])+abs(y[i]-y[j])); } } sort(ALL(costs)); rep(i,0,k)cout<<costs[i]<<endl; return 0; }
#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...