Pashmak and Flowers】的更多相关文章

Pashmak and Flowers Codeforces Round #261 (Div. 2) B. Pashmak and Flowers time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Pashmak decided to give Parmida a pair of flowers from the garden.…
B. Pashmak and Flowers time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Pashmak decided to give Parmida a pair of flowers from the garden. There are n flowers in the garden and the i-th of t…
题目链接:http://codeforces.com/problemset/problem/459/B 题意: 给出n支花,每支花都有一个漂亮值.挑选最大和最小漂亮值得两支花,问他们的差值为多少,并且有多少种选法(无先后顺序). 现场做时,想到的是:用multimap记录每个漂亮值出现的次数,并不断更新最大最小值. 这个方法很笨,而且multimap的val值是多余的. 需要注意特殊情况:max==min 代码如下: #include<iostream>//A - Pashmak and Fl…
Pashmak decided to give Parmida a pair of flowers from the garden. There are nflowers in the garden and the i-th of them has a beauty number bi. Parmida is a very strange girl so she doesn't want to have the two most beautiful flowers necessarily. Sh…
题目链接:http://codeforces.com/problemset/problem/459/B 题目意思:有 n 朵 flowers,每朵flower有相应的 beauty,求出最大的beauty 差 和 要达到这个最大的差 的取法有多少种. 一下子wa,是因为没考虑到整个序列都是相同的beauty 时的情况,以为取法是一种= =.注意,beauty 差为0都是合法的.还有注意这句话:Two ways are considered different if and only if the…
      2014_8_15 CodeForces 261 DIV2 A. Pashmak and Garden 简单题   B. Pashmak and Flowers    简单题   C. Pashmak and Buses     好题!k进制的应用   D. Pashmak and Parmida's problem 简单题! 统计+树状数组    E. Pashmak and Graph 简单题!排序+DP  2014-08-17 BestCoder Round #5 A. Poo…
链接:http://codeforces.com/contest/459/problem/B B. Pashmak and Flowers time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Pashmak decided to give Parmida a pair of flowers from the garden. Ther…
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…
Codeforces Round #261 (Div. 2)[ABCDE] ACM 题目地址:Codeforces Round #261 (Div. 2) A - Pashmak and Garden 题意:  一个正方形,它的边平行于坐标轴,给出这个正方形的两个点,求出另外两个点. 分析:  推断下是否平行X轴或平行Y轴,各种if. 代码: /* * Author: illuz <iilluzen[at]gmail.com> * File: A.cpp * Create Date: 2014…
每个标题都做了题目原网址的超链接 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…