답안 #793523

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
793523 2023-07-25T23:33:04 Z fuad27 Road Construction (JOI21_road_construction) C++17
5 / 100
5323 ms 2097152 KB
#include<bits/stdc++.h>
// #pragma GCC optimize("O3,unroll-loops")
// #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
void solve() {
  int n, k;
  cin >> n >> k;
  int x[n], y[n];
  priority_queue<unsigned int, vector<unsigned int>, greater<unsigned int>> pq;
  for(int i = 0;i<n;i++) {
    cin >> x[i] >> y[i];

  }
  for(int i = 0;i<n;i++)
    for(int j = i+1;j<n;j++)pq.push((unsigned int)abs(x[i]-x[j])+abs(y[i]-y[j]));
  while(k--) {
    cout << pq.top() << "\n";
    pq.pop();
  }
}
int main () {
  cin.tie(0)->sync_with_stdio(0);
  int t=1;
  while(t--)solve();
  return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 59 ms 4908 KB Output is correct
2 Correct 61 ms 4916 KB Output is correct
3 Correct 51 ms 4084 KB Output is correct
4 Correct 50 ms 4080 KB Output is correct
5 Correct 54 ms 3776 KB Output is correct
6 Correct 9 ms 2500 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 5323 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 5041 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 5041 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 59 ms 4908 KB Output is correct
2 Correct 61 ms 4916 KB Output is correct
3 Correct 51 ms 4084 KB Output is correct
4 Correct 50 ms 4080 KB Output is correct
5 Correct 54 ms 3776 KB Output is correct
6 Correct 9 ms 2500 KB Output is correct
7 Runtime error 5015 ms 2097152 KB Execution killed with signal 9
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 59 ms 4908 KB Output is correct
2 Correct 61 ms 4916 KB Output is correct
3 Correct 51 ms 4084 KB Output is correct
4 Correct 50 ms 4080 KB Output is correct
5 Correct 54 ms 3776 KB Output is correct
6 Correct 9 ms 2500 KB Output is correct
7 Runtime error 5323 ms 2097152 KB Execution killed with signal 9
8 Halted 0 ms 0 KB -