結果
| 問題 | No.1593 Perfect Distance |
| コンテスト | |
| ユーザー |
SidewaysOwl
|
| 提出日時 | 2021-07-09 21:53:54 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 113 ms / 2,000 ms |
| + 399µs | |
| コード長 | 249 bytes |
| 記録 | |
| コンパイル時間 | 223 ms |
| コンパイル使用メモリ | 95,724 KB |
| 実行使用メモリ | 116,736 KB |
| 最終ジャッジ日時 | 2026-08-03 09:49:59 |
| 合計ジャッジ時間 | 3,144 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
from collections import defaultdict
ans = 0
n = int(input())
d = defaultdict(int)
l = [0] * n
for i in range(1,n):
d[i**2] += 1
l[i] = i ** 2
ans = 0
for i in range(1,n):
find = n ** 2 - l[i]
if find in d:
ans += 1
print(ans)
SidewaysOwl