您的位置:首页 > 其它

题目1170:找最小数

2017-04-20 09:52 190 查看

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <stack>
#include <sstream>
using namespace std;
//1170
struct S{
    int x,y;
    bool operator < (const S &a) const{
        if(x!=a.x) return x<a.x;
        else       return y<a.y;
    }
};
int n;
vector<S> v;
int main(){
  //  freopen("input.txt","r",stdin);
    while(cin>>n){
        S s;
        v.clear();
        while(n--){
            cin>>s.x>>s.y;
            v.push_back(s);
        }
        sort(v.begin(),v.end());
        cout<<v[0].x<<" "<<v[0].y<<endl;
    }
    return 0;
}
/**************************************************************
    Problem: 1170
    User: cust123
    Language: C++
    Result: Accepted
    Time:10 ms
    Memory:1520 kb
****************************************************************/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: