Submission #880181

# Submission time Handle Problem Language Result Execution time Memory
880181 2023-11-29T02:00:23 Z Regulus Hamburg Steak (JOI20_hamburg) C++17
0 / 100
2 ms 604 KB
#include <bits/stdc++.h>
#define IO ios::sync_with_stdio(false);cin.tie(0);
#define debug(x) cerr << #x << " = " << (x) << ' '
#define endl cerr << '\n'
#define all(v) (v).begin(), (v).end()
#define SZ(v) (ll)(v).size()
#define lowbit(x) (x)&-(x)
#define pb emplace_back
#define F first
#define S second
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
 
const int N = 1e5+5;
int L[N], R[N], D[N], U[N];
pll p[4];

inline bool chk(int x, int y, int j)
{
    return L[j] <= x && x <= R[j] && D[j] <= y && y <= U[j];
}

int main(void)
{ IO
    ll n, i, j, m;
    bool ff;

    cin >> n >> m;
    for (i=1; i <= n; ++i) cin >> L[i] >> D[i] >> R[i] >> U[i];

    for (i=1; i <= n; ++i)
    {
        p[0] = {L[i], D[i]}, p[1] = {L[i], U[i]};
        p[2] = {R[i], D[i]}, p[3] = {R[i], U[i]};
        ff = 0;
        for (int d=0; d < 4; ++d)
        {
            for (j=1; j <= n; ++j)
            {
                if (i == j) continue;
                if (!chk(p[d].F, p[d].S, j)) break;
            }
            if (j > n)
            {
                cout << p[d].F << ' ' << p[d].S << '\n';
                exit(0);
            }
        }
    }

    assert(0);
 
    return 0;
}

Compilation message

hamburg.cpp: In function 'int main()':
hamburg.cpp:27:10: warning: variable 'ff' set but not used [-Wunused-but-set-variable]
   27 |     bool ff;
      |          ^~
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 604 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 604 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 604 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 604 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -