Submission #415419

# Submission time Handle Problem Language Result Execution time Memory
415419 2021-06-01T05:20:04 Z 조영욱(#7635) Road Construction (JOI21_road_construction) C++17
0 / 100
3168 ms 2097156 KB
#include <bits/stdc++.h>
using namespace std;

typedef pair<int,int> P;
P arr[250000];

int main(void) {
    int n,k;
    scanf("%d %d",&n,&k);
    for(int i=0;i<n;i++) {
        scanf("%d %d",&arr[i].first,&arr[i].second);
    }
    vector<int> ret;
    for(int i=0;i<n;i++) {
        for(int j=i+1;j<n;j++) {
            ret.push_back(abs(arr[i].first-arr[j].first)+abs(arr[i].second-arr[j].second));
        }
    }
    sort(ret.begin(),ret.end());
    for(int i=0;i<k;i++) {
        printf("%d\n",ret[i]);
    }
}

Compilation message

road_construction.cpp: In function 'int main()':
road_construction.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |     scanf("%d %d",&n,&k);
      |     ~~~~~^~~~~~~~~~~~~~~
road_construction.cpp:11:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |         scanf("%d %d",&arr[i].first,&arr[i].second);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 98 ms 4968 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3168 ms 2097156 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2496 ms 2097156 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2496 ms 2097156 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 98 ms 4968 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 98 ms 4968 KB Output isn't correct
2 Halted 0 ms 0 KB -