답안 #797010

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
797010 2023-07-29T04:13:16 Z vjudge1 Road Construction (JOI21_road_construction) C++14
5 / 100
52 ms 9188 KB
#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
using namespace std ;
int main()
{
    ios_base::sync_with_stdio( 0 ) ;
    cin.tie( 0 ) ;
    cout.tie( 0 ) ;
    ll n, k ;
    cin >> n >> k ;
    pair<ll, ll> p[n + 1] ;
    vector<ll> v ;
    for(ll i = 1 ; i <= n ; i++)
        cin >> p[i].fi >> p[i].se ;
    if(n <= 1000)
    {
        for(ll i = 1 ; i <= n ; i++)
            for(ll j = i + 1 ; j <= n ; j++)
                v.push_back(abs(p[i].fi - p[j].fi) + abs(p[i].se - p[j].se)) ;
        sort(v.begin(), v.end()) ;
        for(ll i = 0 ; i < k ; i++)
            cout << v[i] << '\n' ;
        return 0 ;
    }
    return 0 ;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 51 ms 6956 KB Output is correct
2 Correct 52 ms 6968 KB Output is correct
3 Correct 32 ms 5016 KB Output is correct
4 Correct 32 ms 5068 KB Output is correct
5 Correct 49 ms 5800 KB Output is correct
6 Correct 17 ms 4556 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 38 ms 7116 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 43 ms 9188 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 43 ms 9188 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 51 ms 6956 KB Output is correct
2 Correct 52 ms 6968 KB Output is correct
3 Correct 32 ms 5016 KB Output is correct
4 Correct 32 ms 5068 KB Output is correct
5 Correct 49 ms 5800 KB Output is correct
6 Correct 17 ms 4556 KB Output is correct
7 Incorrect 18 ms 3776 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 51 ms 6956 KB Output is correct
2 Correct 52 ms 6968 KB Output is correct
3 Correct 32 ms 5016 KB Output is correct
4 Correct 32 ms 5068 KB Output is correct
5 Correct 49 ms 5800 KB Output is correct
6 Correct 17 ms 4556 KB Output is correct
7 Incorrect 38 ms 7116 KB Output isn't correct
8 Halted 0 ms 0 KB -