結果

問題 No.1218 Something Like a Theorem
ユーザー Yahiya YusufzaiYahiya Yusufzai
提出日時 2020-09-04 23:27:37
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 513 bytes
コンパイル時間 1,599 ms
コンパイル使用メモリ 165,768 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-05-05 03:40:57
合計ジャッジ時間 5,142 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,624 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define repk(i,a,n) for(int i=a;i<=n;i++)
const int mxn = 50;
void sol() {
	int n, z; scanf("%d %d", &n, &z);
	// vector<int >a(n);
	// rep(i, 0, n)scanf("%d", &a[i]);
	bool ok = 0;

	repk(i, 1, z) {
		repk(j, 1, z) {

			if ( pow(i, n) + pow(j, n) == pow(z, n)) {
				ok = 1; break;
			}
		}
	}
	if (ok)cout << "Yes";
	else
		cout << "No";



}
int main() {

	// int _;
	// for (scanf("%d", &_); _; _--)
	sol();


	return 0;
}
0