結果

問題 No.3037 トグルトグルトグル!
ユーザー otoshigo
提出日時 2025-02-28 21:29:22
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 584 bytes
コンパイル時間 1,773 ms
コンパイル使用メモリ 192,784 KB
実行使用メモリ 8,484 KB
最終ジャッジ日時 2025-03-07 08:46:11
合計ジャッジ時間 2,512 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
template<class T> bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;}
template<class T> bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;}

void Solve(){
    ll N;
    cin>>N;
    ll ok=0,ng=1e9+10;
    while(ng-ok>1){
        ll mid=(ok+ng)/2;
        if(mid*mid<=N)ok=mid;
        else ng=mid;
    }
    cout<<ok<<"\n";
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    Solve();
}
0