思维题
文章平均质量分 85
galesaur_wcy
我们一起加油啊~~~~
展开
-
H - Count the Sheep(思维题)
Altough Skipping the class is happy, the new term still can drive luras anxious which is of course because of the tests! Luras became worried as she wanted to skip the class, as well as to attend the转载 2017-07-21 10:59:46 · 297 阅读 · 0 评论 -
What Kind of Friends Are You? ZOJ - 3960 (STL)
ZOJ - 3960Japari Park is a large zoo home to extant species, endangered species, extinct species, cryptids and some legendary creatures. Due to a mysterious substance known as Sandstar, all the anima...原创 2018-03-28 19:52:41 · 214 阅读 · 0 评论 -
HDU 5512(博弈论)
n pagodas were standing erect in Hong Jue Si between the Niushou Mountain and the Yuntai Mountain, labelled from 1 to n. However, only two of them (labelled a and b, where 1≤a≠b≤n) withstood the test ...转载 2018-04-04 19:27:56 · 157 阅读 · 0 评论 -
蓝桥杯 k倍区间(前缀和)
1505: k倍区间时间限制: 2 Sec 内存限制: 128 MB提交: 93 解决: 21[提交][状态][讨论版]题目描述给定一个长度为N的数列,A1, A2, ... AN,如果其中一段连续的子序列Ai, Ai+1, ... Aj(i <= j)之和是K的倍数,我们就称这个区间[i, j]是K倍区间。 你能求出数列中总共有多少个K倍区间吗?输入第一行包含两个整数N和K。(1...转载 2018-03-29 15:05:38 · 206 阅读 · 0 评论 -
CodeForces - 837F(二分组合思维)
Consider the function p(x), where x is an array of m integers, which returns an array y consisting of m + 1 integers such that yi is equal to the sum of first i elements of array x (0 ≤ i ≤ m).You hav...转载 2018-04-05 11:14:16 · 190 阅读 · 0 评论 -
Just Pour the Water ZOJ - 2974 (矩阵快速幂)
题目具体转载来自大佬:https://blog.csdn.net/Anxdada/article/details/73603752我觉得他风格很好这叫C++写题哈哈代码:#include<bits/stdc++.h>using namespace std;double s[25],result[25];int size;struct Ma{ double a[25][...转载 2018-04-18 17:27:38 · 131 阅读 · 0 评论 -
G - Parenthesis CSU - 1809 (siwei)
Bobo has a balanced parenthesis sequence P=p 1 p 2…p n of length n and q questions.The i-th question is whether P remains balanced after p ai and p bi swapped. Note that questions are individual so t...原创 2018-05-01 19:48:55 · 123 阅读 · 0 评论 -
2016 CSU - 1803
给出正整数 n 和 m,统计满足以下条件的正整数对 (a,b) 的数量: 1. 1≤a≤n,1≤b≤m; 2. a×b 是 2016 的倍数。Input输入包含不超过 30 组数据。每组数据包含两个整数 n,m (1≤n,m≤10 9).Output对于每组数据,输出一个整数表示满足条件的数量。Sample Input32 632016 20161000000000 1000000000S...转载 2018-05-01 19:51:01 · 142 阅读 · 0 评论 -
距离之和最小 V3 51Nod - 1110(带权中位数或者爆搜)
51Nod - 1110 X轴上有N个点,每个点除了包括一个位置数据Xi,还包括一个权值Wi。点P到点Pi的带权距离 = 实际距离 * Pi的权值。求X轴上一点使它到这N个点的带权距离之和最小,输出这个最小的带权距离之和。 Input 第1行:点的数量N。(2 <= N <=...转载 2018-05-20 19:47:56 · 161 阅读 · 0 评论 -
Lara Croft and the New Game CodeForces - 976B (思维)
You might have heard about the next game in Lara Croft series coming out this year. You also might have watched its trailer. Though you definitely missed the main idea about its plot, so let me lift t...原创 2018-05-21 21:28:42 · 184 阅读 · 0 评论 -
平面(思维)
用N个四边方形最多可以把平面分成几个区域?Input第一行输入一个整数T,表示数据组数(1<=T<=10000); 第二行输入一个正整数n(1<=n<=1000);Output对于每组数据,请输出结果。Sample Input212Sample Output210emmmmm我是手推出来的,就是是正方形 外平面一个 内平面一个 然后在加上四边扩充的我觉得四边扩充的...原创 2018-05-08 17:24:41 · 184 阅读 · 0 评论 -
CodeForces - 976C(结构体排序思维)
CodeForces - 976C You are given a sequence a1, a2, ..., an of one-dimensional segments numbered 1 through n. Your task is to find two distinct indices i and j such that segment ai lies within segment ...原创 2018-05-22 17:19:55 · 517 阅读 · 0 评论 -
51Nod 1637 幸运数字转换(思维)
1637 幸运数字转换题目来源: CodeForces基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题比得喜欢幸运数字。这里所说的幸运数字是由4和7组成的正整数。比如,数字47,744,4是幸运数字,而5,17,467就不是。 比得有一个没有前导0的n位数的整数。他用了一个数组d来表示这个整数。数组的第一个编号从数字的最高位开始,下标从1开始。比得想对d进行以下操...原创 2018-05-22 20:42:44 · 665 阅读 · 0 评论 -
51Nod - 1051(思维)
51Nod - 10511051 最大子矩阵和 基准时间限制:2 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 收藏 关注 一个M*N的矩阵,找到此矩阵的一个子矩阵,并且这个子矩阵的元素的和是最大的,输出这个最大的值。例如:3...原创 2018-05-23 09:19:30 · 144 阅读 · 0 评论 -
Valhalla Siege CodeForces - 975C(思维)
CodeForces - 975CIvar the Boneless is a great leader. He is trying to capture Kattegat from Lagertha. The war has begun and wave after wave Ivar's warriors are falling in battle.Ivar has n warriors, h...原创 2018-05-23 18:41:18 · 277 阅读 · 0 评论 -
Moon Game FZU - 2148(思维)
Fat brother and Maze are playing a kind of special (hentai) game in the clearly blue sky which we can just consider as a kind of two-dimensional plane. Then Fat brother starts to draw N starts in the...转载 2018-04-14 18:42:24 · 107 阅读 · 0 评论 -
Forever 0.5 (计算几何思维)
转载来自:https://blog.csdn.net/queuelovestack/article/details/52667228 Given an integer N, your task is to judge whether there exist N points in the plane such that satisfy the following conditions: 1. Th...转载 2018-04-14 18:06:40 · 155 阅读 · 0 评论 -
CodeForces 632C The Smallest String Concatenation(水)
E - The Smallest String Concatenation CodeForces - 632C You're given a list of n strings a1, a2, ..., an. You'd like to concatenate them together in some order such that the resulting string would be ...原创 2018-03-19 19:57:01 · 143 阅读 · 0 评论 -
经典错排!
HDU 2006'10 ACM contest的颁奖晚会隆重开始了! 为了活跃气氛,组织者举行了一个别开生面、奖品丰厚的抽奖活动,这个活动的具体要求是这样的: 首先,所有参加晚会的人员都将一张写有自己名字的字条放入抽奖箱中; 然后,待所有字条加入完毕,每人从箱中取一个字条; 最后,如果取得的字条上写的就是自己的名字,那么“恭喜你,中奖了!” 大家可以想象一下当时的气氛之原创 2017-09-14 09:37:54 · 363 阅读 · 0 评论 -
蚂蚁爬得问题
An army of ants walk on a horizontal pole of length l cm, each with a constant speed of 1 cm/s. When a walking ant reaches an end of the pole, it immediatelly falls off it. When two ants meet they tur原创 2017-09-14 09:40:46 · 261 阅读 · 0 评论 -
顺序三元组(思维)
给定一个长度为N的数组A=[A1, A2, ... AN],已知其中每个元素Ai的值都只可能是1, 2或者3。请求出有多少下标三元组(i, j, k)满足1 ≤ i i j k。Input第一行包含一个整数N 第二行包含N个整数A1, A2, ... AN。(1 ≤ Ai ≤ 3) 对于30%的数据,1 ≤ N ≤ 100 对于80%的数据,1 ≤ N ≤ 100转载 2017-09-14 11:08:56 · 1293 阅读 · 0 评论 -
HihoCoder-1523(思维)
Q - 数组重排2 HihoCoder - 1523 给定一个1-N的排列A1, A2, ... AN,每次操作小Hi可以选择一个数,把它放到数组的最左边。请计算小Hi最少进行几次操作就能使得新数组是递增排列的。Input第一行包含一个整数N。第二行包含N个两两不同整数A1, A2, ... AN。(1 i 对于60%的数据 1 对于100%的数据原创 2017-10-10 10:28:13 · 363 阅读 · 0 评论 -
Z - 犯罪嫌疑人(思维题目)
福尔摩斯是个大侦探,他总是在解决疑难案件。这一次的案件也不例外,案件是这样的:有编号为1到N的N位嫌疑犯,他们其中有一个犯了罪,然后每个嫌疑犯都被询问,“哪一个人犯了罪?”犯罪嫌疑人的答案只能“编号ai的嫌疑犯犯了罪”或者“编号ai的嫌疑犯没有犯罪”。当然嫌疑犯也可以说他自己(ai = i).福尔摩斯凭着他敏锐的侦探直觉,确定地对华生说,只有M个人说了真话,其余人都是说谎。然后就没有然后了,但转载 2017-10-05 14:22:03 · 324 阅读 · 0 评论 -
G - 罐子和硬币 (思维题)
转载来自此博客:http://blog.csdn.net/qingshui23/article/details/51853530有n个罐子,有k个硬币,每个罐子可以容纳任意数量的硬币。罐子是不透明的,你可以把这k个硬币任意分配到罐子里。然后罐子被打乱顺序,你从外表无法区别罐子。最后罐子被编上号1-n。每次你可以询问某个罐子,如果该罐子里有硬币,则你可以得到1个(但你不知道该罐子中还有多转载 2017-10-27 19:17:55 · 225 阅读 · 0 评论 -
1008 - Fibsieve`s Fantabulous Birthday
转载来自http://blog.csdn.net/wang907553141/article/details/522940901008 - Fibsieve`s Fantabulous Birthday PDF (English)StatisticsForumTime Limit: 0.5 second(s)Mem转载 2017-10-04 20:58:07 · 275 阅读 · 0 评论 -
V - Discover the Web(模拟)
Standard web browsers contain features to move backward and forward among the pages recently visited. One way to implement these features is to use two stacks to keep track of the pages that can be re原创 2017-10-04 19:37:38 · 231 阅读 · 0 评论 -
HDU - 2187 (贪心)
时间:2008年5月16日(震后第4天) 地点:汶川县牛脑寨 人物:羌族老奶奶 【转载整理】牛脑寨是一个全村600多人的羌族寨子,震后几天,这里依然能常常听到隆隆的声音,那是对面山上石头不断滑落的声音。在完成整个突击队的抢修移动基站的任务后,我提着相机开始记录这里的受创情况。突然,我的视线里出现一个羌族老人,这让我无比的震惊,要知道,那是一个极陡的坡,这个佝偻着腰的老人是怎原创 2017-09-21 21:40:08 · 210 阅读 · 0 评论 -
[CodeForces-540B]
Little Vova studies programming in an elite school. Vova and his classmates are supposed to writen progress tests, for each test they will get a mark from 1 top. Vova is very smart and he can writ原创 2017-09-21 21:32:50 · 216 阅读 · 0 评论 -
LightOJ 1042 Secret Origins(贪心或者位运算)
This is the tale of Zephyr, the greatest time traveler the world will never know. Even those who are aware of Zephyr's existence know very little about her. For example, no one has any clue as to whic...原创 2017-10-05 21:05:27 · 920 阅读 · 0 评论 -
只包含因子2 3 5的数 (思维和二分)
K的因子中只包含2 3 5。满足条件的前10个数是:2,3,4,5,6,8,9,10,12,15。所有这样的K组成了一个序列S,现在给出一个数n,求S中 >= 给定数的最小的数。 例如:n = 13,S中 >= 13的最小的数是15,所以输出15。 Input第1行:一个数T,表示后面用作输入测试的数的数量。(1 第2 - T + 1行:每行1个数N(1 Output共T行原创 2018-01-21 17:14:42 · 510 阅读 · 0 评论 -
Secret Origins(贪心或者位运算)
This is the tale of Zephyr, the greatest time traveler the world will never know. Even those who are aware of Zephyr's existence know very little about her. For example, no one has any clue as to whic...原创 2018-02-05 21:15:33 · 300 阅读 · 0 评论 -
Pearls in a Row CodeForces - 620(想歪了...STL)
Pearls in a Row CodeForces - 620 There are n pearls in a row. Let's enumerate them with integers from 1 to n from the left to the right. The pearl number i h...原创 2018-03-14 21:07:30 · 261 阅读 · 0 评论 -
Codeforces-691C-Exponential notation(模拟)Java 以及输入的处理
转载来自:https://blog.csdn.net/qq_32680617/article/details/51924415菜鸡本人import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.io.OutputStreamWriter;...转载 2019-03-18 21:07:12 · 356 阅读 · 0 评论