結果
| 問題 |
No.3331 Consecutive Cubic Sum
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-11-05 03:55:37 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 377 bytes |
| コンパイル時間 | 305 ms |
| コンパイル使用メモリ | 82,232 KB |
| 実行使用メモリ | 219,760 KB |
| 最終ジャッジ日時 | 2025-11-05 03:56:54 |
| 合計ジャッジ時間 | 73,175 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge7 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 46 WA * 1 |
ソースコード
import bisect
N=int(input())
if N == 1:
print(0)
exit()
mem=[1]
ans=[]
for i in range(2, 10**6+1):
mem.append(mem[-1]+i*i*i)
if mem[-1] == N:
ans.append([1, i])
idx = bisect.bisect_left(mem, mem[-1]-N)
if idx < len(mem) and mem[idx] == mem[-1]-N:
ans.append([idx+2, i])
ans=sorted(ans)
print(len(ans))
for L, R in ans:
print(L, R)