题目:http://codeforces.com/problemset/problem/682/A

理解: 比较简单的一道题 思路很重要

#include<iostream>//*****连续的****
using namespace std;
int main()
{
int n,m;
while(cin>>n>>m)
{
long long int ans=;
for(int i=; i<=n; i++)
{
ans+=(i+m)/;//和最大
if(i>=)ans-=i/;//i>5 则多算了加数以下得
}
cout<<ans<<endl;
}
return ;
}

codeforces682A的更多相关文章

随机推荐

  1. 1066: [SCOI2007]蜥蜴

    1066: [SCOI2007]蜥蜴 Time Limit: 1 Sec  Memory Limit: 162 MBSubmit: 3545  Solved: 1771[Submit][Status] ...

  2. [LeetCode] Heaters 加热器

    Winter is coming! Your first job during the contest is to design a standard heater with fixed warm r ...

  3. [LeetCode] House Robber III 打家劫舍之三

    The thief has found himself a new place for his thievery again. There is only one entrance to this a ...

  4. 创建ejs模板的express工程

    npm install -g express npm install -g express-generator express -e projectName cd projectName npm in ...

  5. java第二周周学习总结

    java运算符和循环 java运算符 一.for 语句 for 语句的基本结构如下所示:for(初始化表达式;判断表达式;递增(递减)表达式){    执行语句;   //一段代码} 初始化表达式:初 ...

  6. 【poj2409】 Let it Bead

    http://poj.org/problem?id=2409 (题目链接) 题意 一个n个珠子的项链,每个珠子可以被染成t种颜色.项链可以翻转和旋转,问不同的染色方案数. Solution Pólya ...

  7. 实例1-gettree

    -- zx create PROCEDURE getbomtree @MaterialID INT --参数,父节点的id AS BEGIN -- 如果主BOM禁用,不显示树结构 ) BEGIN RE ...

  8. 02. Let & Const

    Let & Const let 基础用法 很简单就能说明这个问题 if(false) { var a = 'heihei' } a = undefined if(true) { var a = ...

  9. Linux系统下设置环境变量

    例如我现在有一个软件understand代码审阅软件,现在我每次想要打开这个软件就要进到~/scitools/bin/linux32目录下,去执行可执行文件understand; 但每次都这样我会觉得 ...

  10. 12月5日PHPCMS替换主页

    cms替换主页的步骤 1.先做好静态页面: 2.在D:\wamp\www\phpcms\install_package\phpcms\templates文件夹下建新的文件夹tianqiwangluo( ...