Codeforces Round #372 (Div. 2) C 数学】的更多相关文章

http://codeforces.com/contest/716/problem/C 题目大意:感觉这道题还是好懂得吧. 思路:不断的通过列式子的出来了.首先我们定义level=i, uplevel = i + 1,目前的uplevel,然后我们可以知道,之前求出来的restgrade%level = 0,于是我们可以列出一个式子sqrt(k1 * i + grade) = uplevel * k.因为grade也是i的倍数,假定grade = k2 * i,所以我们写成sqrt((k1 +…
Codeforces Round #372 (Div. 2) C. Plus and Square Root 题意 一个游戏中,有一个数字\(x\),当前游戏等级为\(k\),有两种操作: '+'按钮:使得\(x=x+k\) '√'按钮:使得\(x=\sqrt{x}\),此时\(x\)必须是平方数,游戏等级加1,即\(k=k+1\),且\(\sqrt{x}\)是\(k+1\)的倍数. 游戏开始时,\(x=2,k=1\),输出\(n(n \le 10^5)\)个数,表示每个等级对应的\(\frac…
Codeforces Round #372 (Div. 2) 不知不觉自己怎么变的这么水了,几百年前做A.B的水平,现在依旧停留在A.B水平.甚至B题还不会做.难道是带着一种功利性的态度患得患失?总共才打的几场 CF 节节掉分.学了快一年了成了个水货. 废话就不多说了,来看这次的这两题吧.很多CF的题是不想写博客的,如果题目质量很好的话我倒是愿意留在我的博客里: A. Crazy Computer time limit per test 2 seconds memory limit per te…
C. Plus and Square Root time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) an…
B. Complete The Graph time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output ZS the Coder has drawn an undirected graph of n vertices numbered from 0 to n - 1 and m edges between them. Each edge…
A. Crazy Computer time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output ZS the Coder is coding on a crazy computer. If you don't type in a word for a c consecutive seconds, everything you typed…
B. Complete the Word time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output ZS the Coder loves to read the dictionary. He thinks that a word is nice if there exists a substring (contiguous segmen…
A. Plus and Square Root 题目连接: http://codeforces.com/contest/715/problem/A Description ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is d…
题目: Little C loves number «3» very much. He loves all things about it. Now he has a positive integer nn. He wants to split nn into 3 positive integers a,b,ca,b,c, such that a+b+c=na+b+c=n and none of the 3 integers is a multiple of 3. Help him to fin…
https://codeforces.com/contest/1143/problem/D 题意 有nk个城市,第1,k+1,2k+1,...,(n-1)k+1城市有餐厅,你每次能走l距离,a为起始位置离最近餐厅的距离,b为走了一次后离最近餐厅的距离,给出n,k,a,b,求你回到起点最少和最多停留次数 题解 \(yl=xnk,有y=xnk/l,即y=lcm(xnk,l)/l\) 枚举a(两种情况),b(两种情况),维护最大,最小值 代码 #include<bits/stdc++.h> #def…