思维题
搬砖的小孩有肉吃
我曾十步杀一人,却败给你的眼神
展开
-
ACM训练——Colorful Rainbows
题目链接:https://vjudge.net/problem/ZOJ-2967Evelyn likes drawing very much. Today, she draws lots of rainbows on white paper of infinite size, each using a different color. Since there're too many r...原创 2020-05-01 09:18:03 · 198 阅读 · 0 评论 -
ACM训练——Kinds of Fuwas
题目链接:https://vjudge.net/problem/ZOJ-2975In the year 2008, the 29th Olympic Games will be held in Beijing. This will signify the prosperity of China as well as becoming a festival for people all ...原创 2020-04-30 17:35:33 · 236 阅读 · 0 评论 -
问题 1255: [蓝桥杯][算法提高]能量项链
解题思路:要分析出合并释放能量公式:power=a[i-1]*a[i]*a[i+1];这样进一步分析要想合并能量最大,就要尽量使大的标记尽量不要早消失,这就要求a[i]最小即可,所以每次找到最小的标记合并消去。#include<stdio.h>#include<iostream>#include<algorithm>#include<...原创 2020-03-12 13:36:32 · 425 阅读 · 2 评论 -
2020牛客寒假算法基础集训营4--子段异或
#include<stdio.h>#include<iostream>#include<algorithm>#include<string.h>#include<vector>#include<cmath>#include<string>#include<map>#...原创 2020-02-14 13:08:00 · 140 阅读 · 0 评论 -
codeforces-123B思维
> You are given an infinite checkered field. You should get from a square (x1; y1) to a square (x2; y2). Using the shortest path is not necessary. You can move on the field squares in four directio...原创 2020-01-30 12:07:34 · 219 阅读 · 0 评论 -
codeforces--123A--思维题
题目大意:给出一个字符串,问能否通过打乱它的顺序得到一个新的字符串,这个字符串满足所有的质数位和位数是这个质数的倍数的位数上的字母相同,输出能否,如果能,构造一组解.题目分析:首先我们知道输入的字符串的字母的顺序无所谓,我们只需要记录每个字母出现的次数。然后我们发现不管n是多少,集合的形式一定是一个大集合,和一些规模为1的小集合,且这些集合的元素是质数,且大集合不存在这个质数的倍数...原创 2020-01-30 11:12:19 · 196 阅读 · 0 评论 -
思维--(时间推算)
传送门:https://vjudge.net/contest/348589#problem/AIt is 2012, and it's a leap year. So there is a "February 29" in this year, which is called leap day. Interesting thing is the infant who will born ...原创 2019-12-22 20:55:51 · 160 阅读 · 0 评论 -
思维题-----找不同数的位置(CodeForces - 622C )
http://codeforces.com/problemset/problem/622/C《《《《------题目链接#include<stdio.h>#include<iostream>#include<algorithm>#include<string.h>#include<vector>#include&...原创 2019-11-25 14:18:23 · 112 阅读 · 0 评论 -
思维组合问题--图hdu6016
"Imagine you are on the endless grassland where there are a group of sheep. And n sheep of them are silent boy-sheep while m sheep are crying girl-sheep. And there are k friend-relationships between ...原创 2019-11-19 16:08:23 · 128 阅读 · 0 评论 -
跑道----思维
https://vjudge.net/contest/339753#problem/C题意:有两个人分别在周长为L的圆上,圆上有n个障碍物,两个人分别以逆时针的方向告诉你他们各自距离各个障碍物的距离,问他们是否在同一个圆上解题思路:若一开始不在障碍物上,则先把他们逆时针移到他们各自前面的第一个障碍物,然后把一个人不断地逆时针地向其他障碍物前进,计算出距离各个障碍物的距离,比较一下两个人的...原创 2019-11-19 11:33:11 · 167 阅读 · 0 评论 -
糖果传递-----(数学推导)
https://ac.nowcoder.com/acm/contest/950/K题目描述有n个小朋友坐成一圈,每人有aia_iai颗糖果。每人只能给左右两人传递糖果。每人每次传递一颗糖果的代价为1。求使所有人获得均等糖果的最小代价。输入描述:第一行有一个整数n,表示小朋友个数;在接下来n行中,每行一个整数aia_iai。输出描述:输出使所有人获得均等...原创 2019-11-05 15:58:34 · 2965 阅读 · 2 评论 -
大数加法乘法的模拟过程---创新实验室纳新
https://www.qduoj.com/problem/596#include<iostream>#include<algorithm>#include<string>#include<cstring>#include<vector>#include<queue>#include<cmath...原创 2019-09-24 14:24:42 · 155 阅读 · 0 评论 -
快速读入--实验室纳新
https://www.qduoj.com/problem/590------假装签到题注意本题的两个技巧:第一是必须用int类型,否则空间超限;第二是对a和b的读入必须是快速读入,scanf和cin都会超时#include<stdio.h>#include<iostream>#include<algorithm>#inclu...原创 2019-09-24 13:54:19 · 135 阅读 · 0 评论 -
[HAOI2012]音量调节----(01背包or思维)牛客网
https://ac.nowcoder.com/acm/problem/19990分析:其实初始音量给出,并且每首歌要调节的音量也给出后,每首歌对应的音量的个数也就确定了例如样例://第一次调节 只能从 5开始 调小的话就是0 调大的话就是10//第二次调节 先分析0 调小不可以 调大只能是3 再分析10 调小是7 调大不可以//第三次调节 先分析3 调小不可...原创 2019-08-29 22:23:22 · 249 阅读 · 0 评论 -
left or right---中石油我要变强的第十二场(思维题)
#include<stdio.h>#include<iostream>#include<algorithm>#include<string.h>#include<vector>#include<cmath>#include<string>#include<map>#include&...原创 2019-08-29 21:42:08 · 155 阅读 · 0 评论 -
Faulhaber’s Triangle---Contest1539 - 2019年我能变强组队训练赛第十一场
http://icpc.upc.edu.cn/contest.php?cid=1539题目描述The sum of the m-th powers of the first n integerscan be written as a polynomial of degree m + 1 in n:For example:S(n, 1) = (1 + . . . + n) = (...原创 2019-08-28 18:28:19 · 121 阅读 · 0 评论 -
树状数组+二分or暴力出奇迹---lost cows
描述:N(2<=N<=8,000)奶牛有独特的品牌在范围1.N.在一个糟糕的判断力的壮观显示,他们去附近的‘水坑’,并喝了太多啤酒在晚餐前。当是时候排队为他们的晚餐,他们没有排队按照所需的上升数字的顺序,他们的品牌。令人遗憾的是,FJ没有办法解决这些问题。此外,他不太擅长观察问题。他没有写下每头牛的品牌,而是确定了一个相当愚蠢的统计数据:每一头排在奶牛前面的奶牛,他知道排在那头...原创 2019-08-28 00:03:41 · 110 阅读 · 1 评论 -
CodeForces - 1040B 翻转数字------思维题
CodeForces - 1040BLong story short, shashlik is Miroslav's favorite food. Shashlik is prepared on several skewers simultaneously. There are two states for each skewer: initial and turned over.Thi...原创 2019-08-17 14:37:02 · 165 阅读 · 0 评论 -
多利卡普和Div 3-----思维题
思路: 同余对于单独的一个数字而言 如果是三的倍数 则 ans++否则 去考虑连续的两个数字如果是 则 ans++否则 考虑连续的三个数字如果第三个数字本身就是3的倍数则ans++如果第三个数字不是3的倍数 那对于前两个数字x y 来说x y 对3求余只有两种情况 [1,1] [2,2] 不可能是[2,1],[1,2]这两个 因为如果是后面这两个情况的话 那...原创 2019-08-17 13:25:05 · 125 阅读 · 0 评论