結果
| 問題 | No.375 立方体のN等分 (1) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-06-05 07:27:39 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 363 bytes |
| 記録 | |
| コンパイル時間 | 308 ms |
| コンパイル使用メモリ | 77,056 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-09-12 02:56:12 |
| 合計ジャッジ時間 | 2,288 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 9 WA * 23 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:20:13: warning: 'a' may be used uninitialized [-Wmaybe-uninitialized]
20 | tmin=a+b+c-3;
| ~^~
main.cpp:10:6: note: 'a' was declared here
10 | ll a,b,c;
| ^
ソースコード
#include <iostream>
#include <cmath>
using namespace std;
typedef long long ll;
int main(){
ll n; cin>>n;
ll tmin,tmax;
tmax=n-1;
tmin=n-1;
ll a,b,c;
ll x=1;
for(ll i=2; i<=cbrt(n); ++i){
if(n%i==0){
x=n/i;
a=i;
}
if(x%i==0){
b=i;
c=x/i;
tmin=a+b+c-3;
}
}
cout<<tmin<<" "<<tmax<<endl;
return 0;
}