結果
| 問題 | No.376 立方体のN等分 (2) | 
| コンテスト | |
| ユーザー |  koyopro | 
| 提出日時 | 2020-01-04 00:25:06 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 490 bytes | 
| コンパイル時間 | 1,336 ms | 
| コンパイル使用メモリ | 158,880 KB | 
| 実行使用メモリ | 13,640 KB | 
| 最終ジャッジ日時 | 2024-11-22 19:55:16 | 
| 合計ジャッジ時間 | 212,863 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 3 TLE * 35 | 
ソースコード
#include "bits/stdc++.h"
using namespace std;
int N,M,L;
signed main()
{
#if DEBUG
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
#endif
    cin>>N;
    
    int mi = N-1;
    for(int i=2; i*i*i<=N; i++) {
        if (N%i) continue;
        int a = N/i;
        for (int j=i; j*j<=a; j++) {
            if (a%j) continue;
            int k = a/j;
            mi = min(mi, i + j + k - 3);
        }
    }
    
     cout << mi << " " << N-1 << endl;
    
    return 0;
}
            
            
            
        