/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 332.0 KiB
#2 Accepted 2ms 332.0 KiB
#3 Accepted 2ms 328.0 KiB
#4 Accepted 2ms 500.0 KiB
#5 Accepted 2ms 492.0 KiB
#6 Wrong Answer 2ms 560.0 KiB
#7 Accepted 2ms 448.0 KiB
#8 Accepted 2ms 480.0 KiB
#9 Wrong Answer 2ms 332.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;
    while (n--)
    {
        int x, y; cin >> 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;
    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 05:38:40
Judged At
2024-12-09 05:38:40
Judged By
Score
24
Total Time
2ms
Peak Memory
560.0 KiB