Submission #81722

# Submission time Handle Problem Language Result Execution time Memory
81722 2018-10-26T10:39:29 Z Mouhanad_Hafez Nadan (COCI18_nadan) C++11
10 / 50
3 ms 548 KB
#include<bits/stdc++.h>
using namespace std;
int a[1000007];
int main(){
    int n,k;
    cin>>n>>k;
    if (n%k==0){
        for (int i=0;i<k;i++){
            a[i]=n/k;
        }
    }
    else {
        a[0]=(n/k)+(n%k);
        for (int i=1;i<k;i++){
            a[i]=n/k;
        }
    }
    if (k%2==0){
        for (int i=0;i<k/2;i++){
            a[i]+=i+1;
            a[k-i-1]-=i+1;
        }
    }
    else {
        for (int i=0;i<=k/2;i++){
            a[i]+=i+1;
            a[k-i-1]-=i+1;
        }
    }
    for (int i=0;i<k;i++){
        cout<<a[i]<<endl;
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Incorrect 2 ms 384 KB Output isn't correct
3 Incorrect 2 ms 440 KB Output isn't correct
4 Correct 2 ms 440 KB Output is correct
5 Incorrect 2 ms 484 KB Output isn't correct
6 Incorrect 2 ms 484 KB Output isn't correct
7 Incorrect 2 ms 484 KB Output isn't correct
8 Correct 2 ms 484 KB Output is correct
9 Incorrect 3 ms 484 KB Output isn't correct
10 Incorrect 2 ms 548 KB Output isn't correct