首页 > 其他 > 详细

Codeforces Round #195 (Div. 2) A. Vasily the Bear and Triangle

时间:2014-06-16 10:46:16      阅读:356      评论:0      收藏:0      [点我收藏+]

水题,注意数据范围即可

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
#include <algorithm>
#include <utility>
using namespace std;
 
typedef pair<int,int> Point;
 
int main(){
    int x,y;
    cin >> x >>y;
    Point a,b;
    if((x>0 && y > 0) || (x < 0 && y < 0)) a = make_pair(x+y,0),b=make_pair(0,x+y);
    else a = make_pair(x-y,0),b=make_pair(0,y-x);
    if(a.first > b.first) swap(a,b);
    cout<<a.first<<" "<<a.second<<" "<<b.first<<" "<<b.second<<endl;
}

  

Codeforces Round #195 (Div. 2) A. Vasily the Bear and Triangle,布布扣,bubuko.com

Codeforces Round #195 (Div. 2) A. Vasily the Bear and Triangle

原文:http://www.cnblogs.com/xiongqiangcs/p/3783584.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!