답안 #522979

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
522979 2022-02-06T17:28:11 Z Farhan_HY Trampoline (info1cup20_trampoline) C++14
43 / 100
489 ms 95616 KB
#include <bits/stdc++.h>
#define int long long
#define float double
#define pb push_back
#define F first
#define S second
#define T int t; cin >> t; while(t--)
#define IOS ios::sync_with_stdio(); cin.tie(0); cout.tie(0);

using namespace std;

const int inf = 8e18;
const int N = 1e6 + 6;
const int M = 1e3 + 3;
const int mod = 1e9 + 7;
const float pi = atan(1) * 4;
int r, c, n;
set<int> tramps[N];

main()
{
    cin >> r >> c >> n;
    for(int i = 0; i < n; i++)
    {
        int y, x;
        cin >> y >> x;
        tramps[y].insert(x);
    }
    T
    {
        int x1, x2, y1, y2;
        cin >> y1 >> x1 >> y2 >> x2;
        while(y1 != y2)
        {
            if (tramps[y1].lower_bound(x1) == tramps[y1].end())
                break;
            x1 = *tramps[y1].lower_bound(x1);
            if (x1 > x2)
                break;
            y1++;
        }
        if (y1 == y2)
            cout << "Yes\n";
        else
            cout << "No\n";
    }
}

Compilation message

trampoline.cpp:20:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   20 | main()
      | ^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 28 ms 47564 KB 200 token(s): yes count is 21, no count is 179
2 Correct 30 ms 47772 KB 200 token(s): yes count is 70, no count is 130
3 Correct 35 ms 47572 KB 197 token(s): yes count is 25, no count is 172
# 결과 실행 시간 메모리 Grader output
1 Correct 197 ms 56640 KB 4000 token(s): yes count is 99, no count is 3901
2 Correct 215 ms 58484 KB 4000 token(s): yes count is 91, no count is 3909
3 Correct 489 ms 58276 KB 4000 token(s): yes count is 4000, no count is 0
4 Correct 317 ms 58488 KB 4000 token(s): yes count is 1991, no count is 2009
# 결과 실행 시간 메모리 Grader output
1 Runtime error 62 ms 95616 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 66 ms 95552 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 59 ms 95512 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -