Submission #81723

# Submission time Handle Problem Language Result Execution time Memory
81723 2018-10-26T10:40:47 Z Mouhanad_Hafez Nadan (COCI18_nadan) C++11
10 / 50
3 ms 628 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;
        }
    }
	cout<<a[0];
    for (int i=1;i<k;i++){
     	cout<<endl<<a[i];
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Incorrect 2 ms 372 KB Output isn't correct
3 Incorrect 2 ms 628 KB Output isn't correct
4 Correct 2 ms 628 KB Output is correct
5 Incorrect 2 ms 628 KB Output isn't correct
6 Incorrect 2 ms 628 KB Output isn't correct
7 Incorrect 2 ms 628 KB Output isn't correct
8 Correct 2 ms 628 KB Output is correct
9 Incorrect 2 ms 628 KB Output isn't correct
10 Incorrect 3 ms 628 KB Output isn't correct