| 比赛 | 咲 -Saki- 互测赛 | 评测结果 | AAWWWWWWWW |
|---|---|---|---|
| 题目名称 | 我的天凤不可能这么简单 | 最终得分 | 20 |
| 用户昵称 | Yeehok | 运行时间 | 0.515 s |
| 代码语言 | C++ | 内存使用 | 0.28 MiB |
| 提交时间 | 2012-07-19 10:00:51 | ||
#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);
}