460A - Vasya and Socks
2015-05-22 10:41
330 查看
#include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <string> #include <vector> #include <queue> #include <algorithm> using namespace std; int main() { int n, m, ans = 0; cin >> n >> m; while(n >= m) { ans += n / m * m; n = n / m + n % m; } ans += n; cout << ans << endl; return 0; }
相关文章推荐
- Problem--460A--Codeforces--A. Vasya and Socks
- CodeForces-460A-Vasya And Socks
- CodeForce 460A :Vasya and Socks
- Codeforces Round #262 (Div. 2) A. Vasya and Socks
- 【Codeforces Round 262 (Div 2)A】【水题】Vasya and Socks 妈妈买袜子 最多穿几天
- Codeforces A. Vasya and Socks
- codeforces水题100道 第十五题 Codeforces Round #262 (Div. 2) A. Vasya and Socks (brute force)
- A. Vasya and Socks
- 460 A. Vasya and Socks
- CodeForces 460 A. Vasya and Socks(379A.New Year Candles)
- A. Vasya and Socks
- CF460 A. Vasya and Socks
- Codeforces #262 (Div. 2) A. Vasya and Socks(水题)
- Codeforces Round #324 (Div. 2) C. Marina and Vasya
- Codeforces Round #206 (Div. 2) C. Vasya and Robot
- Codeforces Round #354 (Div. 2) C - Vasya and String(二分)
- A. Vasya and Football
- codeforces 354C C. Vasya and Beautiful Arrays( 数论+枚举)
- Codeforces Round #281 (Div. 2) A. Vasya and Football
- B. Vasya and Wrestling