| 记录编号 | 45124 | 评测结果 | AAAAAAAAAAWWWWWWWWWW | ||
|---|---|---|---|---|---|
| 题目名称 | 1197.[Nescafé 26] 小猫爬山 | 最终得分 | 50 | ||
| 用户昵称 | 是否通过 | 未通过 | |||
| 代码语言 | C++ | 运行时间 | 0.008 s | ||
| 提交时间 | 2012-10-22 16:36:01 | 内存使用 | 3.15 MiB | ||
#include<fstream>
#include<set>
using namespace std;
int main(void)
{
ifstream fin("koneko.in");
ofstream fout("koneko.out");
int n,w;
fin>>n>>w;
int m,ans=0;
int i;
int sum=0;
for(i=0;i<n;i++)
{
fin>>m;
sum+=m;
ans+=sum/w;
sum%=w;
}
if(sum>0)
ans++;
fout<<ans;
fin.close();
fout.close();
return 0;
}