結果

問題 No.375 立方体のN等分 (1)
ユーザー siguma323
提出日時 2016-06-04 23:24:58
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 510 bytes
コンパイル時間 1,630 ms
コンパイル使用メモリ 166,056 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-08 09:48:44
合計ジャッジ時間 2,930 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 3 WA * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using ull = unsigned long long;
using ll = long long;

int main()
{
    ull N;
    cin >> N;

    ll num1 = 1;
    ll num2= 1;
    ll count = num1*num2;

    count *= 2;

    while(count != N && count < N)
    {
        if(num2 < num1)
            ++num2;
        else
            ++num1;
        count = num1*num2*2;
    }

    if(count != N)
        cout << N-1 << ' ' << N-1 << endl;
    else
        cout << 1 + (num1-1) + (num2-1) << ' ' <<  N-1 << endl;

}
0