Submission #780049

# Submission time Handle Problem Language Result Execution time Memory
780049 2023-07-12T06:04:18 Z vjudge1 Timovi (COCI18_timovi) C++17
80 / 80
851 ms 2896 KB
#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

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 time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 10 ms 708 KB Output is correct
4 Correct 11 ms 724 KB Output is correct
5 Correct 851 ms 312 KB Output is correct
6 Correct 650 ms 308 KB Output is correct
7 Correct 624 ms 2764 KB Output is correct
8 Correct 839 ms 2896 KB Output is correct