/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 4ms 1.98 MiB
#2 Accepted 4ms 2.074 MiB
#3 Accepted 4ms 1.867 MiB
#4 Accepted 4ms 1.824 MiB

Code

#include<bits/stdc++.h>
using namespace std;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); /// mt19937_64 (long long)

///................policy based data structure.................
///#include<ext/pb_ds/assoc_container.hpp>
///#include<ext/pb_ds/tree_policy.hpp>
///using namespace __gnu_pbds;
///template<typename T> using orderset = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
///(X).order_of_key(value) ///  return the number of elements strictly less than value
///(*X).find_by_order(index) /// return the address of (index+1)th element
///*.....................-_-........................*///


#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define endl "\n"
#define PI acos(-1)
#define int long long
#define ll long long
#define ld long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vll vector<ll>
#define vpll vector<pll>
#define vpii vector<pii>
#define pb push_back
#define cp make_pair
#define ff first
#define ss second
#define sz(v) (int)v.size()
#define all(v) v.begin(),v.end()
#define fraction(x) fixed<<setprecision(x)
#define strtoint(a) atoi(a.c_str())


#define time() cerr<<"Time elapsed : "<<clock()*1000.0/CLOCKS_PER_SEC<<"ms"<<'\n'


///................ Number theory....................
const int MOD=1e9+7;
const int N=2e5+123;
/// compute a^b
///when b is very larger(b=b^c)
///(a^b) % m= (a^(b%phi(m)))%m,where m is any number
///( a^b) % m=(a^((b^c)%(m-1)))%m, where m is prime number
vector<int>fact(N);
int gcd(int a, int b){return (b==0)?a:gcd(b,a%b);}
int lcm(int a, int b){return a*(b/gcd(a,b));}
void normal(int &a) { a %= MOD; (a < 0) && (a += MOD); }
int modMul(int a, int b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
int modAdd(int a, int b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
int modSub(int a, int b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
int modPow(int b, int p) { int r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
int modInverse(int a) { return modPow(a, MOD-2); }
int modDiv(int a, int b) { return modMul(a, modInverse(b)); }
int mod_exp(int b, int p, int m){int x = 1;while(p){if(p&1)x=(x*b)%m;b=(b*b)%m;p=p<<1;}return x;}
///int invFermat(int a, int p){return mod_exp(a, p-2, p);}
int exp(int b, int p){int x = 1;while(p){if(p&1)x=(x*b);b=(b*b);p=p>>1;}return x;}
void preFactorial() { fact[0] = 1; for(int i = 1; i < N; i++) fact[i] = modMul(i, fact[i - 1]);}
int nCr(int n, int r) { if(n < r) return 0; return modDiv(fact[n], modMul(fact[r], fact[n - r]));}
bool isPrime(ll n) { if(n == 1) return false; for(ll i = 2; i <= sqrt(n); i++) { if(n % i == 0) return false;} return true;}
///*.....................-_-........................*///

template<class T> using pq = priority_queue<T, vector<T>, greater<T>>;//min heap
template<class T> using pq1 = priority_queue<T>;//max heap
template<class T> ll LB(vector<T> &v,T a){return lower_bound(v.begin(),v.end(),a)-v.begin();}
template<class T> ll UB(vector<T> &v,T a){return upper_bound(v.begin(),v.end(),a)-v.begin();}

///................ chess moves....................
/// int dx[] = {+0, +0, -1, +1}; ///Up-down, Left-Right
/// int dy[] = {+1, -1, +0, +0};
/// int dx[] = {+0,+0,+1,-1,-1,+1,-1,+1}; ///King's Move
/// int dy[] = {-1,+1,+0,+0,+1,+1,-1,-1};
/// int dx[] = {-2, -2, -1, -1,  1,  1,  2,  2}; ///Knight's Move
/// int dy[] = {-1,  1, -2,  2, -2,  2, -1,  1};
///*.....................-_-........................*///



///................ bitwise operation....................
#define MSB(mask) 63-__builtin_clzll(mask)  /// 0 -> -1
#define LSB(mask) __builtin_ctzll(mask)  /// 0 -> 64
#define ONE(mask) __builtin_popcountll(mask)
#define CHECK(mask,bit) (mask&(1LL<<bit))
#define ON(mask,bit) (mask(1LL<<bit))
#define OFF(mask,bit) (mask&~(1LL<<bit))
#define CHANGE(mask,bit) (mask^(1LL<<bit))
#define leastonepos(x) __builtin_ffs(x)
#define leadingoff(x) __builtin_clz(x)
#define trailingoff(x) __builtin_ctz(x)
#define numofone(x) __builtin_popcount(x)
///*.....................-_-........................*///



///................ debug...............................
template<typename F,typename S>ostream&operator<<(ostream&os,const pair<F,S>&p){return os<<"("<<p.first<<", "<<p.second<<")";}
template<typename T>ostream&operator<<(ostream&os,const vector<T>&v){os<<"{";for(auto it=v.begin();it!=v.end();++it){if(it!=v.begin())os<<", ";os<<*it;}return os<<"}";}
template<typename T>ostream&operator<<(ostream&os,const set<T>&v){os<<"[";for(auto it=v.begin();it!=v.end();++it){if(it!=v.begin())os<<",";os<<*it;}return os<<"]";}
template<typename T>ostream&operator<<(ostream&os,const multiset<T>&v) {os<<"[";for(auto it=v.begin();it!=v.end();++it){if(it!=v.begin())os<<", ";os<<*it;}return os<<"]";}
template<typename F,typename S>ostream&operator<<(ostream&os,const map<F,S>&v){os<<"[";for(auto it=v.begin();it!=v.end();++it){if(it!=v.begin())os<<", ";os<<it->first<<" = "<<it->second;}return os<<"]";}
#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)
void faltu(){cerr << endl;}
template<typename T>void faltu(T a[],int n){for(int i=0;i<n;++i)cerr<<a[i]<<' ';cerr<<endl;}
template<typename T,typename...hello>void faltu(T arg,const hello&...rest){cerr<<arg<<' ';faltu(rest...);}
//#else
//#define dbg(args...)
///*.....................-_-........................*///


int32_t main()
{
    fast
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n;
    cin>>n;
    int ans=(n/3);
    if(n%3)++ans;
    cout<<ans<<endl;
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1106 too easy or three easy
Contest
Brain Booster #6
Language
C++11 (G++ 13.2.0)
Submit At
2024-10-03 15:37:48
Judged At
2024-12-17 11:36:32
Judged By
Score
100
Total Time
4ms
Peak Memory
2.074 MiB