题目链接:http://codeforces.com/problemset/problem/712/C 题目大意: 给连个值x,y (3 ≤ y < x ≤ 100 000), x,y都为等边三角形.从y等边三角形 每次修改一条边,且修改后的三个边还能组成一个三角形(两边之和大于第三边).问修改几次能够得到x为边的等边三角形. 例如: 输入: 22 4 输出: 6 解题思路: 从y->x ,定义三个边y1=y2=y3=y, 每次修改一条边 y1=y2+y3-1(两边之和大于第三遍) 修改++ …
题意:现在有一个长度为 x 的正三角形,每次可以把一条边减小,然后用最少的时间变成长度为 y 的正三角形. 析:一开始,正着想,然后有一个问题,就是第一次减小多少才能最快呢?这个好像并不好确定,然后我就可以倒着想,从一个小三角形变成一个大三角, 那么边长长的越快越好了,剩下的就暴力了. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <st…
Description Memory is now interested in the de-evolution of objects, specifically triangles. He starts with an equilateral triangle of side length \(x\), and he wishes to perform operations to obtain an equilateral triangle of side length \(y\). In a…
题目链接: http://codeforces.com/problemset/problem/268/E E. Playlist time limit per test 1 secondmemory limit per test 256 megabytes 问题描述 Manao's friends often send him new songs. He never listens to them right away. Instead, he compiles them into a play…
F. Doomsday Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/problem/F Description Doomsday comes in t units of time. In anticipation of such a significant event n people prepared m vaults in which, as they think, it will…
A. Purification Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/329/problem/A Description You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square r…
A. Exams Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/480/problem/A Description Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera…
B. Game of the Rows time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Daenerys Targaryen has an army consisting of k groups of soldiers, the i-th group contains ai soldiers. She wants to brin…
A. Lesha and array splitting time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output One spring day on his way to university Lesha found an array A. Lesha likes to split arrays into several parts.…
A. Mafia Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/348/problem/A Description One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1…