time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output — This is not playing but duty as allies of justice, Nii-chan! — Not allies but justice itself, Onii-chan! With hands joined, go everywhere a…
time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output 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…
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output 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 ash…
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Rock... Paper! After Karen have found the deterministic winning (losing?) strategy for rock-paper-scissors, her brother, Koyomi, comes up wit…
题意:给你三种不同颜色的点,每种若干(小于5000),在这些点中连线,要求同色的点的最短路大于等于3或者不连通,求有多少种连法. Examples Input 1 1 1 Output 8 Input 1 2 2 Output 63 Input 1 3 5 Output 3264 Input 6 2 9 Output 813023575 思路:从第一个样例来看点与点之间是可以不连通的,而且题目要求同色点的最短路大于等于3,也就是说两个同色的点不能连到同一点 上去.仔细想想,每个点是不影响整体的合…
C. The Intriguing Obsession time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output — This is not playing but duty as allies of justice, Nii-chan! — Not allies but justice itself, Onii-chan! With h…
[链接] 链接 [题意] 给你3种颜色的点. 每种颜色分别a,b,c个. 现在让你在这些点之间加边. 使得,同种颜色的点之间,要么不连通,要么连通,且最短路至少为3 边是无向边. 让你输出方案数 [题解] 求出a点集到b点集之间的连边方案数; 具体的,设dp[i][j]表示a点集个数为i,b点集个数为j时候的连边方案数. (可以不连) 则通过简单的dp就能算出来所有的dp.. (显然问题是独立的) 然后最后答案就是dp[a][b]dp[b][c]dp[a][c]; 即a到b之间的连边,b到c之间…
良心赛,虽然我迟了半小时233333. 比赛链接:#869. 呃,CF的比赛都是有背景的……上次是<哈利波特>,这次是<物语>…… [A]巧妙的替换 题意: Karen发现了石头剪刀布的决定性规律,看透了这个游戏的本质,使得石头剪刀布再无奥秘可言. 但是他的哥哥,Koyomi发明了一个新游戏: 他们先选定一个数\(n\),然后选出\(2n\)个互不相同的数,为\(x_{1},x_{2},\cdots,x_{n}\)和\(y_{1},y_{2},\cdots,y_{n}\). 接下来…
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are o…
Time limit per test1 second memory limit per test 256 megabytes input standard input output standard output For a given positive integer n denote its k-rounding as the minimum positive integer x, such that x ends with k or more zeros in base 10 and i…