Submission #963051

# Submission time Handle Problem Language Result Execution time Memory
963051 2024-04-14T12:19:21 Z anton Roads (CEOI20_roads) C++17
15 / 100
60 ms 1876 KB
#include<bits/stdc++.h>

using namespace std;

struct Point{
    int x, y;
};
const int MAX_N = 1e5;
pair<Point, Point> pts[MAX_N];
signed main(){
    int n;
    cin>>n;
    for(int i = 0; i<n; i++){
        Point a, b;
        cin>>a.x>>a.y>>b.x>>b.y;
        if(a.y<b.y){
            pts[i] = {a, b};
        }
        else{
            pts[i] = {b, a};
        }
    }
    auto cmp =[&](pair<Point, Point>& a, pair<Point, Point>& b){
        if(a.first.x!=b.first.x){
            return a.first.x<b.first.x;
        }
        else{
            return a.first.y< b.first.y;
        }
    };
    sort(&pts[0], &pts[n], cmp);

    for(int i = 0; i<n-1; i++){
        cout<<pts[i].second.x<<" "<<pts[i].second.y<<" "<<pts[i+1].first.x<<" "<<pts[i+1].first.y<<endl;
    }
}
# Verdict Execution time Memory Grader output
1 Failed 1 ms 348 KB Condition failed: "!Cross(S[*pi], S[*pa])"
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 4 ms 348 KB Output is correct
4 Correct 23 ms 1112 KB Output is correct
5 Correct 60 ms 1736 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 3 ms 348 KB Output is correct
4 Correct 24 ms 1116 KB Output is correct
5 Correct 46 ms 1876 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Failed 1 ms 348 KB Condition failed: "!Cross(S[*pi], S[*pa])"
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 3 ms 348 KB Output is correct
4 Correct 29 ms 1104 KB Output is correct
5 Correct 47 ms 1872 KB Output is correct
6 Failed 1 ms 344 KB Condition failed: "!Cross(S[*pi], S[*pa])"
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Failed 1 ms 344 KB Condition failed: "!Cross(S[*pi], S[*pa])"
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Failed 0 ms 344 KB Condition failed: "!Cross(S[*pi], S[*pa])"
2 Halted 0 ms 0 KB -