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

水题,注意数据范围即可

#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;
}

  

上一篇:HDU5840 (分块+树链剖分)


下一篇:scikit-learn中的岭回归(Ridge Regression)与Lasso回归