結果
| 問題 | No.3331 Consecutive Cubic Sum |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-11-02 21:30:01 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 306 bytes |
| 記録 | |
| コンパイル時間 | 4,698 ms |
| コンパイル使用メモリ | 82,576 KB |
| 実行使用メモリ | 64,728 KB |
| 最終ジャッジ日時 | 2025-11-02 21:32:57 |
| 合計ジャッジ時間 | 4,343 ms |
|
ジャッジサーバーID (参考情報) |
judge7 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 42 WA * 5 |
ソースコード
n = int(input())
m = 60000
a = [(i ** 2 * (i + 1) ** 2) // 4 for i in range(m)]
i = j = 0
ans = []
while i < m:
while j < m and a[j] - a[i] < n:
j += 1
if j == m:
break
if a[j] - a[i] == n:
ans.append((i + 1, j))
i += 1
print(len(ans))
for ai in ans:
print(*ai)