Submission #64523689


Source Code Expand

Copy
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
#define rep(i,n) for(ll i=0; i<n; i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rrep(i,n) for(ll i=n-1; i>=0; i--)
#define fi first
#define se second
#define pcnt __builtin_popcountll
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
typedef pair<ll,Pll> PlP;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<class A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}cout << "\n";}
template<typename T> void drop(const T &x){cout<<x<<endl;exit(0);}
string zero_padding(int val, int nf){ ostringstream sout;sout << setfill('0') << setw(nf) << val; return sout.str();};
const ld eps = 1e-10;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
#define rep(i,n) for(ll i=0; i<n; i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rrep(i,n) for(ll i=n-1; i>=0; i--)
#define fi first
#define se second
#define pcnt __builtin_popcountll
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
typedef pair<ll,Pll> PlP;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<class A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}cout << "\n";}
template<typename T> void drop(const T &x){cout<<x<<endl;exit(0);}
string zero_padding(int val, int nf){ ostringstream sout;sout << setfill('0') << setw(nf) << val; return sout.str();};
const ld eps = 1e-10;
const ll INF = 1e18; 
ull mo = 1000000007;
ld PI=asin(1)*2;
//using namespace atcoder;

int main(){
    ll N;
    cin >> N;
    ll ans = 0;
    REP(a,1,3){
        ll t = 1;
        rep(_, a) t *= 2;
        ll ng = 1e9;
        ll ok = 0;
        while(ng - ok > 1){
            ll wj = (ok + ng)/2;
            auto check = [&](ll b){
                if(b * b > 1e18/t) return false;
                ll res = b*b*t;
                return res <= N;
            };
            if(check(wj)) ok = wj;
            else ng = wj;
        }
        // cout << t << " " << ok << endl;
        ans += ok;
    }
    cout << ans << endl;
}

Submission Info

Submission Time
Task C - 2^a b^2
User zssa
Language C++ 20 (gcc 12.2)
Score 350
Code Size 1555 Byte
Status AC
Exec Time 1 ms
Memory 3680 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 350 / 350
Status
AC × 3
AC × 29
Set Name Test Cases
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt
Case Name Status Exec Time Memory
example_00.txt AC 1 ms 3540 KB
example_01.txt AC 1 ms 3404 KB
example_02.txt AC 1 ms 3472 KB
hand_00.txt AC 1 ms 3584 KB
hand_01.txt AC 1 ms 3448 KB
hand_02.txt AC 1 ms 3608 KB
hand_03.txt AC 1 ms 3480 KB
hand_04.txt AC 1 ms 3540 KB
hand_05.txt AC 1 ms 3404 KB
hand_06.txt AC 1 ms 3608 KB
hand_07.txt AC 1 ms 3480 KB
hand_08.txt AC 1 ms 3476 KB
hand_09.txt AC 1 ms 3544 KB
hand_10.txt AC 1 ms 3612 KB
random_00.txt AC 1 ms 3612 KB
random_01.txt AC 1 ms 3412 KB
random_02.txt AC 1 ms 3680 KB
random_03.txt AC 1 ms 3408 KB
random_04.txt AC 1 ms 3676 KB
random_05.txt AC 1 ms 3676 KB
random_06.txt AC 1 ms 3540 KB
random_07.txt AC 1 ms 3540 KB
random_08.txt AC 1 ms 3536 KB
random_09.txt AC 1 ms 3496 KB
random_10.txt AC 1 ms 3492 KB
random_11.txt AC 1 ms 3408 KB
random_12.txt AC 1 ms 3416 KB
random_13.txt AC 1 ms 3476 KB
random_14.txt AC 1 ms 3544 KB


2025-04-15 (Tue)
05:50:47 +00:00