![](https://img-blog.csdnimg.cn/2020040316055658.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
CodeForces
文章平均质量分 75
分享codeforces的思路
WA怪
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #716 (Div. 2)
Codeforces Round #697 (Div. 3)A.Odd Divisor题意:判断一个数是否有大于1的因数思路:一个数可以分解成若干个质数的乘积。在这些质数当中,只有2是偶数,其他数都是奇数,也就是说如果一个数分解成若干个质数,这些质数都是2(即这个数为2^n),那么不满足条件;否则就满足条件。ac代码:#include <iostream>#include<cstdio>#include<cstring>#include<strin原创 2021-01-26 20:54:28 · 143 阅读 · 0 评论 -
codeforces #round706 div2
A.Split it!题意:给你一个字符串s,和一个参数k,问是否存在k+1个非空子串a1a_1a1,a2a_2a2,…aka_kak,ak+1a_{k+1}ak+1使得s=a1+a2+...+ak+ak+1+R(ak)+...+R(a2)+R(a1).s=a_1+a_2+...+a_k+a_{k+1}+R(a_k)+...+R(a_2)+R(a_1).s=a1+a2+...+ak+ak+1+R(ak)+...+R(a2)+R(a1).R(S)表示将字符串逆转,如R(abcd)=d原创 2021-03-14 21:01:23 · 226 阅读 · 0 评论 -
Codeforces Round #684 (Div. 2) C1. Binary Table (Easy Version)
C1. Binary Table (Easy Version)题意:有n*m个0,1组成的 数字矩阵,每次你可以选择一个大小为2 * 2的小方格,选择其中三个元素,对1进行异或运算(0变成1,1变成0)思路:可以根据方格中的1的个数,分成5种情况,易得,第2种跟第3种情况第一步是一样的,可以归为一种。代码:#include <iostream>#include<cstdio>#include<cstring>#include<vector>原创 2020-11-18 20:50:51 · 192 阅读 · 0 评论 -
Codeforces Round #683 (Div. 2)
Codeforces Round #683 (Div. 2, by Meet IT)A. Add Candiestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are nn bags with candies, initially the ii-th bag contains ii candies. You want all原创 2020-11-16 20:35:58 · 340 阅读 · 0 评论 -
cf Round #652 (Div. 2) B题
B. AccurateLeetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLee was cleaning his house for the party when he found a messy string under the carpets. Now he’d like to make it clean accurately and原创 2020-06-24 22:43:18 · 279 阅读 · 0 评论 -
cf Round #652 (Div. 2) C题
C.RotionalLeetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLee just became Master in Codeforces, and so, he went out to buy some gifts for his friends. He bought n integers, now it’s time to dist原创 2020-06-24 22:17:53 · 248 阅读 · 0 评论 -
cf Round #646 (Div. 2)C题
C. Game On Leavestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAyush and Ashish play a game on an unrooted tree consisting of n nodes numbered 1 to n. Players make the following move in turns:Se原创 2020-06-01 19:35:20 · 316 阅读 · 0 评论 -
cf Round #646 (Div. 2) B题
B. Subsequence Hatetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputShubham has a binary string s. A binary string is a string containing only characters “0” and “1”.He can perform the following ope原创 2020-06-01 19:19:49 · 261 阅读 · 0 评论 -
cf Round #646 (Div. 2)A题
A. Odd Selectiontime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputShubham has an array a of size n, and wants to select exactly x elements from it, such that their sum is odd. These elements do not ha原创 2020-06-01 19:03:47 · 213 阅读 · 0 评论 -
cf Round #640 (Div. 4)D题
D. Alice, Bob and Candiestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n candies in a row, they are numbered from left to right from 1 to n. The size of the i-th candy is ai.Alice and原创 2020-05-10 11:06:46 · 250 阅读 · 0 评论 -
cf Round #640 (Div. 4) C题
C. K-th Not Divisible by ntime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two positive integers n and k. Print the k-th positive integer that is not divisible by n.For example, if n=3原创 2020-05-10 10:54:55 · 132 阅读 · 0 评论 -
cf Round #640 (Div. 4) B题
B. Same Parity Summandstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two positive integers n (1≤n≤109) and k (1≤k≤100). Represent the number n as the sum of k positive integers of th原创 2020-05-10 10:44:14 · 214 阅读 · 0 评论 -
cf Round #640 (Div. 4) A题
**A. Sum of Round Numbers**time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA positive (strictly greater than zero) integer is called round if it is of the form d00…0. In other words, a positive in原创 2020-05-10 10:21:01 · 219 阅读 · 0 评论 -
cf Educational Codeforces Round 86 C题
C. Yet Another Counting Problemtime limit per test3.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two integers a and b, and q queries. The i-th ...原创 2020-04-27 17:05:21 · 510 阅读 · 0 评论 -
cf Educational Codeforces Round 86 B题
B. Binary Periodtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLet’s say string s has period k if si=si+k for all i from 1 to |s|−k (|s| mea...原创 2020-04-27 12:30:09 · 288 阅读 · 2 评论 -
cf Educational Codeforces Round 86 A题
点击链接跳转A. Road To Zerotime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two integers x and y. You can perform two types of operati...原创 2020-04-27 12:09:18 · 447 阅读 · 0 评论 -
cf Round #635 (Div. 2)B题
B. Kana and Dragon Quest game题目链接time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputKana was just an ordinary high school girl before a talent s...原创 2020-04-16 12:43:15 · 192 阅读 · 0 评论 -
cf Round #635 (Div. 2)A题
A. Ichihime and Triangle题目链接:https://codeforces.com/contest/1337/problem/Atime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIchihime is the cur...原创 2020-04-16 12:25:29 · 228 阅读 · 0 评论 -
cf Round #634 (Div. 3)B题
B. Construct the String题目链接:https://codeforces.com/contest/1335/problem/Btime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given three...原创 2020-04-14 16:37:27 · 335 阅读 · 0 评论 -
cf Round #634 (Div. 3)C题
C. Two Teams Composingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have n students under your control and you have to compose exactly ...原创 2020-04-14 16:05:19 · 402 阅读 · 0 评论 -
cf Round #634 (Div. 3)D题
D. Anti-Sudokutime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a correct solution of the sudoku puzzle. If you don’t know what i...原创 2020-04-14 15:45:15 · 286 阅读 · 0 评论 -
cf Round #634 (Div. 3)A题
A. Candies and Two Sisterstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are two sisters Alice and Betty. You have n candies. You want ...原创 2020-04-14 15:36:54 · 296 阅读 · 0 评论 -
cf Codeforces Round #633 (Div. 2)
A.Filling Diamonds链接:https://codeforces.com/contest/1339/problem/A#include <iostream>#include<bits/stdc++.h>using namespace std;int main(){ int t; scanf("%d", &t); w...原创 2020-04-13 18:27:35 · 113 阅读 · 0 评论 -
cf Educational Codeforces Round 85
题目链接:http://codeforces.com/contest/1334/C题目意思:有n个小怪兽围成一圈,第i个小怪兽有ai点体力值,爆炸之后会对下一个小怪兽产生bi点伤害(if i = n,下一个小怪兽为1 ),用子弹打一枪某个小怪兽,则小怪兽的体力值-1,问最少需要多少子弹,才能让所有小怪兽都死翘翘。思路:假设每个小怪兽都爆炸了,那么打死小怪兽所需要的子弹数a[i] - bi-1,...原创 2020-04-11 15:42:55 · 239 阅读 · 0 评论 -
cf Educational Codeforces Round 85 (Rated for Div. 2)B. Middle Class
题目链接:https://codeforces.com/contest/1334/problem/BB. Middle Classtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMany years ago Berland was ...原创 2020-04-11 09:54:04 · 490 阅读 · 0 评论 -
cf Educational Codeforces Round 85 (Rated for Div. 2)A. Level Statistics
A. Level Statisticstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp has recently created a new level in this cool new game Berlio Mak...原创 2020-04-11 09:41:35 · 600 阅读 · 0 评论 -
cf Round #632 (Div. 2)B. Kind Anton
题目大意:给你俩个数组a,b,其中数组a只包含{-1,0,1}中的元素,问数组a能不能通过以下操作变成B:操作:将a[i]的值加给a[j]且可以重复多次(1<=i<j<=n)思路:由于数组a最多只有三个元素-1,0,1那我们只需要比较a[i]和b[i],若a[i] < b[i]说明a[i]需要变大,三个元素中只有加上1才能使a[i]变大,因此需要数组a在第i个元素之前...原创 2020-04-09 16:42:24 · 128 阅读 · 0 评论 -
cf Round #493 (Div. 2) B. Cutting
思路:先求符和条件的每个间隔的代价,想要获得最多次切割,贪心一下即可(按照代价从小到大依次切割)注意代价是两边的值取绝对值#include <iostream>#include<algorithm>using namespace std;int main(){ int n, b; scanf("%d%d", &n, &b);...原创 2020-04-06 18:32:48 · 103 阅读 · 0 评论