/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 328.0 KiB
#2 Accepted 2ms 328.0 KiB
#3 Accepted 2ms 540.0 KiB
#4 Accepted 2ms 332.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define prime_number[21]={11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97}
///POLICY BASED DATA STRUCTURE..
///order_of_key return number of element which are strictly greater/smaller than x..
///find_by_order return ans iterator corresponding to the xth position of the set..
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace __gnu_pbds;
void fast(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

int main(){
    fast();
    int tc=1;
  //  cin>>tc;
    int h=1;
    while(tc--){
     int a;
        cin>>a;
        if(a%3==0){
            cout<<a/3<<endl;
        }
        else if(a%3==2){
            cout<<a/3 +1 <<endl;
                    }
                    else{
                        int k=a/3;
                        k=(k-1)*3;
                        int ans=k/3;
                        cout<<ans+2<<endl;
                    }
    }

}

Information

Submit By
Type
Submission
Problem
P1106 too easy or three easy
Contest
Brain Booster #6
Language
C++17 (G++ 13.2.0)
Submit At
2024-10-03 15:40:09
Judged At
2024-12-17 11:36:23
Judged By
Score
100
Total Time
2ms
Peak Memory
540.0 KiB