Submission #992339

#TimeUsernameProblemLanguageResultExecution timeMemory
992339Kalata_56Road Construction (JOI21_road_construction)C++14
27 / 100
510 ms43064 KiB
#include<bits/stdc++.h> using namespace std; pair<long long,long long> kor[250001]; vector<long long> kol; int main(){ long long N,K; cin>>N>>K; for(long long i=0;i<N;i++){ cin>>kor[i].first>>kor[i].second; } sort(kor,kor+N); for(int k=1;k<N;k++){ for(long long i=k;i<N;i++){ long long raz=abs(kor[i].first-kor[i-k].first)+abs(kor[i].second-kor[i-k].second); kol.push_back(raz); } if(kol.size()>=K && k>=10){ break; } } sort(kol.begin(),kol.end()); for(long long i=0;i<K;i++){ cout<<kol[i]<<endl; } return 0; }

Compilation message (stderr)

road_construction.cpp: In function 'int main()':
road_construction.cpp:17:22: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   17 |         if(kol.size()>=K && k>=10){
      |            ~~~~~~~~~~^~~
#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...