結果

問題 No.1585 Cubic Number
ユーザー Daniel MurphyDaniel Murphy
提出日時 2021-07-08 22:25:22
言語 C++14
(gcc 11.2.0 + boost 1.78.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 377 bytes
コンパイル時間 2,660 ms
使用メモリ 4,028 KB
最終ジャッジ日時 2023-02-01 20:01:07
合計ジャッジ時間 2,838 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 1 ms
3,980 KB
testcase_01 AC 1 ms
3,696 KB
testcase_02 AC 1 ms
3,848 KB
testcase_03 AC 2 ms
3,768 KB
testcase_04 AC 2 ms
3,820 KB
testcase_05 AC 1 ms
4,028 KB
testcase_06 AC 1 ms
3,772 KB
testcase_07 AC 2 ms
3,876 KB
testcase_08 AC 2 ms
3,840 KB
testcase_09 AC 1 ms
3,772 KB
testcase_10 AC 1 ms
3,840 KB
testcase_11 AC 2 ms
3,776 KB
testcase_12 AC 2 ms
4,024 KB
testcase_13 AC 1 ms
3,776 KB
testcase_14 AC 2 ms
3,804 KB
testcase_15 AC 2 ms
3,772 KB
testcase_16 AC 2 ms
3,900 KB
testcase_17 AC 1 ms
3,824 KB
testcase_18 AC 1 ms
3,932 KB
testcase_19 AC 1 ms
3,808 KB
testcase_20 AC 2 ms
3,920 KB
testcase_21 AC 1 ms
3,812 KB
testcase_22 AC 1 ms
3,768 KB
testcase_23 AC 2 ms
3,824 KB
testcase_24 AC 1 ms
3,820 KB
testcase_25 AC 1 ms
4,016 KB
testcase_26 AC 1 ms
3,840 KB
testcase_27 AC 1 ms
3,924 KB
testcase_28 AC 2 ms
3,876 KB
testcase_29 AC 2 ms
3,880 KB
testcase_30 AC 2 ms
3,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#define ll long long

void solve() {
	ll n; cin >> n;
	ll r = pow(n, 1.0 / 3.0);
	for (ll i = r - 2; i <= r + 2; ++i) {
		if (i * i * i == n) {
			cout << "Yes\n";
			return;
		}
	}
	cout << "No\n";
	return;
}

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

	ll t = 1;
	//cin >> t;
	while (t--) {
		solve();
	}

	return 0;
}
0