結果
| 問題 | No.376 立方体のN等分 (2) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-02-21 16:49:37 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1,478 ms / 5,000 ms |
| コード長 | 374 bytes |
| 記録 | |
| コンパイル時間 | 526 ms |
| コンパイル使用メモリ | 74,428 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-13 09:39:06 |
| 合計ジャッジ時間 | 10,956 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 38 |
ソースコード
#include<iostream>
using namespace std;
typedef long long ll;
int main(){
ll n;
cin >> n;
ll ans = n;
for(ll i = 1; i*i*i <= n; i++){
if(n%i) continue;
for(ll j = 1; j*j <= n/i; j++){
if((n/i)%j) continue;
ans = min(ans, i-1+j-1+(n/i/j)-1);
}
}
cout << ans << " " << n-1 << endl;
return 0;
}