結果
| 問題 | 
                            No.3331 Consecutive Cubic Sum
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2025-11-02 21:59:34 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 4,024 ms / 5,000 ms | 
| コード長 | 371 bytes | 
| コンパイル時間 | 365 ms | 
| コンパイル使用メモリ | 82,320 KB | 
| 実行使用メモリ | 76,184 KB | 
| 最終ジャッジ日時 | 2025-11-02 22:02:53 | 
| 合計ジャッジ時間 | 194,071 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge6 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 47 | 
ソースコード
N = int(input())
def f(x):
    return x * (x + 1) // 2 * x * (x + 1) // 2
A = []
for L in range(1,2*10**6):
    Y = N + f(L-1)
    ok,ng=L,5*10**7
    while ng - ok > 1:
        m = (ok + ng) // 2
        if f(m) <= Y:
            ok = m
        else:
            ng = m
    if f(ok) == Y:
        A.append([L,ok])
A.sort()
print(len(A))
for a,b in A:
    print(a,b)