首页 > TAG信息列表 > Polycarp
【CF1512F Education】题解
题目链接 题目 有一个长度为 \(n\) 的数组 \(a\) 和一个长度为 \(n−1\) 的数组 \(b\),初始位置为 \(pos=1\),每一天可以选择得到 \(a_{pos}\)元钱,或者花费 \(b_{pos}\)元钱(钱数不能为负)使得 \(pos\leftarrow pos+1\) 现在希望买一台 \(c\) 元的电脑,最少需要多少天。 Polycarp is woCards Sorting
技巧: 有负数,要用数组就统一加一个大的数(更具题目)map可能会影响时间 对于本题牢牢利用每一个值不一样, Polycarp watched TV-show where k jury members one by one rated a participant by adding him a certain number of points (may be negative, i. e. points were subtracCF1618A Polycarp and Sums of Subsequences 题解
题目大概是 「USACO21OPEN」 Do You Know Your ABCs? 的弱化版 题目大意 给出 7 个数, 他们分别代表 \[a, b, c, a + b, a + c, b + c, a + b + c \]下文中用 \(A\) 数组表示输入的数。 求 \(a, b, c\)。 注意:那7个数是经过排序的, 所以答案不一定是\(A_1,A_2,A_3\) 题解 可以发现,Codeforces Round #762 (Div. 3) B. Squares and Cubes
题目链接:Problem - B - Codeforces Polycarp likes squares and cubes of positive integers. Here is the beginning of the sequence of numbers he likes: 1, 4, 8, 9, .... For a given number n, count the number of integers from 1 to n that Polycarp likes.Codeforces Round #756 (Div. 3) A. Make Even
题目链接:Problem - 1611A - Codeforces Polycarp has an integer nn that doesn't contain the digit 0. He can do the following operation with his number several (possibly zero) times: Reverse the prefix of length l (in other words, ll leftmost digits) ofCodeforces Round #756 (Div. 3) (AB题解)
A. Make Even time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Polycarp has an integer nn that doesn't contain the digit 0. He can do the following operation with his number several (possiCodeforces Round #739 (Div. 3) A. Dislike of Threes
题目链接:Problem - A - Codeforces Polycarp doesn't like integers that are divisible by 33 or end with the digit 33 in their decimal representation. Integers that meet both conditions are disliked by Polycarp, too. Polycarp starts to write out the positivE. Polycarp and String Transformation(构造)
E. Polycarp and String Transformation(构造) 题目:E. Polycarp and String Transformation 题目链接:https://codeforces.com/contest/1560/problem/E 题意:有一个字符串s,对它进行操作,直到字符串为空。每次操作,可以把字符串s添加到字符串t的尾部,然后删除s的一种字符。给定字符串t,求字Codeforces Round #739 (Div. 3) E. Polycarp and String Transformation
题目传送门 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=1e5; int a[N]; void solve(){ string s,s1,s2; cin>>s; set<char> st; for(int i=s.length()-1;i>=0;i--){ if(!st.count(s[i])){Codeforces1560E Polycarp and String Transformation(思维)
题目链接 题目大意 给你一个初始字符串s,你可以删除字符串s中的某个字符(比如删除'a'就是把s中的所有'a'删掉)得到一个字符串t,把t拼接到s后面,再在t中删除其他字符,继续拼接到s后面直到t为空,给你最后拼接出的数字,让你还原原来的数字并输出字符的删除顺序。 解题思路 感觉输出CF1560 E. Polycarp and String Transformation(思维 枚举)
E. Polycarp and String Transformation 点击跳转 题意: 假设有一个字符串\(s\),字符串\(t\)开始为空; 每次执行一个过程,第一步是另\(t=t+s\),第二步是删去\(s\)中的全部的某字母。 重复执行两个步骤,直到\(s\)为空。 现在给出\(t\)串,输出\(s\)串和对应的字母删除顺序。 思路: 赛时一CF858D Polycarp's phone book
题意翻译 有 n 个长度为 9 且只包含数字字符互不相同的串。 需要对于每个串找到一个长度最短的识别码,使得这个识别码当且仅当为这个串的子串。 题目分析 因为范围不是非常大,所以可以将子串筛出来 然后用STL统计即可 #include<bits/stdc++.h> using namespace std; int n; string s2021-03-06
D - Last Year’s Substring 补题 Polycarp has a string s[1…n] of length n consisting of decimal digits. Polycarp performs the following operation with the string s no more than once (i.e. he can perform operation 0 or 1 time): Polycarp selects two numberCodeforces Round #690 (Div. 3) 题解(A-E2)
A. Favorite Sequence 题目 Polycarp has a favorite sequence a[1…n] consisting of n integers. He wrote it out on the whiteboard as follows: he wrote the number a1 to the left side (at the beginning of the whiteboard); he wrote the number a2 to the right sidecodeforces 1005D - Polycarp and Div 3 (dp)
题目链接:https://codeforces.com/problemset/problem/1005/D 从前到后考虑每一个元素,当前元素一定是接在上一组连续的序列的末尾(或者是一个新数列的开头), 那么就设状态 \(dp[i][0/1/2]\) 表示以 i 结尾的模 3 余 0/1/2 的数字序列是否存在 如果已经可以整除 3 ,那么记录当前数列(贪心棋子游戏
棋子游戏 题目 波雷卡普和瓦西里喜欢简单的逻辑游戏。今天他们玩了一个游戏,这个游戏在一个很大的棋盘上进行,他们每个人有一个棋子。他们轮流移动自己的棋子,波雷卡普先开始。每一步移动中,波雷卡普可以将他的棋子从(x,y) 移动到 (x-1,y) 或者 (x,y-1)。而瓦西里可以将他的棋子从(x,yCodeforces Round #625 (Div. 2) A ~ D
A. Contest for Robots time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Polycarp is preparCodeforces补题2020.3.2 (Round625 Div2)
A.Contest for Robots Polycarp正在筹备第一届机器人编程竞赛。其中有n个问题,许多机器人都将参与其中。每个解决我的问题的机器人都会得到pi积分,竞赛中每个机器人的得分将计算为我解决的所有问题的pi的总和。对于每个问题,pi是一个不小于1的整数。 两家专门解决问题的机器人制造公A. Collecting Coins
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Polycarp has three sisters: Alice, Barbara, and Cerene. They're collecting coins. Currently, Alice has aa coins, Barbara has bb coins and Cecodeforces 1294A Collecting Coins
A. Collecting Coins time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Polycarp has three sisters: Alice, Barbara, and Cerene. They’re collecting coins. Currently, Alice has a coins, Barbara has bCF1277A. Happy Birthday, Polycarp! 题解 枚举/数位DP
题目链接:http://codeforces.com/contest/1277/problem/A 题目大意: 求区间 \([1,n]\) 范围内有多少只包含一个数字的数。 比如:\(1,77,777,44,999999\) 都是只包含一个数字的数,而 \(12,11110,6969,987654321\) 这些不是。 解题思路: 本题可以采用枚举和数位DP解法来解决(当然,数位DP相CodeForces 1005D Polycarp and Div 3(思维、贪心、dp)
http://codeforces.com/problemset/problem/1005/D 题意: 给一个仅包含数字的字符串,将字符串分割成多个片段(无前导0),求这些片段里最多有多少是3的倍数 思路一(贪心): from:https://blog.csdn.net/islittlehappy/article/details/81006849 一个数是3的倍数,则各位的和能CF Round #592 (Div. 2) 题解
Problem - A Tomorrow is a difficult day for Polycarp: he has to attend \(a\) lectures and \(b\) practical classes at the university! Since Polycarp is a diligent student, he is going to attend all of them. While preparing for the university, PolycarpEmail from Polycarp (模拟)
题目链接:http://codeforces.com/problemset/problem/1185/B 题目大意:Methodius想发一封邮件给他的朋友(应还要打印出来),但是它的键盘坏了,请你判断从键盘输入的内容,是否能按照他的想法打印出来(打印规则是可以输入重复的字符,打印机会过滤掉多余的重复字符,但是不能有不同的字符出现,这Codeforces Round #570 (Div. 3 )A
A. Nearest Interesting Number 题目链接:http://codeforces.com/contest/1183/problem/A 题目: Polycarp knows that if the sum of the digits of a number is divisible by 3, then the number itself is divisible by 3. He assumes that the numbe