链接: https://codeforces.com/contest/1271/problem/E 题意: At first, let's define function f(x) as follows: f(x)={x2x−1if x is evenotherwise We can see that if we choose some value v and will apply function f to it, then apply f to f(v), and so on, we'll…
题意:对于一个数\(x\),有函数\(f(x)\),如果它是偶数,则\(x/=2\),否则\(x-=1\),不断重复这个过程,直到\(x-1\),我们记\(x\)到\(1\)的这个过程为\(path(x)\),它表示这个过程中所有\(x\)的值,现在给你一个数\(n\)和\(k\),要你找出最大的数\(x\),并且\(x\)在\(path[1,n]\)中出现的次数不小于\(k\). 题解:我们对于\(x\)可以选择分奇偶来讨论. 1.假如\(x\)为奇数,那么根据题意,我们知道\(x,2x,2x…
目录 Codeforces Round #608 (Div. 2) 题解 前言 A. Suits 题意 做法 程序 B. Blocks 题意 做法 程序 C. Shawarma Tent 题意 做法 程序 D. Portals 题意 做法 程序 E. Common Number 题意 做法 程序 结束语 Codeforces Round #608 (Div. 2) 题解 前言 题目链接:仅仅只是为了方便以题目作为关键字能查找到我的题解而已(逃 Codeforces 1271A Codeforce…
传送门 A. Suits 签到. Code /* * Author: heyuhhh * Created Time: 2019/12/15 17:16:33 */ #include <iostream> #include <algorithm> #include <cstring> #include <vector> #include <cmath> #include <set> #include <map> #inclu…
引子: A题过于简单导致不敢提交,拖拖拉拉10多分钟还是决定交,太冲动交错了CE一发,我就知道又要错过一次涨分的机会.... B题还是过了,根据题意目测数组大小开1e5,居然蒙对,感觉用vector更好一点... C题WA第9组,GG思密达....明天起床再补C吧 - - 题目链接: http://codeforces.com/contest/835/problem/B B. The number on the board Some natural number was written on t…
链接: https://codeforces.com/contest/1215/problem/B 题意: You are given a sequence a1,a2,-,an consisting of n non-zero integers (i.e. ai≠0). You have to calculate two following values: the number of pairs of indices (l,r) (l≤r) such that al⋅al+1-ar−1⋅ar…
链接: https://codeforces.com/contest/1271/problem/D 题意: You play a strategic video game (yeah, we ran out of good problem legends). In this game you control a large army, and your goal is to conquer n castles of your opponent. Let's describe the game p…
D. Minimum number of steps time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output We have a string of letters 'a' and 'b'. We want to perform some operations on it. On each step we choose one of s…
http://codeforces.com/problemset/problem/182/D 题意:如果把字符串a重复m次可以得到字符串b,那么我们称字符串a为字符串b的一个因子,现在给定两个字符串S1和S2,求它们的公共因子个数. 思路: 先求最小循环节,如果最小循环节不同,那么肯定是没有公共因子的.如果相同的话,那就看循环节长度为1,2,3...是否可行. #include<iostream> #include<cstdio> #include<cstring> u…