
思维题
文章平均质量分 66
vocaloid01
小菜鸟一只_(:з」∠)_前来膜拜各路大佬orz
展开
-
Gym - 101142F Folding
思路: 因为只能沿与边平行的线折,所以每次折叠相当于缩小两条边中的一条边,而如果当前一条边长为x则折叠后最小为(x+1)/2。所以只要目标长度在[(x+1)/2,x)范围内都能通过一次折叠得到。按照这个思路就很容易求得把长为A的边折成B所需要的次数了。 需要注意的是最后结果并不一定是长边折长边;短边折短边最少。 代码: #include <bits/stdc++.h> ...原创 2018-10-15 21:19:31 · 192 阅读 · 0 评论 -
HDU - 5475 An easy problem (思维+数学+线段树)
One day, a useless calculator was being built by Kuros. Let's assume that number X is showed on the screen of calculator. At first, X = 1. This calculator only supports two types of operation. 1. mult...原创 2018-09-14 15:48:02 · 161 阅读 · 0 评论 -
HDU - 5874 Friends and Enemies (思维or构造)
On an isolated island, lived some dwarves. A king (not a dwarf) ruled the island and the seas nearby, there are abundant cobblestones of varying colors on the island. Every two dwarves on the island a...原创 2018-08-31 13:33:12 · 216 阅读 · 0 评论 -
HDU - 2160 母猪的故事 (休闲思维题,预防脑袋老化)
话说现在猪肉价格这么贵,著名的ACBoy 0068 也开始了养猪生活。说来也奇怪,他养的猪一出生第二天开始就能每天中午生一只小猪,而且生下来的竟然都是母猪。 不过光生小猪也不行,0068采用了一个很奇特的办法来管理他的养猪场: 对于每头刚出生的小猪,在他生下第二头小猪后立马被杀掉,卖到超市里。 假设在创业的第一天,0068只买了一头刚出生的小猪,请问,在第N天晚上,0068的养猪场里还存有多少头猪...原创 2018-07-20 12:33:53 · 386 阅读 · 0 评论 -
51Nod - 1279 扔盘子(二分+思维)
有一口井,井的高度为N,每隔1个单位它的宽度有变化。现在从井口往下面扔圆盘,如果圆盘的宽度大于井在某个高度的宽度,则圆盘被卡住(恰好等于的话会下去)。 盘子有几种命运:1、掉到井底。2、被卡住。3、落到别的盘子上方。 盘子的高度也是单位高度。给定井的宽度和每个盘子的宽度,求最终落到井内的盘子数量。 如图井和盘子信息如下: 井:5 6 4 3 6 2 3 盘子:2 3 5 2 4...原创 2018-06-05 17:23:18 · 625 阅读 · 0 评论 -
CodeForces - 243A——The Brand New Function (令人烦躁的思维题)
Polycarpus has a sequence, consisting of n non-negative integers: a1, a2, ..., an.Let's define function f(l, r) (l, r are integer, 1 ≤ l ≤ r ≤ n) for sequence a as an operation of bitwise OR of all th...原创 2018-05-21 10:57:58 · 502 阅读 · 0 评论 -
CodeForces - 888C——K-Dominant Character(思维题)
You are given a string s consisting of lowercase Latin letters. Character c is called k-dominant iff each substring of s with length at least k contains this character c.You have to find minimum k suc...原创 2018-05-14 16:40:20 · 367 阅读 · 0 评论 -
Checker
AtCoDeer is thinking of painting an infinite two-dimensional grid in a checked pattern of side K. Here, a checked pattern of side K is a pattern where each square is painted black or white so that eac原创 2018-02-04 21:06:32 · 420 阅读 · 0 评论 -
4个数和为0 ----51Nod
给出N个整数,你来判断一下是否能够选出4个数,他们的和为0,可以则输出"Yes",否则输出"No"。 Input第1行,1个数N,N为数组的长度(4 <= N <= 1000) 第2 - N + 1行:Ai(-10^9 <= Ai <= 10^9) Output如果可以选出4个数,使得他们的和为0,则输出"Yes",否则输出"No"。 Sample Input5 -1 1 -5 2 4 Sampl原创 2018-01-26 15:01:47 · 387 阅读 · 0 评论 -
51Nod ——1080 两个数的平方和
基准时间限制:1 秒 空间限制:131072 KB给出一个整数N,将N表示为2个整数i j的平方和(i <= j),如果有多种表示,按照i的递增序输出。 例如:N = 130,130 = 3^2 + 11^2 = 7^2 + 9^2 (注:3 11同11 3算1种)Input 一个数N(1 <= N <= 10^9) Output 共K行:每行2个数,i j,表示N = i^2 + j^2(原创 2017-10-19 18:09:15 · 242 阅读 · 0 评论