답안 #592140

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
592140 2022-07-08T16:17:49 Z jasmin Roads (CEOI20_roads) C++14
15 / 100
20 ms 2264 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long

const int inf=1e18;

void subtask2(int n, vector<pair<pair<int,int>, pair<int,int> > >& p){
    sort(p.begin(), p.end());
    pair<int,int> last={-inf, -inf};
    for(int i=0; i<n; i++){
        auto a=p[i].first;
        auto b=p[i].second;

        if(last.first!=-inf){
            cout << last.first << " " << last.second << " " << a.first << " " << a.second << "\n";
        }
        last=b;
    }
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n;
    cin >> n;
    vector<pair<pair<int,int>, pair<int,int> > >p(n);
    for(int i=0; i<n; i++){
        cin >> p[i].first.first >> p[i].first.second;
        cin >> p[i].second.first >> p[i].second.second;
        if(p[i].first>p[i].second){
            swap(p[i].first, p[i].second);
        }
    }
    subtask2(n, p);
}
# 결과 실행 시간 메모리 Grader output
1 Failed 0 ms 212 KB Condition failed: "!Cross(S[*pi], S[*pa])"
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 324 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 8 ms 1236 KB Output is correct
5 Correct 14 ms 2264 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 392 KB Output is correct
4 Correct 9 ms 1204 KB Output is correct
5 Correct 15 ms 2068 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Failed 1 ms 328 KB Condition failed: "!Cross(S[*pi], S[*pa])"
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 324 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 8 ms 1172 KB Output is correct
5 Correct 20 ms 2036 KB Output is correct
6 Failed 0 ms 324 KB Condition failed: "!Cross(S[*pi], S[*pa])"
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Failed 0 ms 212 KB Condition failed: "!Cross(S[*pi], S[*pa])"
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Failed 0 ms 212 KB Condition failed: "!Cross(S[*pi], S[*pa])"
2 Halted 0 ms 0 KB -