| 记录编号 | 40960 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 922.[咲 -Saki-] 我的天凤不可能这么简单 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.600 s | ||
| 提交时间 | 2012-07-19 19:22:31 | 内存使用 | 0.31 MiB | ||
#include<fstream>
using namespace std;
int main()
{
ifstream cin("tenhous.in");
ofstream cout("tenhous.out");
long long n,m;
long long tot=0,a=0;
cin>>n>>m;
long long lev=0;
for(int i=0;i<n;i++)
{
cin>>a;
tot+=a;
while(tot>=m)
{
tot-=m;
lev++;
}
if(i<n-1)
tot/=2;
}
cout<<lev<<'\n'<<tot<<'\n';
return (0);
}