結果

問題 No.1585 Cubic Number
ユーザー momoyuu
提出日時 2024-08-08 15:14:27
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 436 bytes
コンパイル時間 956 ms
コンパイル使用メモリ 91,332 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-08-08 15:14:30
合計ジャッジ時間 2,228 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;
using ll = long long;

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

    ll n;
    cin>>n;
    ll right = 1e6 + 1;
    ll left = 0;
    while(right-left>1){
        ll mid = (right+left) / 2;
        if(mid*mid*mid>=n) right = mid;
        else left = mid;
    }
    if(right*right*right==n) cout<<"Yes\n";
    else cout<<"No\n";
}   

0