Submission #862282

#TimeUsernameProblemLanguageResultExecution timeMemory
862282fdagdgTimovi (COCI18_timovi)C++17
0 / 80
2 ms352 KiB
#include <bits/stdc++.h> #define ll long long #define FASTER ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define NAME "equa" #define F first #define S second #define mp(_a,_b) make_pair(_a,_b) #define matrix vector<vector<ll>> const int nmax=1e5+7; const int mod=1e7+7; const int oo=1e5+7; using namespace std; typedef pair<int,int> ii; typedef pair<ll,int> li; int n,k,m,ans[2*nmax]; int main() { FASTER freopen(NAME".inp","r",stdin); freopen(NAME".out","w",stdout); cin >> n >> k >> m; int i=0; bool kt=0; while(m){ if(!kt){ ans[i]+=min(m,k); m-=min(m,k); i++; if(i==n-1)kt=1; } if(kt){ ans[i]+=min(m,k); m-=min(m,k); i--; if(i==0)kt=0; } } for(int i=0;i<n;i++)cout<<ans[i]<<" "; return 0; }

Compilation message (stderr)

timovi.cpp: In function 'int main()':
timovi.cpp:18:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |     freopen(NAME".inp","r",stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
timovi.cpp:19:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   19 |     freopen(NAME".out","w",stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...