Submission #845209

# Submission time Handle Problem Language Result Execution time Memory
845209 2023-09-06T12:36:37 Z samekkk Trampoline (info1cup20_trampoline) C++14
43 / 100
58 ms 51024 KB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(a,b) for (int a = 0; a < (b); ++a)
#define pb push_back
#define all(t) t.begin(), t.end()

struct Pole
{
    int y=-1,x=-1;
};

const int max_W = 2505;
int wysokosc = 0, szerokosc = 0, n = 0, y = 0, x = 0, q = 0, y_1 = 0, y_2 = 0, x_1 = 0, x_2 = 0;
int A[max_W][max_W];
Pole nextt[max_W][max_W];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> wysokosc >> szerokosc >> n;
    rep(i,n)
    {
        cin >> y >> x;
        --y, --x;
        A[y][x] = 1;
    }
    cin >> q;
    while(q--)
    {
        cin >> y_1 >> x_1 >> y_2 >> x_2;
        --y_1, --y_2, --x_1, --x_2;
        bool czy_OK = false;
        while(y_1 <= y_2 and x_1 <= x_2)
        {
            if (y_1 == y_2 and x_1 <= x_2) czy_OK = true;
            if (A[y_1][x_1] == 0) ++x_1;
            else ++y_1;
        }
        if (czy_OK) cout << "Yes" << '\n';
        else cout << "No" << '\n';
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2652 KB 200 token(s): yes count is 21, no count is 179
2 Correct 2 ms 2652 KB 200 token(s): yes count is 70, no count is 130
3 Correct 2 ms 2652 KB 197 token(s): yes count is 25, no count is 172
# Verdict Execution time Memory Grader output
1 Correct 51 ms 24924 KB 4000 token(s): yes count is 99, no count is 3901
2 Correct 49 ms 26708 KB 4000 token(s): yes count is 91, no count is 3909
3 Correct 25 ms 8280 KB 4000 token(s): yes count is 4000, no count is 0
4 Correct 58 ms 26980 KB 4000 token(s): yes count is 1991, no count is 2009
# Verdict Execution time Memory Grader output
1 Runtime error 47 ms 50960 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 48 ms 51024 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 46 ms 50928 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -