結果
問題 | No.376 立方体のN等分 (2) |
ユーザー |
|
提出日時 | 2016-06-04 23:27:59 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 583 bytes |
コンパイル時間 | 730 ms |
コンパイル使用メモリ | 64,532 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-08 10:01:38 |
合計ジャッジ時間 | 33,668 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 35 TLE * 3 |
ソースコード
#include <iostream>#include <climits>using namespace std;typedef long long ll;int main(void){// Here your code !ll N;ll mi = LLONG_MAX;cin >> N;for(ll a=1;a*a*a<=N;a++){if(N%a!=0){continue;}ll M = N/a;for(ll b=1;b*b<=M;b++){if(M%b!=0){continue;}ll c = M/b;ll total = (a-1)+(b-1)+(c-1);if(total < mi){mi = total;}}}cout << mi << " " << N-1 << endl;return 0;}