/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 1ms 532.0 KiB
#3 Accepted 1ms 532.0 KiB
#4 Accepted 1ms 532.0 KiB
#5 Accepted 1ms 532.0 KiB
#6 Accepted 1ms 532.0 KiB
#7 Accepted 1ms 516.0 KiB
#8 Accepted 1ms 532.0 KiB
#9 Accepted 1ms 764.0 KiB
#10 Accepted 1ms 536.0 KiB
#11 Accepted 1ms 480.0 KiB
#12 Accepted 1ms 764.0 KiB
#13 Accepted 1ms 512.0 KiB
#14 Accepted 1ms 532.0 KiB

Code

// Bismillahir Rahmanir Raheem
/* contest time
    1. No use of mobile (must);
    2. Think about problem not solution.
    3. Find full solution
    4. try to proof or find cases
    5. write  down solution
    6. then code

    practice time
    1. think for straigt half an hour .
    2. try to learn
    3. dont make the solve count
    4. make the learn count
    */
// READ PROBLEM AGAIN Andddd AGAIN.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define nl "\n"

#define faster ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);


int32_t main()
{
    faster;
    int n;
    ll result;
    cin >> n;
    if(n<500){
    	cout<<5*(n/5)<<nl;
    }
    else{
    	int rem = n % 500;
    	int mul = n / 500;
    	result = 1LL * mul * 1000;
    	result += (rem/5)*5;
    	cout<<result<<nl;
    }
    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 14:54:35
Judged At
2025-02-17 14:54:35
Judged By
Score
100
Total Time
1ms
Peak Memory
764.0 KiB