
思维题
文章平均质量分 59
Cherry_0525
这个作者很懒,什么都没留下…
展开
-
Codeforce A. Minimum Binary Number
A. Minimum Binary Numbertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputString can be called correct if it consists of characters "0" and "1" and t...原创 2018-05-09 21:46:48 · 224 阅读 · 0 评论 -
【2050 思维+贡献方案数】大厦 hdu-6496
大厦Time Limit: 6000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 39Accepted Submission(s): 15Problem Description现在就让我们来大胆地畅想2050。我们乘坐着无人驾驶的飞行汽车,驰骋...原创 2019-04-17 08:39:53 · 164 阅读 · 0 评论 -
【组合数取模 思维好题】ZUFEoj 2019校赛问题 D: D - RGB游戏
问题 D: D - RGB游戏时间限制:1 Sec内存限制:256 MB提交:45解决:7[提交][状态][讨论版]题目描述三水最近发明了一个RGB游戏:有 n 个方格,编号为从 1 到 n,它用七种颜色的颜料给方格上色,每个 方块只能涂一种颜色。总的分值是这 n 个方块得分之和,如果方块被涂成红色,则方块的得分为 2,如 果方块被涂成蓝色则为 3,如果方块被涂成紫...原创 2019-03-22 20:23:30 · 197 阅读 · 0 评论 -
【构造】构造01串,0表示x/2,1表示1-x,得到指定分数 B. Traveling Salesman Problem
2016-2017 7th BSUIR Open Programming Contest. SemifinalB. Traveling Salesman Problem构造01串,0表示x/2,1表示1-x,得到指定分数X初始为1给你 a,b分数为a/2^b(保证a为奇数,且2^a<2^b)这样可以保证不会约分,就是不断地转换#include <bits/...原创 2019-03-12 19:40:09 · 322 阅读 · 0 评论 -
【DFS+pair+思维】保留1节点的度数为d,求树 F2. Spanning Tree with One Fixed Degree Codeforces Round #544 (Div. 3)
F2. Spanning Tree with One Fixed Degree Codeforces Round #544 (Div. 3)http://codeforces.com/problemset/problem/1133/F2time limit per test 3 seconds memory limit per test 256 megabytes...原创 2019-03-15 20:51:52 · 223 阅读 · 0 评论 -
【思维好题!!!】问你a序列能否变成b序列,a[i]’=a[i-1]+a[i+1]-a[i] E Magic Stones
Codeforces Global Round 1E. Magic Stoneshttp://codeforces.com/problemset/problem/1110/E设:d1 = a[i]-a[i-1] d2 = a[i+1]-a[i]a[i] = a[i-1]+a[i]-a[i-1] = a[i-1]+d1a[i]'= a[i-1]+a[i+1]-a[i...原创 2019-03-02 14:17:42 · 373 阅读 · 0 评论 -
【DFS+思维】 GYM101620J Justified Jungle
http://codeforces.com/gym/101620/attachments #include <bits/stdc++.h>using namespace std;set <int> s;int head[1000005],to[2000005],nxt[2000005],Size[1000005],num[1000005];int tot,...原创 2018-11-08 21:05:53 · 233 阅读 · 0 评论 -
【数论+思维】 GYM101620F Faulty Factorial
http://codeforces.com/gym/101620/attachments给你n,p,r,(1<=n<=1e18,p是<=1e7的质数,r<p)n!中任选一个数换成比此数小的数,要求得到的新的乘积%p==r,问是否可以不可以输出 -1 -1,可以输出 a b,(把a换成b)分类讨论1、r==0,如果r==0, (1) 当n<...原创 2018-11-08 19:23:23 · 303 阅读 · 0 评论 -
【dfs+思维】ACM ICPC 2017–2018, NEERC – Northern Eurasia Finals Problem C. Connections
Problem C. Connectionshttp://codeforces.com/gym/101630给你n个点,m条有向边,问你只保留n-2*m条边,使整个图为全连通图请输出不要的边,special judgeDFS正着扫一遍,反着扫一遍,要是这条边都没被扫到,就可以不要了#include <bits/stdc++.h>using namespace s...原创 2018-11-07 13:32:54 · 537 阅读 · 1 评论 -
【DP + 思维】A Question of Ingestion Gym - 101673G
A Question of Ingestion Gym - 101673G给出n天,有一个饭量m。若连续吃饭 j 天则,每次能吃的量是m乘以(2/3)^ j 。或者你可以选择中途休息。若休息1天,则减少一个 j 次的2/3 。。若连续休息两天,则下一次又可以吃 m 的量。第二行给出的是当天能得到的最多的摄入量。你在当天得到的能量不能超出这个上限。询问最后能得到最大的能量总和。...原创 2018-11-01 21:30:37 · 303 阅读 · 0 评论 -
【DP+位运算+思维+异或子集合】 UVALive - 8518 G - Sum of xor sum
G - Sum of xor sum UVALive - 8518发现有问题代码出错了,vjudge上的数据不对,计蒜客上过不了如果有大佬看出哪里有问题的话,欢迎指导 感谢男朋友的悉心教导!!!给你n个数,进行Q次询问,每次询问都问你l-r区间内所有数的子集合的异或值之和%1e9+7首先s[]:存储前缀异或和:s[i]=s[i-1]^a[i],那么a[l]+a[l+...原创 2018-09-29 00:45:45 · 973 阅读 · 5 评论 -
【DFS+思维】HDU - 6228 L - Tree
L - Tree HDU - 6228Consider a un-rooted tree T which is not the biological significance of tree or plant, but a tree as an undirected graph in graph theory with n nodes, labelled from 1 to n. If yo...原创 2018-09-28 19:22:13 · 219 阅读 · 0 评论 -
牛客网 D.applese的生日 贪心++
D.applese的生日链接:https://www.nowcoder.com/acm/contest/80/D来源:牛客网题目描述 最可爱的applese生日啦,他准备了许多个质量不同的蛋糕,想请一些同学来参加他的派对为他庆生,为了不让一部分同学感到不爽,他决定把每个蛋糕都分割成几份(也可以不分割),使得最小的蛋糕的质量与最大的蛋糕的质量的比值不小于一个值。但是applese的刀功并不是很...原创 2018-05-12 17:35:24 · 253 阅读 · 0 评论 -
Codeforces Round #479 (Div. 3) F. Consecutive Subsequence (DP+map)
PROBLEMSSUBMITSTATUSSTANDINGSCUSTOM TESTF. Consecutive Subsequencetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an integer array o...原创 2018-05-11 19:00:31 · 179 阅读 · 0 评论 -
Codeforces Round #480 (Div. 2) B. Marlin
B. Marlintime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe city of Fishtopia can be imagined as a grid of 44 rows and an odd number of columns. I...原创 2018-05-11 14:50:43 · 158 阅读 · 0 评论 -
Codeforces Round #480 (Div. 2) C. Posterized
C. Posterizedtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputProfessor Ibrahim has prepared the final homework for his algorithm’s class. He asked ...原创 2018-05-10 20:58:27 · 156 阅读 · 0 评论 -
【组合数+思维】HDU6143 Killer Names
Killer Names HDU6143> Galen Marek, codenamed Starkiller, was a male Human apprentice of the Sith Lord Darth Vader. A powerful Force-user who lived during the era of the Galactic Empire, Marek or...原创 2019-07-10 18:08:31 · 159 阅读 · 0 评论