Submission #780049

#TimeUsernameProblemLanguageResultExecution timeMemory
780049vjudge1Timovi (COCI18_timovi)C++17
80 / 80
851 ms2896 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define faster ios_base::sync_with_stdio(false);cin.tie(NULL);
#define OYY 1000000005
#define mod 998244353
int dizi[200005];

int32_t main(){
    faster
    int n,k,m;
    cin>>n>>k>>m;
    int t=0,o=0,i=0;
    while(m){
        if(o==0){
            dizi[i]+=min(m,k);
            m-=min(m,k);
            i++;
            if(i==n-1)o=1;
        }
        if(o==1){
            dizi[i]+=min(m,k);
            m-=min(m,k);
            i--;
            if(i==0)o=0;
        }
       // cout<<dizi[i]<<" "<<t<<" "<<o<<endl;
    }
    for(int i=0;i<n;i++)cout<<dizi[i]<<" ";
    return 0;
}

Compilation message (stderr)

timovi.cpp: In function 'int32_t main()':
timovi.cpp:13:9: warning: unused variable 't' [-Wunused-variable]
   13 |     int t=0,o=0,i=0;
      |         ^
#Verdict Execution timeMemoryGrader output
Fetching results...