Sicily 13916. Smallest Box

来源:互联网 发布:matlab遗传算法cae 编辑:程序博客网 时间:2024/06/06 14:19

13916. Smallest Box

Constraints

Time Limit: 1 secs, Memory Limit: 32 MB

Description

 

Input

 

Output

 

Sample Input

样例一:33 45 74 3样例二:41 55 110 55 10

Sample Output

样例一:16样例二:81

Hint

 

Problem Source

2015年每周一赛第三场

// Problem#: 13916// Submission#: 3638792// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License// URI: http://creativecommons.org/licenses/by-nc-sa/3.0/// All Copyright reserved by Informatic Lab of Sun Yat-sen University#include <iostream>#include <algorithm>using namespace std;int main() {    int n, min_x = 101, min_y = 101, max_x = 0, max_y = 0;    cin >> n;    while (n--) {        int tx, ty;        cin >> tx >> ty;        min_x = min(tx, min_x);        max_x = max(tx, max_x);        min_y = min(ty, min_y);        max_y = max(ty, max_y);    }    cout << max(max_x - min_x, max_y - min_y) * max(max_x - min_x, max_y - min_y) << endl;    return 0;}                                 


0 0
原创粉丝点击