随笔分类 - 思维
摘要:2018 ICPC Asia Nakhon Pathom Regional Contest-F.Lucky Pascal Triangle(杨辉三角,递归,分治,规律) 题意: 问杨辉三角$[0,n]$行有多少个数是7的倍数,\(n\leq 10^{18}\)。 思路: 下图中1代表该数是7的倍数,
阅读全文
摘要:The 2020 ICPC Asia Taipei-Hsinchu Site Programming Contest-C题 Pyramid (思维,递推,规律) 题意: 一个n*n的矩阵,取其上三角矩阵,每个点的初值为L,左上角为起点,每次在起点放入一个球,如果当前点为L,则向下走,若为R,则向右走
阅读全文
摘要:[2016-2017 ACM-ICPC CHINA-Final]-Problem H. Great Cells 题面: 题意: 给定$n,m,k$三个数,代表有一个$n*m$的方格,每一个方格中有一个在范围$[1,k]$的数, 其中,若一个数$a_{i,j}$,比其所在行和所在列中其他的都大,则成为
阅读全文
摘要:[Educational Codeforces Round 99 (Rated for Div. 2)]-E. Four Points(枚举,贪心,思维) 题面: 题意: 每组数据给定四个二维平面上的点,每一次操作:你可以选择一个点将其移动到上下左右四个方向中的一个点。 现在问你最少多少次操作,可以
阅读全文
摘要:[HDU - 5963 ]朋友 (树上博弈,思维) 题目链接: HDU - 5963 题面: 思路: 我们通过推理应该知道如下性质: 对于根节点的每一个子树,操作上互不干扰。而且玩家的任何操作没有技巧性,即两人随便操作不影响最终的赢家。 对于根节点每一个边权为1的儿子,想将该整个子树完全变为0,需要
阅读全文
摘要:[A - Balloon Robot] [ZOJ - 3981 ] (思维,枚举) 题目链接:(https://vjudge.net/problem/ZOJ-3981/origin) 题面: 题意: 有一个座位号为$[1,m]\(的圆形桌子,\)\mathit n$个参赛队员,第$\mathit i
阅读全文
摘要:[Codeforces Round #679 (Div. 2)] D. Shurikens (思维,树状数组) 题面: 题意: 现在有价格分别为$[1,n]$的武器,以及2种操作。 +意味着店主拿一个武器放在展台; -x意味客户买了价格为$\mathit x$的武器。 初始时展台为空,且客户们总是买
阅读全文
摘要:HDU-6793 - Tokitsukaze and Colorful Tree (dfs序列,树状数组,离线) 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6793 题面: 思路: 首先分析答案的计算公式: node v is not an anc
阅读全文
摘要: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
阅读全文
摘要:牛客练习赛65 - C 二维动点 (几何,思维) 链接:https://ac.nowcoder.com/acm/contest/5961/C 来源:牛客网 题目描述 一个二维平面上有n个点(ai,bi)(a_i,b_i)(ai,bi),在一次移动中,你可以选择一个不和当前所在位置重叠的点,然后可以移
阅读全文
摘要:[Codeforces Round 629 (Div. 3)] D. Carousel (分类讨论) D. Carousel time limit per test 2 seconds memory limit per test 256 megabytes input standard input
阅读全文
摘要:[AtCoder Beginner Contest 151] E Max Min Sums (预处理组合数学,贡献) Problem Statement For a finite set of integers XX, let f(X)=maxX−minXf(X)=maxX−minX. Given
阅读全文
摘要:2020牛客寒假算法基础集训营4 H 坐火车 (桶,树状数组) 链接:https://ac.nowcoder.com/acm/contest/3005/H 来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Form
阅读全文
摘要:[Codeforces Round 611 (Div. 3)] C. Friends and Gifts (随机大法好) C. Friends and Gifts time limit per test 2 seconds memory limit per test 256 megabytes in
阅读全文
摘要:[Hello 2020] D. New Year and Conference (ST表,排序) D. New Year and Conference time limit per test 2 seconds memory limit per test 1024 megabytes input s
阅读全文
摘要:[Educational Codeforces Round 81 (Rated for Div. 2)]E. Permutation Separation(线段树,思维,前缀和) E. Permutation Separation time limit per test 2 seconds memo
阅读全文
摘要:[Educational Codeforces Round 81 (Rated for Div. 2)] D. Same GCDs (数论,因子分解,容斥定理) D. Same GCDs time limit per test 2 seconds memory limit per test 256
阅读全文
摘要:[Educational Codeforces Round 81 (Rated for Div. 2) C. Obtain The String(序列自动机,贪心) C. Obtain The String time limit per test 1 second memory limit per
阅读全文
摘要:Educational Codeforces Round 81 B. Infinite Prefixes B. Infinite Prefixes time limit per test 2 seconds memory limit per test 256 megabytes input stan
阅读全文
摘要:Codeforces Round 615 (Div. 3) F. Three Paths on a Tree 题目链接:https://codeforces.com/contest/1294/problem/F time limit per test 2 seconds memory limit p
阅读全文

浙公网安备 33010602011771号