【codeforces 527A】Playing with Paper】的更多相关文章

[题目链接]:http://codeforces.com/contest/527/problem/A [题意] 让你每次从一个长方形里面截出一个边长为长方形的较短边的正方形; 然后留下的部分重复上述步骤; 直到剩下的部分为正方形为止; 问你一共截出了多少个正方形 [题解] 写个递归求解就好; 每次短边的边长不变; 然后答案递增长边长度/短边长度 长边的边长变为长边%短边->为0的话就改为短边长度,下一次递归结束就好; [完整代码] #include <bits/stdc++.h> usi…
[codeforces 415D]Mashmokh and ACM 题意:美丽数列定义:对于数列中的每一个i都满足:arr[i+1]%arr[i]==0 输入n,k(1<=n,k<=2000),问满足[数列长度是k && 数列中每一个元素arr[i]在1~n之间 && 数列中元素可以重复]的数列有多少个?结果对10^9+7取余 解题思路:dp[i][j]表示长度是j,最后一位是i的种数 if(kk%i==0) dp[kk][j+1]+=dp[i][j] #inc…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output PolandBall is playing a game with EnemyBall. The rules are simple. Players have to say words in turns. You cannot say a word which was already sa…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Ilya is an experienced player in tic-tac-toe on the 4 × 4 field. He always starts and plays with Xs. He played a lot of games today with his fri…
time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output Two soldiers are playing a game. At the beginning first of them chooses a positive integer n and gives it to the second soldier. Then the second…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Two bored soldiers are playing card war. Their card deck consists of exactly n cards, numbered from 1 to n, all values are different. They divid…
time limit per test4 seconds memory limit per test256 megabytes inputstandard input outputstandard output Anton is playing a very interesting computer game, but now he is stuck at one of the levels. To pass to the next level he has to prepare n potio…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Limak is a little bear who loves to play. Today he is playing by destroying block towers. He built n towers in a row. The i-th tower is made of h…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Wilbur is playing with a set of n points on the coordinate plane. All points have non-negative integer coordinates. Moreover, if some point (x,…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Student Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange algorithm on a graph - somet…