
codeforces
轻舟不载愁
获得10万访问量的方式有两种
1.写一篇博客,有10万访问量
2.写10万篇博客,让每一篇都有1访问量
展开
-
Educational Codeforces Round 86 (Rated for Div. 2)C. Yet Another Counting Problem
题目地址:https://codeforces.com/contest/1342/problem/C题意: 输入两个整数a,b且(1 <= a, b <= 200)和一个查询次数q且(1 <= q <= 500)。 每次查询输入一个区间l,r且(1 <= l <= r <= 1e18) 问在这个区间内的数字有多少数字i满足(i % a) % b !...原创 2020-04-27 18:49:47 · 209 阅读 · 0 评论 -
Codeforces Round #616 (Div. 2)B. Array Sharpening
题目地址:https://codeforces.com/contest/1291/problem/B题意: 输入n,接着输入n个数字,这n个数字构成一个数组。 你可以对数组中任意一个数字进行任意次数的-1操作。 问:这个数组能不能变成一个锐化的数组。数组锐化:三种形式 1.递增:{0,1,2,3,4} 2.递减:{4,3,2,1,0} 3.只有一个坡度:{0,1,2,3,4,3,2...原创 2020-04-17 11:44:43 · 158 阅读 · 0 评论 -
Educational Codeforces Round 81 (Rated for Div. 2)B. Infinite Prefixes(思维、公式推导)
题目地址:https://codeforces.com/contest/1295/problem/B参考大佬的地址:https://www.cnblogs.com/pixel-Teee/p/12247178.html题意: 每组输入一个n和m,n代表字符串s的长度,m的意思是0比1的数量多m个 你有一个字符串s,字符串s是一个01串,字符串t是由无限个字符串s相连,例如s="01001"那...原创 2020-04-16 18:40:55 · 187 阅读 · 0 评论 -
Codeforces Round #615 (Div. 3)D. MEX maximizing(思维)
题目地址:https://codeforces.com/contest/1294/problem/D题意: 你有一个空白数组,需要向里面插入n个数字,这些数字可以加k或减k任意次。 问每次加入后数组内的没有出现的最小的非负整数是多少例如: n = 7, k = 3 0 1 2 2 0 0 10 第一次插入0,此时没有出现的最小的非负整数是1;数组{0} 第二次插入1,此...原创 2020-04-15 22:27:24 · 197 阅读 · 0 评论 -
Educational Codeforces Round 80 (Rated for Div. 2)A. Deadline(暴力枚举或数论)(公式推导)
题目地址:https://codeforces.com/contest/1288/problem/A大佬的地址:题意在这里,大佬恐怖如斯,膜拜#include<cstdio>#include<cstring>#include<cstdlib>#include<cmath>#include<string>#include<...原创 2020-04-14 22:16:43 · 141 阅读 · 0 评论 -
Codeforces Round #612 (Div. 2) B. Hyperset(枚举+map)
题目地址:https://codeforces.com/contest/1287/problem/Bn行字符串,每个字符串k个字符,每个字符串只能是’S’、‘T’、'E’这三个字符,三个字符串算一组,问有多少组。3 3SETETSTSE//第一列SET都不一样,第二列ETS都不一样,第三列TSE都不一样//所以这三个字符串算1组3 4SETEETSETSES//第一列SE...原创 2020-04-14 19:57:40 · 177 阅读 · 0 评论 -
Codeforces Round #264 (Div. 2) - B. Caisa and Pylons
Caisa solved the problem with the sugar and now he is on the way back to home.Caisa is playing a mobile game during his path. There are (n + 1) pylons numbered from 0 to n in this game. The pylon wit...原创 2019-05-28 18:56:03 · 145 阅读 · 0 评论 -
L1-059 敲笨钟 (20 分)
微博上有个自称“大笨钟V”的家伙,每天敲钟催促码农们爱惜身体早点睡觉。为了增加敲钟的趣味性,还会糟改几句古诗词。其糟改的方法为:去网上搜寻压“ong”韵的古诗词,把句尾的三个字换成“敲笨钟”。例如唐代诗人李贺有名句曰:“寻章摘句老雕虫,晓月当帘挂玉弓”,其中“虫”(chong)和“弓”(gong)都压了“ong”韵。于是这句诗就被糟改为“寻章摘句老雕虫,晓月当帘敲笨钟”。现在给你一大堆古诗词句,...原创 2019-05-28 20:20:36 · 691 阅读 · 0 评论 -
L1-060 心理阴影面积 (5 分)
这是一幅心理阴影面积图。我们都以为自己可以匀速前进(图中蓝色直线),而拖延症晚期的我们往往执行的是最后时刻的疯狂赶工(图中的红色折线)。由红、蓝线围出的面积,就是我们在做作业时的心理阴影面积。现给出红色拐点的坐标 (x,y),要求你算出这个心理阴影面积。输入格式:输入在一行中给出 2 个不超过 100 的正整数 x 和 y,并且保证有 x>y。这里假设横、纵坐标的最大值(即截止日和最...原创 2019-05-28 21:03:33 · 2062 阅读 · 0 评论 -
L1-061 新胖子公式 (10 分)
根据钱江晚报官方微博的报导,最新的肥胖计算方法为:体重(kg) / 身高(m) 的平方。如果超过 25,你就是胖子。于是本题就请你编写程序自动判断一个人到底算不算胖子。输入格式:输入在一行中给出两个正数,依次为一个人的体重(以 kg 为单位)和身高(以 m 为单位),其间以空格分隔。其中体重不超过 1000 kg,身高不超过 3.0 m。输出格式:首先输出将该人的体重和身高代入肥胖公式的计...原创 2019-05-28 21:08:05 · 941 阅读 · 0 评论 -
Educational Codeforces Round 66 (Rated for Div. 2)A. From Hero to Zero
You are given an integer n and an integer k.In one step you can do one of the following moves:decrease n by 1;divide n by k if n is divisible by k.For example, if n=27 and k=3 you can do the follo...原创 2019-06-06 09:43:50 · 231 阅读 · 0 评论 -
Codeforces Round #304 (Div. 2) - A. Soldier and Bananas
A soldier wants to buy w bananas in the shop. He has to pay k dollars for the first banana, 2k dollars for the second one and so on (in other words, he has to pay i·k dollars for the i-th banana).He ...原创 2019-05-28 18:45:07 · 153 阅读 · 0 评论 -
Codeforces Beta Round #63 (Div. 2)A. Young Physicist
A guy named Vasya attends the final grade of a high school. One day Vasya decided to watch a match of his favorite hockey team. And, as the boy loves hockey very much, even more than physics, he forgo...原创 2019-05-30 13:57:28 · 179 阅读 · 0 评论 -
Codeforces Beta Round #91 (Div. 2 Only) A. Lucky Division
Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5...原创 2019-05-23 10:06:05 · 138 阅读 · 0 评论 -
Codeforces #561 B.All the Vowels Please
Tom loves vowels, and he likes long words with many vowels. His favorite words are vowelly words. We say a word of length k is vowelly if there are positive integers n and m such that n⋅m=k and when t...原创 2019-05-18 00:54:20 · 275 阅读 · 0 评论 -
Codeforces #561 A.Silent Classroom
There are n students in the first grade of Nlogonia high school. The principal wishes to split the students into two classrooms (each student must be in exactly one of the classrooms). Two distinct st...原创 2019-05-18 00:51:19 · 156 阅读 · 0 评论 -
Codeforces Beta Round #54 (Div. 2) A. Chat room
Vasya has recently learned to type and log on to the Internet. He immediately entered a chat room and decided to say hello to everybody. Vasya typed the word s. It is considered that Vasya managed to ...原创 2019-05-23 09:54:55 · 183 阅读 · 0 评论 -
Codeforces Beta Round #87 (Div. 2 Only) A. Tram
Linear Kingdom has exactly one tram line. It has n stops, numbered from 1 to n in the order of tram’s movement. At the i-th stop ai passengers exit the tram, while bi passengers enter it. The tram is ...原创 2019-05-23 00:20:55 · 171 阅读 · 0 评论 -
VK Cup 2012 Qualification Round 1 B. Taxi
After the lessons n groups of schoolchildren went outside and decided to visit Polycarpus to celebrate his birthday. We know that the i-th group consists of si friends (1 ≤ si ≤ 4), and they want to g...原创 2019-05-22 23:27:16 · 173 阅读 · 0 评论 -
Educational Codeforces Round 66 (Rated for Div. 2)B. Catch Overflow!
You are given a function f written in some basic language. The function accepts an integer value, which is immediately written into some variable x. x is an integer variable and can be assigned values...原创 2019-06-06 09:44:37 · 318 阅读 · 0 评论 -
Educational Codeforces Round 66 (Rated for Div. 2)C. Electrification
At first, there was a legend related to the name of the problem, but now it’s just a formal statement.You are given n points a1,a2,…,an on the OX axis. Now you are asked to find such an integer point...原创 2019-06-06 20:35:04 · 230 阅读 · 0 评论 -
Codeforces Global Round 3 A.Another One Bites The Dust
Let’s call a string good if and only if it consists of only two types of letters — ‘a’ and ‘b’ and every two consecutive letters are distinct. For example “baba” and “aba” are good strings and “abb” i...原创 2019-06-02 10:35:23 · 282 阅读 · 0 评论 -
Codeforces Round #565 (Div. 3)C. Lose it!
You are given an array a consisting of n integers. Each ai is one of the six following numbers: 4,8,15,16,23,42.Your task is to remove the minimum number of elements to make this array good.An array...原创 2019-06-10 18:45:22 · 463 阅读 · 0 评论 -
Codeforces Round #565 (Div. 3)B. Merge it!
You are given an array a consisting of n integers a1,a2,…,an.In one operation you can choose two elements of the array and replace them with the element equal to their sum (it does not matter where y...原创 2019-06-10 18:44:34 · 278 阅读 · 0 评论 -
Codeforces Round #565 (Div. 3)A. Divide it!
You are given an integer n.You can perform any of the following operations with this number an arbitrary (possibly, zero) number of times:Replace n with n2 if n is divisible by 2;Replace n with 2n3...原创 2019-06-10 18:43:46 · 240 阅读 · 0 评论 -
Codeforces Round #566 (Div. 2)B. Plus from Picture
You have a given picture with size w×h. Determine if the given picture has a single “+” shape or not. A “+” shape is described below:A “+” shape has one center nonempty cell.There should be some (at...原创 2019-06-15 20:17:02 · 311 阅读 · 0 评论 -
Codeforces Round #566 (Div. 2)A. Filling Shapes
You have a given integer n. Find the number of ways to fill all 3×n tiles with the shape described in the picture below. Upon filling, no empty spaces are allowed. Shapes cannot overlap.This picture...原创 2019-06-15 20:16:02 · 689 阅读 · 0 评论 -
Codeforces Round #568 (Div. 2)A. Ropewalkers
Polycarp decided to relax on his weekend and visited to the performance of famous ropewalkers: Agafon, Boniface and Konrad.The rope is straight and infinite in both directions. At the beginning of th...原创 2019-06-20 01:05:13 · 284 阅读 · 0 评论 -
Codeforces Round #563 (Div. 2) C. Ehab and a Special Coloring Problem
You’re given an integer n. For every integer i from 2 to n, assign a positive integer ai such that the following conditions hold:For any pair of integers (i,j), if i and j are coprime, ai≠aj.The max...原创 2019-06-04 00:05:18 · 257 阅读 · 0 评论 -
Codeforces Round #563 (Div. 2) B. Ehab Is an Odd Person
You’re given an array a of length n. You can perform the following operation on it as many times as you want:Pick two integers i and j (1≤i,j≤n) such that ai+aj is odd, then swap ai and aj.What is l...原创 2019-06-04 00:04:19 · 291 阅读 · 0 评论 -
Codeforces Round #563 (Div. 2) A. Ehab Fails to Be Thanos
You’re given an array a of length 2n. Is it possible to reorder it in such way so that the sum of the first n elements isn’t equal to the sum of the last n elements?InputThe first line contains an i...原创 2019-06-04 00:03:15 · 167 阅读 · 0 评论 -
Testing Round #15 (Unrated)-A. Digits Sequence (Easy Edition)
Let’s write all the positive integer numbers one after another from 1 without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718192021...原创 2019-06-03 20:57:28 · 441 阅读 · 0 评论 -
Codeforces Round #564 (Div. 2)C. Nauuo and Cards
Nauuo is a girl who loves playing cards.One day she was playing cards but found that the cards were mixed with some empty ones.There are n cards numbered from 1 to n, and they were mixed with anothe...原创 2019-06-08 03:33:33 · 329 阅读 · 0 评论 -
Codeforces Round #564 (Div. 2)B. Nauuo and Chess
Nauuo is a girl who loves playing chess.One day she invented a game by herself which needs n chess pieces to play on a m×m chessboard. The rows and columns are numbered from 1 to m. We denote a cell ...原创 2019-06-08 03:32:36 · 394 阅读 · 0 评论 -
Codeforces Round #564 (Div. 2)A. Nauuo and Votes
Nauuo is a girl who loves writing comments.One day, she posted a comment on Codeforces, wondering whether she would get upvotes or downvotes.It’s known that there were x persons who would upvote, y ...原创 2019-06-08 03:31:37 · 145 阅读 · 0 评论 -
Codeforces Round #146 (Div. 2)A. Boy or Girl
Those days, many boys use beautiful girls’ photos as avatars in forums. So it is pretty hard to tell the gender of a user at the first glance. Last year, our hero went to a forum and had a nice chat w...原创 2019-05-22 22:55:04 · 169 阅读 · 0 评论 -
Codeforces Round #163 (Div. 2)A. Stones on the Table
There are n stones on the table in a row, each of them can be red, green or blue. Count the minimum number of stones to take from the table so that any two neighboring stones had different colors. Sto...原创 2019-05-22 22:48:02 · 136 阅读 · 0 评论 -
Codeforces Round #161 (Div. 2) A. Beautiful Matrix
You’ve got a 5 × 5 matrix, consisting of 24 zeroes and a single number one. Let’s index the matrix rows by numbers from 1 to 5 from top to bottom, let’s index the matrix columns by numbers from 1 to 5...原创 2019-05-22 22:43:06 · 151 阅读 · 0 评论 -
B. Game with Telephone Numbers
time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA telephone number is a sequence of exactly 11 digits such that its first digit is 8.Vasya and...原创 2019-04-23 01:19:54 · 761 阅读 · 0 评论 -
A. Reverse a Substring
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a string s consisting of n lowercase Latin letters.Let’s define a substring as ...原创 2019-04-23 01:18:24 · 707 阅读 · 0 评论