随笔分类 - Codeforces
摘要:链接:https://codeforces.com/contest/1175/problem/A 题意: You are given an integer nn and an integer kk. In one step you can do one of the following moves:
阅读全文
摘要:链接:https://codeforces.com/contest/1174/problem/C 题意: You're given an integer nn. For every integer ii from 22 to nn, assign a positive integer aiai su
阅读全文
摘要:链接:https://codeforces.com/contest/1174/problem/B 题意: You're given an array aa of length nn. You can perform the following operation on it as many time
阅读全文
摘要:链接:https://codeforces.com/contest/1174/problem/A 题意: You're given an array aa of length 2n2n. Is it possible to reorder it in such way so that the sum
阅读全文
摘要:链接:https://codeforces.com/contest/1169/problem/C 题意: Toad Zitz has an array of integers, each integer is between 00 and m−1m−1 inclusive. The integers
阅读全文
摘要:链接:https://codeforces.com/contest/1169/problem/B 题意: Toad Ivan has mm pairs of integers, each integer is between 11 and nn, inclusive. The pairs are (
阅读全文
摘要:链接:https://codeforces.com/contest/1169/problem/A 题意: The circle line of the Roflanpolis subway has nn stations. There are two parallel routes in the s
阅读全文
摘要:链接:https://codeforces.com/contest/1167/problem/D 题意: A string is called bracket sequence if it does not contain any characters other than "(" and ")".
阅读全文
摘要:链接:https://codeforces.com/contest/1167/problem/C 题意: In some social network, there are nn users communicating with each other in mm groups of friends.
阅读全文
摘要:链接:https://codeforces.com/contest/1167/problem/B 题意: This is an interactive problem. Remember to flush your output while communicating with the testin
阅读全文
摘要:链接:https://codeforces.com/contest/1167/problem/A 题意: A telephone number is a sequence of exactly 11 digits, where the first digit is 8. For example, t
阅读全文
摘要:链接:https://codeforces.com/contest/1166/problem/C 题意: The legend of the foundation of Vectorland talks of two integers xx and yy. Centuries ago, the ar
阅读全文
摘要:链接:https://codeforces.com/contest/1166/problem/B 题意: Tom loves vowels, and he likes long words with many vowels. His favorite words are vowelly words.
阅读全文
摘要:链接:https://codeforces.com/contest/1166/problem/A 题意: There are nn students in the first grade of Nlogonia high school. The principal wishes to split t
阅读全文
摘要:链接:https://codeforces.com/contest/1141/problem/D 题意: 给连个n长度的字符串。 求两个字符串相同字符对应位置的对数,并挨个打印。 字符:?可以代替任何字符。 思路: 对第一个字符串建立字符与位置的映射。 再处理第二个字符。 同时第二个字符中的‘?'不
阅读全文
摘要:链接:https://codeforces.com/contest/1141/problem/C 题意: 给n-1个数, qi=pi+1−pi p为1-n的排列序列 q为给的序列。 根据q求出p, 求不出时为-1。 思路: 另p数组首个为0.求出p数组,再得到p数组中最小的值,将p中所有数减掉最小值
阅读全文
摘要:链接:https://codeforces.com/contest/1141/problem/B 题意: 给n个数,0代表工作,1代表休息,求能连续最大的休息长度。 可以连接首尾。 思路: 求普通连续,当第一个时间和最后一个时间都休息的时候加上去判断一下。 代码:
阅读全文
摘要:链接:https://codeforces.com/contest/1141/problem/A 题意: 给n和m,有两种操作:将n×2 或 n×3,求最少的乘法次数由n得到m。 不能得到时为-1。 思路: 先判断是否为整数倍。 再将倍数不断除以2和3。 最后剩下1则可以达到否则-1。 代码:
阅读全文
摘要:链接:https://codeforces.com/contest/1136/problem/C 题意: 给两个矩阵,求能否通过矩阵转置从第一个矩阵变成第二个矩阵。 转置即i变成j。 思路: 因为无论怎么转,只要对角线上的各个值没有改变,即可以。 比赛的时候没想完全,一直把值加起来。。。 代码:
阅读全文
摘要:链接:https://codeforces.com/contest/1136/problem/B 题意: 有n个井盖,每个井盖上有一个小石头。 给出n和k,k表示刚开始在第k个井盖上方。 有三种操作,左右移动,扔石头到任意一个井盖,下到井盖里拿金币。 只有井盖上没有石头才能下井盖。 求捡完全部金币的
阅读全文

浙公网安备 33010602011771号