結果
問題 | No.1218 Something Like a Theorem |
ユーザー |
![]() |
提出日時 | 2020-09-05 00:56:18 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 394 bytes |
コンパイル時間 | 3,529 ms |
コンパイル使用メモリ | 194,712 KB |
最終ジャッジ日時 | 2025-01-14 06:34:49 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 16 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main() {int N, Z;cin >> N >> Z;if (N == 1 && Z != 1) return cout << "Yes" << "\n", 0;vector<int> V;for (int i = 1; i <= Z; i++) V.push_back(pow(i, N));for (int i = 0; i < Z; i++) {for (int j = 0; j <= i; j++) {if (V.at(i) + V.at(j) == V.back()) return cout << "Yes" << "\n", 0;}}cout << "No" << "\n";}