結果

問題 No.375 立方体のN等分 (1)
ユーザー BantakoBantako
提出日時 2017-08-11 20:28:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 546 bytes
コンパイル時間 1,722 ms
コンパイル使用メモリ 162,312 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-20 22:23:39
合計ジャッジ時間 2,878 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
main.cpp: In function 'int main()':
main.cpp:25:17: warning: 'A[0]' may be used uninitialized [-Wmaybe-uninitialized]
   25 |     cout << A[0]+A[1]+A[2]-3 << " " << N-1 << endl;
      |             ~~~~^~~~~
main.cpp:7:10: note: 'A[0]' was declared here
    7 |     ll N,A[3],cnt;
      |          ^
main.cpp:19:17: warning: 'A[1]' may be used uninitialized [-Wmaybe-uninitialized]
   19 |         if(A[1] % i == 0){
      |            ~~~~~^~~
main.cpp:7:10: note: 'A[1]' was declared here
    7 |     ll N,A[3],cnt;
      |          ^
main.cpp:25:22: warning: 'A[2]' may be used uninitialized [-Wmaybe-uninitialized]
   25 |     cout << A[0]+A[1]+A[2]-3 << " " << N-1 << endl;
      |             ~~~~~~~~~^~~~~
main.cpp:7:10: note: 'A[2]' was declared here
    7 |     ll N,A[3],cnt;
      |          ^

ソースコード

diff #

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1e9;
int MOD = 1e9+7;
main(){
    ll N,A[3],cnt;
    cin >> N;
    for(cnt = 1;cnt*cnt*cnt <= N;cnt++){}
    for(ll i = cnt;i >= 1;i--){
        cout << i << endl;
        if(N % i == 0){
            A[0] = i;
            A[1] = N / i;
            break;
        }
    }
    for(ll i = cnt;i >= 1;i--){
        if(A[1] % i == 0){
            A[2] = i;
            A[1] = A[1] / i;
            break;
        }
    }
    cout << A[0]+A[1]+A[2]-3 << " " << N-1 << endl;
}
0