Submission #951122

#TimeUsernameProblemLanguageResultExecution timeMemory
951122turbilegRoses (BOI20_roses)C++14
20 / 100
1083 ms604 KiB
#include<bits/stdc++.h> using namespace std; int main(){ long long n,s,p,k,m,k1,m1,a,b,c,d; cin >> n >> a >> b >> c >> d; s = 0; p = 0; while(n > s){ m = n - s; k1 = m / a; if(m%a > 0) k1++; k1 = k1 * b; m1 = m / c; if(m%c > 0) m1++; m1 = m1 * d; if (k1 < m1) s+=a,p+=b; else s+=c,p+=d; } cout << p << endl; return 0; }

Compilation message (stderr)

Roses.cpp: In function 'int main()':
Roses.cpp:6:18: warning: unused variable 'k' [-Wunused-variable]
    6 |  long long n,s,p,k,m,k1,m1,a,b,c,d;
      |                  ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...