Codeforces-855A - Tom Riddle's Diary - 水题
题目: Harry Potter is on a mission to destroy You-Know-Who’s Horcruxes. The first Horcrux that he encountered in the Chamber of Secrets is Tom Riddle’s diary. The diary was with Ginny and it forced h...
题目: Harry Potter is on a mission to destroy You-Know-Who’s Horcruxes. The first Horcrux that he encountered in the Chamber of Secrets is Tom Riddle’s diary. The diary was with Ginny and it forced h...
题目: You are given an array of n integer numbers. Let sum(l, r) be the sum of all numbers on positions from l to r non-inclusive (l-th element is counted, r-th element is not counted). For indices l...
题目: Polycarp takes part in a math show. He is given n tasks, each consists of k subtasks, numbered 1 through k. It takes him tj minutes to solve the j-th subtask of any task. Thus, time required t...
题目: Hideo Kojima has just quit his job at Konami. Now he is going to find a new place to work. Despite being such a well-known person, he still needs a CV to apply for a job. During all his career...
题目: Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is divisible by each of its nonzero digits. We will not ar...
题目: 题目描述 作为一只明媚的兔子,需要学会叠被子… 被子是方形的,上面有很多小写字母.可以认为被子是一个n*m的字符矩阵 被子能够被叠起来,当且仅当每一行,每一列都是回文串. 兔子可以把同一条被子上任意两个位置的字母交换位置,而且兔子不嫌麻烦,为了把被子叠起来它愿意交换任意多次.但是兔子不能交换两条不同的被子之间的字母. 现在兔子翻箱倒柜找出来了很多被子,请你帮兔子判断每条被子能否被叠...
题目: 题目描述 做一只明媚的兔子… 兔子都比较喜欢蹦蹦跳跳.但是蹦蹦跳跳的时候如果一直往高处跳的话就太累了,如果一直往低处跳的话就太无聊了.所以兔子希望跳的时候能够往上跳一步,往下跳一步,往上跳一步,往下跳一步….一共经过n个高度互不相同的位置(只要向上跳和向下跳相间分布就可以了,第一步可以往上跳也可以往下跳).如果下一个位置的高度比前一个位置高,就是往上跳,比前一个位置低,就是往下跳....
简介 BSGS算法,原名Baby Steps Giant Steps,又名大小步算法,拔山盖世算法,北上广深算法——by SLYZoier,数论基本算法之一。 问题 给定$A,B,C$,求满足 $A^x \equiv B\ (mod\ C)$ 的最小非负整数$x$。 模板 ## include <bits/stdc++.h> typedef long long ...
题目: 题目描述 辣鸡 ljh NOI 之后就退役了,然后就滚去学文化课了。 他发现 katarina 大佬真是太强了,于是就学习了一下 katarina 大佬的做题方法。 比如这是一本有 n 道题的练习册, katarina 大佬每天都会做 k 道题。 第一天做第 1~k 题,第二天做第 2~k + 1 题……第 n − k + 1 天做第 n − k + 1~n 道题。 ...
题目: Description a180285非常喜欢滑雪。他来到一座雪山,这里分布着M条供滑行的轨道和N个轨道之间的交点(同时也是景点),而且每个景点都有一编号i(1<=i<=N)和一高度Hi。a180285能从景点i 滑到景点j 当且仅当存在一条i 和j 之间的边,且i 的高度不小于j。 与其他滑雪爱好者不同,a180285喜欢用最短的滑行路径去访问尽量多的景点。如果仅仅访...