BOJ 9063 대지

1 개요[ | ]

BOJ 9063 대지


2 C++[ | ]

#include <iostream>
using namespace std;

int main() {
    int N;
    cin >> N;
    
    int xMin = 10000;
    int yMin = 10000;
    int xMax = -10000;
    int yMax = -10000;
    int x, y;
    while(N--) {
        cin >> x >> y;
        if( x < xMin ) xMin = x;
        if( x > xMax ) xMax = x;
        if( y < yMin ) yMin = y;
        if( y > yMax ) yMax = y;
    }
    cout << (xMax-xMin)*(yMax-yMin) << '\n';
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}