Accepted
Code
#include <bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);
using ll = long long;
int main() {
FAST;
ll n, i, mx, ans;
cin >> n;
mx = min(1000ll, n/5);
ans = 0;
for (i = 0; i <= mx; ++i) {
ans = max(ans, i*5 + ((n-i*5)/500) * 1000);
}
cout << ans << "\n";
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1132 Festivity Frenzy!
- Contest
- Brain Booster #8
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-02-17 16:43:47
- Judged At
- 2025-02-17 16:43:47
- Judged By
- Score
- 100
- Total Time
- 2ms
- Peak Memory
- 564.0 KiB