Educational Codeforces Round 48 (Rated for Div. 2)——A. Death Note ##

AC code:

#include
using namespace std;
const int N=2e5+6;
typedef long long ll;
ll a[N],ans[N];int n,m;
int main(){
    ios::sync_with_stdio(false);cin.tie(0);
    cin>>n>>m;
    for(int i=1;i<=n;i++)cin>>a[i];
    for(int i=1;i<=n;i++){
        int x=a[i]%m;a[i+1]+=x;
        ans[i]=a[i]/m;
    }
    for(int i=1;i<=n;i++)cout<" ";
}

你可能感兴趣的:(codeforces,模拟题目)