# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
696371 |
2023-02-06T10:53:22 Z |
duyyy |
Timovi (COCI18_timovi) |
C++14 |
|
17 ms |
2852 KB |
#include<bits/stdc++.h>
using namespace std;
int main(){
long long n,k,m,a,b;
cin>>n>>k>>m;
long long kq[n+1];
memset(kq,0,sizeof(kq));
a=m/k,b=m%k;
if(a<n) for(int i=1;i<=a+1;i++) if(m>k) {kq[i]=k;m-=k;}
else kq[i]=m;
else{
m-=n*k;
for(int i=1;i<=n;i++) kq[i]=k;
long long c=m/((n-1)*k),d=(m%((n-1)*k))/(n-1),l,r;
if(c%2==0) {l=c/2;r=c/2;}
else {l=c/2+1;r=c/2;}
kq[1]+=(k*l);
kq[n]+=(k*r);
for(int i=2;i<n;i++) kq[i]+=(c*k);
if(c%2==0) {for(int i=n-1;i>=n-d;i--) kq[i]+=k;
kq[n-d-1]+=b;}
else {for(int i=2;i<2+d;i++) kq[i]+=k;
kq[2+d]+=b;}
}
for(int i=1;i<=n;i++) cout<<kq[i]<<' ';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
14 ms |
2296 KB |
Output is correct |
4 |
Correct |
17 ms |
2280 KB |
Output is correct |
5 |
Incorrect |
1 ms |
300 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
304 KB |
Output isn't correct |
7 |
Incorrect |
17 ms |
2852 KB |
Output isn't correct |
8 |
Incorrect |
16 ms |
2836 KB |
Output isn't correct |