結果
問題 |
No.375 立方体のN等分 (1)
|
ユーザー |
|
提出日時 | 2016-06-09 13:15:53 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 551 bytes |
コンパイル時間 | 484 ms |
コンパイル使用メモリ | 63,460 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-09 06:16:11 |
合計ジャッジ時間 | 1,504 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 WA * 2 |
ソースコード
#include <iostream> #include <algorithm> #include <vector> using namespace std; typedef long long ll; vector<ll> vec; int main(){ ll N; cin>>N; for(ll i=0;(i-1)*(i-1)<=N;i++){ if(N%(i+1)==0)vec.push_back(i+1); } //for(int i=0;i<vec.size();i++)cout<<vec[i]<<endl; ll t=1e14; for(ll i=0;i<vec.size();i++){ for(ll j=i;j<vec.size();j++){ int k=N/(vec[i]*vec[j]); if(vec[i]*vec[j]*k==N){ ll temp=vec[i]+vec[j]+k; t=min(t,temp-3); } } } //cout <<"t="<<t<<endl; t=min(t,N-1); cout<<t<<" "<<N-1<<endl; return 0; }