
CF
hohotiger
这个作者很懒,什么都没留下…
展开
-
codeforce.Vladik and flights
A. Vladik and flightstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVladik is a competitive programmer. T原创 2017-01-14 11:11:24 · 277 阅读 · 0 评论 -
CF 1174 D. Ehab and the Expected XOR Problem 异或技巧
题意就是给我们两个数n,x。让我们构造个数组,数组有三个条件1.要有尽可能多的元素2.要其中任何一段数字的异或和不等于0和x3.元素的范围是[ 1, 2n2^n2n)分析:如果对异或足够敏感的话 应该能想到其中第二个条件的意思,其实就是说目标数组中的元素的异或前缀和不能有相等的两个数,如果有相等的两个异或和说明其中可以中间的一段数是可以用异或得到0的,也就是违反了条件2。那么对于x,其实...原创 2019-06-13 22:18:38 · 235 阅读 · 0 评论 -
Increasing Subsequence (hard version) CodeForces - 1157C2
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe only difference between problems C1 and C2 is that all values in input of prob...原创 2019-05-10 19:44:56 · 288 阅读 · 0 评论 -
Serval and Parenthesis Sequence CodeForces - 1153C 贪心
题意:给出一个由"(",")","?"三种字符构成的序列,让我们把其中的问号替换成左右括号,使得整个序列变成一个完整地括号序列,也就是括号匹配正确,而且要求不能提前结束的括号序列,比如(())()...这种的就是提前结束的括号序列,一定要让整个序列的最后一个右括号字符正好匹配上字符串的第一个左括号字符。输出任意一种方案。分析:首先想到奇数长度的时候必定错误,第一个括号是),或最后一个括号...原创 2019-05-06 15:34:10 · 170 阅读 · 0 评论 -
Vasya and Multisets CodeForces - 1051C 模拟|分类讨论
题意:把数组分成两个集合 每个集合中元素数量为1的个数相同(此个数可以是0)分析: 这类问题就是要各种可能情况考虑到 然后分类讨论 完整地正确分类就AC 否则gg 如果数量为1的元素数为偶数个 对半分 如果元素数量为1的元素数为奇数个 分类讨论 如果有元素数>=3的元素 抽一个分到少的那一半 如果没有 就输出NO C...原创 2019-03-01 16:31:59 · 174 阅读 · 0 评论 -
codeforce 980B - Marlin 思维|构造
import java.io.BufferedInputStream;import java.io.BufferedOutputStream;import java.io.PrintWriter;import java.util.ArrayList;import java.util.Arrays;import java.util.HashSet;import java.util.Sca...原创 2018-05-16 10:09:19 · 221 阅读 · 0 评论 -
Codeforce 980 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-19 11:20:16 · 220 阅读 · 0 评论 -
Codeforce Flea CodeForces - 32C 规律|思维
题意给我们一个n*m的表格 告诉我们每次跳跃的格子数量s 只能垂直或者水平跳跃 可以跳跃无限次 那么某格子能到达的不同格子的数量就是这个格子的值 求表格中值最大的格子的数量分析表面上看像是搜索 然而1e6的数据搜索行不通 其实分析下是个规律题 也就是符合能够互相抵达的格子最多的在一个表格中是符合某种计算规律的 我们发现 任意一个表格 都可以根据不同的跳跃数量得到规律从而计算出如果在表格中尽可能原创 2018-03-01 22:06:02 · 274 阅读 · 0 评论 -
Levko and Permutation CodeForces - 361B 思维 数论
题意对一个长度,最大值为n的排列 构造出其恰好有k个GCD(i,a[i])>1 的排列 n<=1e5;分析由于每个大于1的数与自己的gcd必然>1 所以构造大于1的gcd可以用i与i去构造那么还有就是相邻的两个数的gcd必然等于1任何数与1的gcd都等于1所以让k个数 从2开始使得a[i] = i 并且后面的数填比自己下标大1的数多的从前面补上 当k+1<=n的情况都有解code#原创 2017-12-13 17:17:41 · 149 阅读 · 0 评论 -
CF Vicious Keyboard 构造水题
分析为了防止出错 这里要注意 为了防止VK判断的时候 不影响其他的判断 对于一个VK 我们最好不要把他删掉 就直接把原来的VK覆盖掉 然后对于剩下的可能 最多只能增加一个VK 就是通过 目标条件判断 #include<bits/stdc++.h>using namespace std;int main(){ string l; getline(cin,l);原创 2017-11-23 21:59:17 · 389 阅读 · 0 评论 -
CF#420 B. Okabe and Banana Trees 思维|暴力|几何
Okabe needs bananas for one of his experiments for some strange reason. So he decides to go to the forest and cut banana trees.Consider the point (x, y) in the 2D plane such thatx and y are intege原创 2017-11-12 23:32:41 · 243 阅读 · 0 评论 -
CodeForces 841B (B) 博弈
标题定义A把取数列中区间和为奇数的元素取出来 B把数列中区间长度为偶数的区间删除 那么谁先面临无数可拿的局面 A先取分析分析可知本题如果区间中每一个数是偶数那么B可以一次取完 则A不能取 B赢 如果区间中有奇数 那么如果奇数有奇数个 那么A可以一次性取完 A赢 如果区间中奇数有偶数个 那么A可以取奇数个奇数 偶数-奇数=奇数 剩下序列和为奇数的情况 如果序列中有偶数 B只能取其中的偶数 那原创 2017-11-18 12:08:25 · 292 阅读 · 0 评论 -
Codeforces Round #413 C-Fountains 树状数组
题意本题给我们给我们两种货币初始金额 每种货币分别对应能买不同种类的喷泉 每个喷泉有花费和价值 问我们如果单纯建造两个喷泉在限定金额内的最大值分析考虑一下 发现有三种情况 1 两个喷泉从coin中里建造 2 两个喷泉从diamond中建造 3 一边一个 4 输出0 表示找不出两个合法的可行解 第3,4种情况还好判断 就是在两边一遍选一个金额限度中价值最大的原创 2017-11-18 11:36:37 · 157 阅读 · 0 评论 -
Codeforce-839B Game of the Rows 思维
B. Game of the Rowstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDaenerys Targaryen has an army consistin原创 2017-08-14 12:03:34 · 242 阅读 · 0 评论 -
CodeForces - 505A B - Mr. Kitayuta's Gift
A. Mr. Kitayuta's Gifttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMr. Kitayuta has kindly given you a string s consisting of lowercas原创 2017-02-27 10:30:10 · 310 阅读 · 0 评论 -
Codeforces Round #401 (Div. 2) B. Game of Credit Cards
B. Game of Credit Cardstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAfter the fourth season Sherlock and Moriary原创 2017-02-25 23:30:14 · 257 阅读 · 0 评论 -
Codeforces Round #401 (Div. 2) A.shell game
A. Shell Gametime limit per test0.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBomboslav likes to look out of the window in his room原创 2017-02-25 22:21:57 · 256 阅读 · 0 评论 -
CF1174C. Ehab and a Special Coloring Problem 质因子|互质问题
time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou're given an integernn. For every integeriifrom22tonn, assign a positive i...原创 2019-06-15 21:31:50 · 318 阅读 · 0 评论