結果
| 問題 | No.1218 Something Like a Theorem |
| コンテスト | |
| ユーザー |
anagohirame
|
| 提出日時 | 2020-07-19 22:15:52 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 104 ms / 2,000 ms |
| + 208µs | |
| コード長 | 290 bytes |
| 記録 | |
| コンパイル時間 | 57 ms |
| コンパイル使用メモリ | 14,848 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2026-10-04 17:15:09 |
| 合計ジャッジ時間 | 1,986 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 16 |
ソースコード
n, z = map(int, input().split())
if n > 2:
print("No")
elif n == 1:
if z == 1:
print("No")
else:
print("Yes")
else:
ok = False
for x in range(1, z):
for y in range(x, z):
if x*x + y*y == z*z:
print("Yes")
ok = True
break
if ok:
break
if not ok:
print("No")
anagohirame