# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
239769 | VEGAnn | Timovi (COCI18_timovi) | C++14 | 1092 ms | 2168 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define PB push_back
#define sz(x) ((int)x.size())
#define i3 array<int,3>
using namespace std;
typedef long double ld;
typedef long long ll;
const int N = 200100;
const int M = 510;
const int K = 110;
const int T = 2010;
const int oo = 2e9;
int ans[N], n, m, k;
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef _LOCAL
freopen("in.txt","r",stdin);
#endif // _LOCAL
cin >> n >> k >> m;
int loc = 0, ad = 1;
while (m > 0){
int ost = min(m, k);
ans[loc] += ost;
m -= ost;
if (loc == n - 1 && ad == 1)
ad = -1;
if (loc == 0 & ad == -1)
ad = 1;
loc += ad;
}
for (int i = 0; i < n; i++)
cout << ans[i] << " ";
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |