Submission #289863

# Submission time Handle Problem Language Result Execution time Memory
289863 2020-09-03T07:31:33 Z 최은수(#5769) Hamburg Steak (JOI20_hamburg) C++17
4 / 100
99 ms 3576 KB
#include<iostream>
#include<vector>
#include<algorithm>
#define ep emplace
#define eb emplace_back
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef pair<int,int>pi;
typedef pair<ll,ll>pl;
const int inf=1e9+7;
const ll INF=1e18;
inline bool check(const pair<pi,pi>&sq,const pi&p)
{
    return sq.fi.fi<=p.fi&&p.fi<=sq.fi.se&&sq.se.fi<=p.se&&p.se<=sq.se.se;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n,k;
    cin>>n>>k;
    vector<pair<pi,pi> >v(n);
    for(auto&t:v)
        cin>>t.fi.fi>>t.se.fi>>t.fi.se>>t.se.se;
    int xmx=-inf,xmn=inf,ymx=-inf,ymn=inf;
    for(auto&t:v)
        xmx=max(xmx,t.fi.fi),ymx=max(ymx,t.se.fi),
        xmn=min(xmn,t.fi.se),ymn=min(ymn,t.se.se);
    pi p[4]={pi(xmx,ymx),pi(xmx,ymn),pi(xmn,ymx),pi(xmn,ymn)};
    for(int i=0;i<4;i++)
    {
        for(int j=i+1;j<4;j++)
        {
            bool f=1;
            for(auto&t:v)
            {
                if(!check(t,p[i])&&!check(t,p[j]))
                {
                    f=0;
                    break;
                }
            }
            if(f)
                return cout<<p[i].fi<<' '<<p[i].se<<endl<<p[j].fi<<' '<<p[j].se<<endl,0;
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Extra information in the output file
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Extra information in the output file
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 98 ms 3576 KB Output is correct
6 Correct 99 ms 3456 KB Output is correct
7 Correct 99 ms 3456 KB Output is correct
8 Correct 97 ms 3456 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -