zoukankan      html  css  js  c++  java
  • BC 52 div2 A Victor and Machine

    简单数学题,把这道题目贴上去的不过为了不想看到这个月写了某个数字篇博客,该数字有点不吉利。。。尴尬

    近期没有学习的欲望。。

    集中不了注意力,今天打BC还是做出来一题,尽管涨分了,真心希望能接近cf的水平,

    天还有cf,只是我近期不想熬夜了。以后有空再说吧。


    代码:

    #include<iostream>
    #include<cstdio>
    #include<cstdlib>
    #include<cstring>
    #include<cmath>
    #include<vector>
    #include<set>
    #include<string>
    #include<algorithm>
    #define MAX 0x7fffffff
    
    using namespace std;
    
    int main()
    {
    	int x , y, w ,n;
    	while(cin >> x >> y >> w >> n)
    	{
    		int ans,sum1,sum2;
    		sum1 = (n-1)/(x/w+1)*(x+y);
    		int sum = (n-1)%(x/w+1);
    		if(sum*w > x)
    			sum2 = x + y;
    		else
    			sum2 = sum*w;
    		ans = sum1 + sum2;
    		cout << ans << endl;	
    	}
    	return 0;
    }
    


  • 相关阅读:
    参考资料来自 懒兔子 的公众号
    Etcd
    zookeeper 杂记
    十二五
    防火墙
    APScheduler
    docker管理工具protainer
    java学习笔记
    linux学习笔记1
    [POI2007]ZAP-Queries
  • 原文地址:https://www.cnblogs.com/liguangsunls/p/7066293.html
Copyright © 2011-2022 走看看