CF459A Pashmak and Garden (水】的更多相关文章

Pashmak and Garden Codeforces Round #261 (Div. 2) A. Pashmak and Garden time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Pashmak has fallen in love with an attractive girl called Parmida sin…
A. Pashmak and Garden time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Pashmak has fallen in love with an attractive girl called Parmida since one year ago... Today, Pashmak set up a meeting…
题目链接:http://codeforces.com/problemset/problem/459/A 题目大意: 给出两个点(在坐标轴中),求另外两个点从而构成一个正方形,该正方形与坐标轴平行. 如果给的点构不成与坐标轴平行的正方形,则输出 -1. 两点范围: x1, y1, x2, y2 ( - 100 ≤ x1, y1, x2, y2 ≤ 100) .所求两点范围: x3, y3, x4, y4 ( - 1000 ≤ x3, y3, x4, y4 ≤ 1000). 解题思路: 给出两个点,…
题目链接:http://codeforces.com/problemset/problem/459/A A. Pashmak and Garden time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Pashmak has fallen in love with an attractive girl called Parmida s…
Pashmak has fallen in love with an attractive girl called Parmida since one year ago... Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden…
题目链接:http://codeforces.com/problemset/problem/459/B 题意: 给出n支花,每支花都有一个漂亮值.挑选最大和最小漂亮值得两支花,问他们的差值为多少,并且有多少种选法(无先后顺序). 现场做时,想到的是:用multimap记录每个漂亮值出现的次数,并不断更新最大最小值. 这个方法很笨,而且multimap的val值是多余的. 需要注意特殊情况:max==min 代码如下: #include<iostream>//A - Pashmak and Fl…
题目链接:http://codeforces.com/problemset/problem/459/A 题目意思:给出两个点的坐标你,问能否判断是一个正方形,能则输出剩下两点的坐标,不能就输出 -1. 这题更傻了,在考虑对角线的两点时,少考虑了一种情况:两个点分属不同象限:这时需要用到绝对值函数 abs ! 最近集训不知道是不是搞傻左,反正CF的题目打了几场,结果都很惨,有一点点恐惧感,怕跌回以前不堪的rating.唉---继续努力吧!!! #include <iostream> #inclu…
A. Pashmak and Garden time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Pashmak has fallen in love with an attractive girl called Parmida since one year ago... Today, Pashmak set up a meeting…
http://codeforces.com/contest/459 A题 Pashmak and Garden 化简化简水题,都告诉平行坐标轴了,数据还出了对角线,后面两个点坐标给的范围也不错 #include <cstdio> int x[4],y[4]; int abs(int n){ return n<0?-n:n; } int main(){ scanf("%d%d%d%d",x,y,x+1,y+1); int dx=abs(x[0]-x[1]); int d…
每个标题都做了题目原网址的超链接 Day11<Given Length and Sum of Digits...> 题意: 给定一个数 m 和 一个长度 s,计算最大和最小在 s 长度下,各位数字之和为 m 的值 如果无法生成,则输出两个-1 题解: 需要注意:在输出最大值时,判一下 k 是否为 0 上板子: #include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int le…