
ACM_思维题
Rotepad
语言表述能力不行,在前面解释的不清,但是在代码中基本上每一个难懂的语句都在旁边有注释进行解释。
因为个人习惯带着代码去看题解,所以习惯把题解切入代码中,所以希望大家不要看到没什么解释就不看了,实际上后面的代码写的很详细
展开
-
Codeforces-343B-Alternating Current
题目:Mad scientist Mike has just finished constructing a new device to search for extraterrestrial intelligence! He was in such a hurry to launch it for the first time that he plugged in the power wir...原创 2019-07-22 15:59:27 · 279 阅读 · 0 评论 -
Codeforces-343A-Rational Resistance
题目:outputstandard outputMad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value.However, all Mike has is lots o...原创 2019-07-22 15:51:45 · 282 阅读 · 0 评论 -
Codeforces - 66D - Petya and His Friends(数论质数+思维)
题目:Little Petya has a birthday soon. Due this wonderful event, Petya's friends decided to give him sweets. The total number of Petya's friends equals ton.Let us remind you the definition of the g...原创 2019-08-05 02:27:56 · 332 阅读 · 0 评论 -
Gym - 101972H - Beautiful Substrings(思维)
题目:传送门代码:#include <bits/stdc++.h>using namespace std;int main(){ int T; scanf("%d", &T); while (T--) { char a[100005], b[100005]; int aa, bb, c; ...原创 2019-08-06 00:40:01 · 233 阅读 · 0 评论 -
CodeForces - 721D - Maxim and Array (贪心+优先队列)
题目:Recently Maxim has found an array ofnintegers, needed by no one. He immediately come up with idea of changing it: he invented positive integerxand decided to add or subtract it from arbitrary...原创 2019-08-09 00:24:31 · 264 阅读 · 0 评论 -
Codeforces-734C-Anton and Making Potions(思维+二分)
题目:戳一戳题解:哎,当时真没想到会要二分啊,不过加深了自己对lower_bound跟upper_bound的理解,先找到直接生成的。然后通过暴力(结合二分)去求解。代码:#include<bits/stdc++.h>#define LL long long#define N 200005using namespace std;int m,k;LL n,x,s,...原创 2019-08-11 20:13:46 · 205 阅读 · 0 评论 -
CodeForces - 849A - Odds and Ends(思维)
题目:CodeForces - 849A 题意:给定一个序列,问能否将其划分为奇数个子序列,并且每个子序列都是奇数个,并且每个子序列的头尾元素都是奇数。题解:想复杂了。1. n个数,如果首尾为偶数,那么肯定不行2. n个数,有奇数段,每段有奇数个,那么肯定满足总数n也为奇数,这样的话就说明让他本身为一个序列就可以满足了,所以当首尾为奇数时,直接判断n是否为奇数就行代码:...原创 2019-08-22 16:59:19 · 246 阅读 · 0 评论