Submission #992275

# Submission time Handle Problem Language Result Execution time Memory
992275 2024-06-04T08:09:11 Z Kalata_56 Road Construction (JOI21_road_construction) C++14
7 / 100
376 ms 12580 KB
#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){
            break;
        }
    }
    sort(kol.begin(),kol.end());
    for(long long i=0;i<K;i++){
        cout<<kol[i]<<endl;
    }
    return 0;
}

Compilation message

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){
      |            ~~~~~~~~~~^~~
# Verdict Execution time Memory Grader output
1 Incorrect 289 ms 5056 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 376 ms 12580 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 159 ms 11464 KB Output is correct
2 Correct 166 ms 11460 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 107 ms 9416 KB Output is correct
5 Correct 159 ms 11716 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 159 ms 11464 KB Output is correct
2 Correct 166 ms 11460 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 107 ms 9416 KB Output is correct
5 Correct 159 ms 11716 KB Output is correct
6 Incorrect 169 ms 11456 KB Output isn't correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 289 ms 5056 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 289 ms 5056 KB Output isn't correct
2 Halted 0 ms 0 KB -