結果
| 問題 |
No.1218 Something Like a Theorem
|
| コンテスト | |
| ユーザー |
merom686
|
| 提出日時 | 2020-09-04 21:28:24 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 18 ms / 2,000 ms |
| コード長 | 544 bytes |
| コンパイル時間 | 955 ms |
| コンパイル使用メモリ | 90,708 KB |
| 最終ジャッジ日時 | 2025-01-14 05:03:41 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 16 |
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;
int main() {
int n, z;
cin >> n >> z;
int b = 0;
if (n == 1) {
b = z >= 2;
} else if (n == 2) {
for (int i = 1; i < z; i++) {
int t = z * z - i * i;
int s = (int)sqrt(t);
if (s * s == t) b = 1;
}
} else {
b = 0;
}
cout << (b ? "Yes" : "No") << endl;
return 0;
}
merom686