結果
問題 | No.376 立方体のN等分 (2) |
ユーザー |
👑 |
提出日時 | 2023-11-06 22:47:27 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 323 bytes |
コンパイル時間 | 638 ms |
コンパイル使用メモリ | 66,312 KB |
最終ジャッジ日時 | 2025-02-17 19:50:31 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | TLE * 1 -- * 37 |
ソースコード
#include <iostream>using namespace std;int main(){long long n;cin>>n;long long ans = n-1;for(long long i = 2; n >= i*i; i++){long long m = n/i;for(long long j = i; m >= j*j; j++){if(m%j == 0){ans = min(ans, (i-1)+(j-1)+(m/j-1));}}}cout << ans << " " << n-1 << endl;}