Codeforces A. Vasya and Socks

简介:

题目链接:http://codeforces.com/contest/460/problem/A

#include <iostream>

using namespace std;

int main()
{
    int m,n;
    cin>>m>>n;
    int sum;
    for(sum=1; m>0; sum++)
    {
        m--;
        if(sum % n == 0)
           m++;
    }
    sum--;
    cout<<sum<<endl;
    return 0;
}
目录
相关文章
poj 2105 IP Address
题目链接
26 0
|
3月前
|
PHP
BUU [BJDCTF2020]The mystery of ip
BUU [BJDCTF2020]The mystery of ip
18 1
|
4月前
|
网络协议
TCP/IP面试三道题
精选三道TCP/IP协议面试题
38 2
|
6月前
Arctic Network( POJ - 2349)
Arctic Network( POJ - 2349)
|
Ubuntu 应用服务中间件 Shell
IChunQiu云境-Spoofing Writeup(一)
Tag: Tomcat,NTLM,WebClient,Coerce Authentication,noPac
codeforces731——C. Socks(并查集)
codeforces731——C. Socks(并查集)
79 0
Codeforces 954D. Fight Against Traffic
Codeforces 954D. Fight Against Traffic
74 0
POJ 2105 IP Address
POJ 2105 IP Address
113 0
|
前端开发 网络架构
HDU-1049 Climbing Worm
HDU-1049 Climbing Worm
|
Java 机器学习/深度学习
2017 Multi-University Training Contest - Team 1 1011&&HDU 6043 KazaQ&#39;s Socks【规律题,数学,水】
KazaQ's Socks Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 338    Accepted Submission(s)...
1050 0