关闭

Codeforces A. Vasya and Socks

403人阅读 评论(0) 收藏 举报
分类:

题目链接: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;
}
0
0
查看评论

Codeforces Round #319 (Div. 2) 577C Vasya and Petya's Game(筛选法)

C. Vasya and Petya's Game time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output ...
  • GKHack
  • GKHack
  • 2015-09-14 21:01
  • 900

Codeforces 460A Vasya and Socks(水题)

题目链接:Codeforces 460A Vasya and Socks 题目大意:Aasya有n双新袜子,他妈每m天给他买一双新袜子,问不洗袜子的话能连续多少天有袜子穿。 解题思路:水题,注意取整后的余数。 #include #include #include using n...
  • u011328934
  • u011328934
  • 2014-08-31 15:49
  • 1042

A. Vasya and Socks

A. Vasya and Socks time limit per test 1 second memory limit per test 256 megabytes input standard input output standard outpu...
  • S_Black
  • S_Black
  • 2014-08-21 10:29
  • 380

460 A. Vasya and Socks

题意:给出现在有n双袜子,妈妈每隔m
  • u014204835
  • u014204835
  • 2014-08-21 15:24
  • 346

CodeForces-58A-Chat room

A. Chat room time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output ...
  • u012188452
  • u012188452
  • 2014-10-25 20:22
  • 1548

【CodeForces】675A - Infinite Sequence(易错)

题目链接:点击打开题目 A. Infinite Sequence time limit per test 1 second memory limit per test 256 megabytes input standard input output standard outpu...
  • wyg1997
  • wyg1997
  • 2016-05-26 13:01
  • 359

Codeforces Round #448 (Div. 2) ABC

神奇的一场,两题可以出现在排名首页。 A. Pizza Separation time limit per test 1 second memory limit per test 256 megabytes input standard input output standa...
  • sinat_35406909
  • sinat_35406909
  • 2017-11-27 14:47
  • 489

Codeforces Vasya and Socks

题目链接: http://codeforces.com/problemset/problem/460/A import java.util.Scanner; public class VasyaAndSocks { public static void main(Stri...
  • Lutte_
  • Lutte_
  • 2017-06-20 10:33
  • 100

#448 div2 a Pizza Separation

A. Pizza Separation time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Students Vasya and P...
  • weixin_39539882
  • weixin_39539882
  • 2017-11-27 18:34
  • 228

Codeforces 837E Vasya's Function:数论入门初步

题意:定义F(a,0) = 0,F(a,b) = 1 + F(a,b - GCD(a,b)。给定 x 和 y ( 题解:a=A*GCD(a,b) b=B*GCD(a,b),那么b-GCD(a,b) = (B-1)*GCD(a,b),如果此时A和B-1依然互质,那么GCD不变下一次还是要执行b-GC...
  • calabash_boy
  • calabash_boy
  • 2017-08-04 01:42
  • 842
    个人资料
    • 访问:530322次
    • 积分:11569
    • 等级:
    • 排名:第1585名
    • 原创:639篇
    • 转载:5篇
    • 译文:0篇
    • 评论:93条
    博客专栏