結果

問題 No.2392 二平方和
ユーザー tatianyi
提出日時 2023-07-28 21:32:00
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 336 bytes
コンパイル時間 2,789 ms
コンパイル使用メモリ 163,784 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-06 17:46:53
合計ジャッジ時間 4,209 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"

using i64 = std::int_fast64_t;

int main() {
	std::cin.tie(nullptr)->sync_with_stdio(false);
	i64 x;
	std::cin >> x;
	for (i64 i = 1; i <= sqrt(x); i++) {
		for (i64 j = i; j <= sqrt(x); j++) {
			if (i * i + j * j == x) {
				std::cout << "Yes\n";
				return 0;
			}
		}
	}
	std::cout << "No\n";
	return 0;
}
0