/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 496.0 KiB
#2 Accepted 2ms 500.0 KiB
#3 Accepted 1ms 524.0 KiB
#4 Accepted 2ms 516.0 KiB
#5 Accepted 2ms 340.0 KiB
#6 Accepted 2ms 544.0 KiB
#7 Accepted 2ms 532.0 KiB
#8 Accepted 2ms 520.0 KiB
#9 Wrong Answer 2ms 516.0 KiB
#10 Accepted 2ms 488.0 KiB
#11 Accepted 2ms 540.0 KiB
#12 Accepted 2ms 540.0 KiB
#13 Accepted 2ms 540.0 KiB
#14 Accepted 2ms 480.0 KiB
#15 Wrong Answer 2ms 532.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    cin >> n;

    int x_min = INT_MAX, x_max = INT_MIN;
    int y_min = INT_MAX, y_max = INT_MIN;
    vector<pair<int, int>> v;
    while (n--)
    {
        int x, y;
        cin >> x >> y;
        v.push_back({x, y});
        x_min = min(x, x_min);
        x_max = max(x, x_max);
        y_min = min(y, y_min);
        y_max = max(y, y_max);
    }
    int x, y;
    cin >> x >> y;

    int flag = 0;
    for (auto &i : v)
    {
        if (i.first == x && i.second == y)
        {
            cout << "YES" << endl;
            return 0;
        }
    }

   

    if ((x > x_min && x < x_max) && (y > y_min && y < y_max))
    {
        cout << "YES" << endl;
    }
    else if ((x_max == x_min && x == x_min) || (y_max == y_min && y == y_min))
    {
        cout << "YES" << endl;
    }
    else
    {
        cout << "NO" << endl;
    }
}

Information

Submit By
Type
Submission
Problem
P1145 Nobita's Love for Shizuka
Contest
LU IUJPC : Sylhet Division 2024
Language
C++17 (G++ 13.2.0)
Submit At
2024-12-09 06:25:42
Judged At
2024-12-09 06:25:42
Judged By
Score
48
Total Time
2ms
Peak Memory
544.0 KiB