poj1054 The Troublesome Frog 瞎搞。】的更多相关文章

连接:http://poj.org/problem?id=1054 题意:就是一个格子里一条线上最长有几个青蛙(青蛙间隔相同)~.但是其实青蛙的起点重点必须是在外面. 直接写一个搜就是. #include <stdio.h> #include <string.h> #include <iostream> #include <algorithm> #include <stdlib.h> #include <vector> #includ…
题目来源:http://poj.org/problem?id=1054 题目大意: 有一种青蛙在晚上经过一片稻田,在庄稼上跳跃,会把庄稼压弯.这让农民很苦恼.我们希望通过分析青蛙跳跃的路径,找出对稻田造成最大损害的青蛙.青蛙跳跃时总是沿着直线并且步长均匀,但不同青蛙可能步长或方向不一样.如下图所示: 稻田庄稼是均匀地种在矩形网格交点处的,如下左图所示.青蛙总是会完全穿过这片稻田,也就是说从稻田外跳入并最终跳出稻田.如下右图所示. 有许多青蛙会穿过这片稻田,从庄稼上跳跃.我们可以知道那些庄稼被青蛙…
Description In Korea, the naughtiness of the cheonggaeguri, a small frog, is legendary. This is a well-deserved reputation, because the frogs jump through your rice paddy at night, flattening rice plants. In the morning, after noting which plants hav…
题目链接 本来觉得这不是经典的贪心吗..果断水一次,wa了,看了看discuss,发现貌似不好水,土土的DP了一下,复杂度很高了,又T了...然后想想单调队列,二分什么的...不好往上加,直接搞了标记数组flag,暴力从大到小,遍历寻找,然后就过了...这算是优化吗,瞎搞... #include <cstring> #include <cstdio> #include <string> #include <iostream> #include <alg…
The Troublesome Frog Time Limit: 5000MS Memory Limit: 100000K Total Submissions: 9581 Accepted: 2883 Case Time Limit: 500MS Description In Korea, the naughtiness of the cheonggaeguri, a small frog, is legendary. This is a well-deserved reputation, be…
Problem H. Horrible Truth Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100610 Description In a Famous TV Show “Find Out” there are n characters and only one Horrible Truth. To make the series breathtaking all way long, the sc…
链接:https://www.nowcoder.com/acm/contest/104/B来源:牛客网 题意:A few days ago, WRD was playing a small game called Salty Fish Go. We can simplify the rules of the game as follows. 给你v,l,n,m代表有v个速度,下一行分别给出v个速度,l长的路,n个随机地点随机改变速度的加油站,m个随机地点宝藏.问拿到所有宝藏的时间期望. 题解:瞎…
题目链接:点我 题意:给定一个序列,询问是否能删除一个数让它成为非递减或者非递增的序列. 比如说 删除后的序列是1 3 3 5 或者5 3 3 1 或者1 3 5 或者5 3 1 都可以.只要满足删掉某个数,构成非递减或者非递增,就输出YES,如果不能就输出NO 正解(LIS求最长上升子序列): 正着来一遍,反着来一遍 注意要用upper_bound即可: 代码: #include<bits/stdc++.h> using namespace std; int Maxlen(int a[],i…
传送门 (<---可以点击的~) 时间限制(普通/Java):1000MS/3000MS     内存限制:65536KByte 描述 有些英语单词后缀都是一样的,现在我们需要从给定的一堆单词里面找出某个后缀的单词个数. 输入 输入有多组数据.每组第一行输入n,m,0<=n,m<=100000,第二行到n+1行:输入单词,每个单词仅有小写英文字母组成,长度不超过10.第n+2行到n+m+1行,输入要找的单词后缀. 输出 在n个单词里面找出输入单词后缀的单词个数,然后输出.每个数据与数据之…
B. Cards 题目连接: http://www.codeforces.com/contest/626/problem/B Description Catherine has a deck of n cards, each of which is either red, green, or blue. As long as there are at least two cards left, she can do one of two actions: take any two (not ne…