随笔分类 - codeforces
摘要:[Codeforces Round #659 (Div. 1)] B. GameGame (博弈论) 思路: $cnt_i$代表这$\mathit n$个数中有多少个数在二进制表示中第$\mathit i$位为$\text 1$。 我们知道如果$cnt_i %2=0$,无论如何取,先手和后手在第$\
阅读全文
摘要:[Codeforces Round #656 (Div. 3)] (E. Directing Edges)拓扑排序 思路: 首先考虑给定的有向边构成的图就存在环的话,输出NO。 其他情况则一定可以有合法的方案,输出YES,然后先拿给定的那些有向边进行拓扑排序,设$id_i$为节点$\mathit i
阅读全文
摘要:[Codeforces Round #658 (Div. 1)] C. Mastermind(构造) In the game of Mastermind, there are two players — Alice and Bob. Alice has a secret code, which Bo
阅读全文
摘要:[Bubble Cup 12 - Finals [Div. 1]] -D. Xor Spanning Tree (仙人掌图扣环,FWT) 思路: 首先用类似Tarjan算法的方法把图中的每一个环单独的取出来。 我们知道不在环中的边一定要取的,所以可以求出$base$代表不在环中的边的权值异或和。 然
阅读全文
摘要:[Educational Codeforces Round 39 (Rated for Div. 2)] 题解 A. Partition 思路: 贪心 让正数都放入集合$\mathit B$,非正数都放入集合$\mathit C $即可。 代码: int n; ll a[maxn]; int mai
阅读全文
摘要:[Educational Codeforces Round 56 (Rated for Div. 2)] —G. Multidimensional Queries(二进制状压,线段树) Multidimensional Queries time limit per test 6 seconds me
阅读全文
摘要:Codeforces Round #628 (Div. 2)] D-Ehab the Xorcist 题意: 给定两个整数$u,v(0 \le u,v \le 10^{18})$ 让你构造一个长度$\mathit n$最小的数组$arr$,使其: 1、\(arr_1 \oplus arr_2 \op
阅读全文
摘要:[2015 HIAST Collegiate Programming Contest] 题解(AK) 简单的题或者我队友ac的题目没有写思路,只贴了代码, 自己ac的题目把题意和思路都说了一下,也贴上了代码。 [A - Who is the winner?] #include <bits/stdc+
阅读全文
摘要:CF GYM [2019 USP Try outs] 部分题解 "C Crystal Matryoshkas" 思路: 贪心策略: 首先使用$multiset$,这个优秀的容器来储存当前剩余的套娃重量。 假设当前要包含的套娃重量为$\mathit X$,那么: 如果存在比当前套碗重量轻的套娃,选择重
阅读全文
摘要:[Codeforces Round 642 (Div. 3)] ABCDEF题解 A. Most Unstable Array 思路: 当$n=1$时答案为$\text 0$, 当$n=2$时答案为$\mathit n$, 当$n=3$时答案为$2 n$, 代码: B. Two Arrays And
阅读全文
摘要:[NCD 2019] G. Ali and the Breakfast (解析几何) G. Ali and the Breakfast time limit per test 1 second memory limit per test 256 megabytes input standard in
阅读全文
摘要:[2019 ICPC Universidad Nacional de Colombia Programming Contest] 题解 A. Amazon Amazon has grown so much these days, it has decided to build its own sub
阅读全文
摘要:[Educational Codeforces Round 86 (Rated for Div. 2)] E. Placing Rooks (组合数学,容斥定律) E. Placing Rooks time limit per test 2 seconds memory limit per test
阅读全文
摘要:[Codeforces Round 636 (Div. 3)] E. Weights Distributing (BFS+最短路+贪心) E. Weights Distributing time limit per test 2 seconds memory limit per test 256 m
阅读全文
摘要:[Codeforces Round 320 (Div. 2) E. Weakness and Poorness (三分/二分) E. Weakness and Poorness time limit per test 2 seconds memory limit per test 256 megab
阅读全文
摘要:[Codeforces Round 320 (Div. 2) C. A Problem about Polyline (数学) C. A Problem about Polyline time limit per test 1 second memory limit per test 256 meg
阅读全文
摘要:[Codeforces Round 630 (Div. 2)] E. Height All the Same (组合数学) E. Height All the Same time limit per test 2 seconds memory limit per test 512 megabytes
阅读全文
摘要:[Codeforces Round 629 (Div. 3)] D. Carousel (分类讨论) D. Carousel time limit per test 2 seconds memory limit per test 256 megabytes input standard input
阅读全文
摘要:[Codeforces Round 498 (Div. 3)] F. Xor Paths (折半搜索) F. Xor Paths time limit per test 3 seconds memory limit per test 256 megabytes input standard inpu
阅读全文
摘要:[Educational Codeforces Round 72] A. Creating a Character (简单数学) A. Creating a Character time limit per test 1 second memory limit per test 256 megaby
阅读全文

浙公网安备 33010602011771号