# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
722850 | vjudge1 | Timovi (COCI18_timovi) | C++17 | 1096 ms | 10184 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 B begin()
#define E end()
#define F first
#define S second
#define pb push_back
#define pf push_front
#define eb emplace_back
#define ll long long
#define ui unsigned int
#define ull unsigned long long
#define sts stable_sort
using namespace std;
const int MAXN = 1e6 + 4;
const int MOD = 1e9 + 7;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
ll n, c, cnt; cin >> n >> c >> cnt;
if(n == 1){
cout << cnt << "\n";
return 0;
}
unordered_map<ll, ll> m;
bool a = 1;
for(ll i = 0; i <= n; ){
if(cnt >= c){
m[i] += c;
cnt -= c;
}else{
m[i] += cnt;
cnt = 0;
}
if(cnt == 0)break;
if(n >= 3){
if(i == 2){
a = 0;
}else if(i == 0 && !a){
a = 1;
}
}else{
if(i == 1){
a = 0;
}else if( i == 0 & !a){
a = 1;
}
}
if(a)i++;
else i--;
}
for(int i = 0; i < n; i++){
cout << m[i] << " ";
}
cout << "\n";
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |