Codeforces Round #439 (Div. 2) A B C】的更多相关文章

Codeforces Round #439 (Div. 2) codeforces 869 A. The Artful Expedient 看不透( #include<cstdio> int main(){ puts("Karen"); ; } 15ms codeforces 869B. The Eternal Immortality(数学,水) 题意:输出两个数的阶乘的商的 个位数 题解:两数之差大于5,个位数就是0.小于5直接个位相乘即可. #include<cs…
题目链接  Round 439 div2 就做了两道题TAT 开场看C题就不会 然后想了好久才想到. 三种颜色挑出两种算方案数其实是独立的,于是就可以乘起来了. E题想了一会有了思路,然后YY出了一种方案. 我们可以对每个矩形随机一个权值,然后用二维树状数组搞下. 询问的时候看两个点权值是否相等就可以了 于是就过了. D题待补 给出一棵完全二叉树,这棵树上有附带的m条边(m <= 4),求这张图的简单路径条数. qls的题就是厉害…… C题 #include <bits/stdc++.h>…
Adieu l'ami. Koyomi is helping Oshino, an acquaintance of his, to take care of an open space around the abandoned Eikou Cram School building, Oshino's makeshift residence. The space is represented by a rectangular grid of n × m cells, arranged into n…
— This is not playing but duty as allies of justice, Nii-chan! — Not allies but justice itself, Onii-chan! With hands joined, go everywhere at a speed faster than our thoughts! This time, the Fire Sisters — Karen and Tsukihi — is heading for somewher…
Even if the world is full of counterfeits, I still regard it as wonderful. Pile up herbs and incense, and arise again from the flames and ashes of its predecessor — as is known to many, the phoenix does it like this. The phoenix has a rather long lif…
Rock... Paper! After Karen have found the deterministic winning (losing?) strategy for rock-paper-scissors, her brother, Koyomi, comes up with a new game as a substitute. The game works as follows. A positive integer n is decided first. Both Koyomi a…
A. The Artful Expedient 题目链接:http://codeforces.com/contest/869/problem/A 题目意思:给你两个数列,各包含n个数,现在让你从上下两个数列中各取一个数a[i],b[j],如果a[i]^b[j]在这2×n个数里面出现过,那么就获得一分,问将任意的a[i],b[j]之间的亦或之后,如果分数是奇数则Koyomi胜利,否则Karen胜利.问最后到底谁胜了. 题目思路:非常无聊的题目,暴力都可以过,就是暴力枚举a[i],b[j],把所有答…
2018年11月30日更新,补充了一些思考. 题意(CodeForces 869C) 三堆点,每堆一种颜色:连接的要求是同色不能相邻或距离必须至少3.问对整个图有几种连接方法,对一个数取模. 解析 要求很重要:同色不能相邻很容易理解,但是>=3比较难理解.比较常见的是R->G->B->R,这样能看出来一个重要的结论:对单个节点只能连接某个颜色至多一个点(不然一定有距离为2的点).这样一来我们思考一下状态会和哪些东西有关联:如果我放一个一个新颜色在里面,它会怎么同原图产生联系?一是和…
E. The Untended Antiquity 题目链接http://codeforces.com/contest/869/problem/E 解题心得: 1.1,x1,y1,x2,y2 以(x1,y1)为左上角(x2,y2)为右下角的矩形,四边建墙.      2,x1,y1,x2,y2 以(x1,y1)为左上角(x2,y2)为右下角的矩形,拆除墙(肯定存在).      3,x1,y1,x2,y2问是否可以从(x1,y1)走到(x2,y2)(没墙阻隔). 2.先要标记每个点的状态,将用墙…
C. The Intriguing Obsession 题目链接http://codeforces.com/contest/869/problem/C 解题心得:     1.由于题目中限制了两个相同颜色的点之间长度至少为3,这样就只能两两不同颜色的点相互组合,再将三种组合情况的可能种数乘起来.     2.然后就是两个不同颜色的点怎么组合的问题,这就是一个记忆化搜索(DP),假如红色点和黄色点相互组合,这样一个红色点可以对应一个黄色点(dp[x][y] = dp[x-1][y-1]*y),或者…