# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
201190 |
2020-02-09T17:32:19 Z |
Fasho |
Timovi (COCI18_timovi) |
C++14 |
|
24 ms |
2936 KB |
#include <bits/stdc++.h>
#define N 1000005
#define ll long long int
#define MP make_pair
#define pb push_back
#define ppb pop_back
#define sp " "
#define endl "\n"
#define fi first
#define se second
#define ii pair<int,int>
#define lli pair<ll,ll>
#define fast cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false)
#define fast2 freopen ("badhair.gir","r",stdin);freopen ("badhair.cik","w",stdout);
#define mod 1000000007
#define fs(x,y) for(ll i=1;i<=y;i++) cin>>x[i]
#define fo(i,x,y) for(ll i=x;i<=y;i++)
#define INF 1000000000005
#define ull unsigned long long int
using namespace std;
ll n,m,ar[N],sum,t,ans[N],k;
int main()
{
fast;
cin>>n>>k>>m;
ll x=m/((n-1)*k);
ans[1]=(x+1)/2*k;
ans[n]=(x/2)*k;
for(int i=2;i<n;i++)
ans[i]=x*k;
// if(x!=0)
m-=(x*k*(n-1));
cout<<x<<endl;
// cout<<ans[1]<<sp<<ans[n]<<endl;
if(x%2==1)
for(int i=n;i>=1 && m>0;i--)
{
// cout<<ans[i]<<sp<<m<<sp<<sp;
ans[i]+=min(m,k);
// cout<<ans[i]<<endl;
m-=k;
}
else
for(int i=1;i<=n && m>0;i++)
{
ans[i]+=min(m,k);
m-=k;
}
for(int i=1;i<=n;i++)
cout<<ans[i]<<sp;
}
/* cd onedrive\desktop\kod
cls
Sinav:21-22 aralik
Aciklama: Muhtemelen 25 aralik
*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
248 KB |
Output isn't correct |
2 |
Incorrect |
5 ms |
380 KB |
Output isn't correct |
3 |
Incorrect |
21 ms |
2296 KB |
Output isn't correct |
4 |
Incorrect |
21 ms |
2296 KB |
Output isn't correct |
5 |
Incorrect |
5 ms |
376 KB |
Output isn't correct |
6 |
Incorrect |
5 ms |
248 KB |
Output isn't correct |
7 |
Incorrect |
22 ms |
2936 KB |
Output isn't correct |
8 |
Incorrect |
24 ms |
2936 KB |
Output isn't correct |