結果

問題 No.508 超ゆとり教育
ユーザー DameningenDameningen
提出日時 2017-04-28 22:38:57
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,178 bytes
コンパイル時間 676 ms
コンパイル使用メモリ 88,260 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-11 19:17:33
合計ジャッジ時間 2,326 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<string>
#include<vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<list>
#include<set>
#include<map>
#include<cstring>
#include<sstream>
#include<cassert>
#define X first
#define Y second
#define pb push_back
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define reps(X,S,Y) for (int (X) = S;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define repe(X,Y) for ((X) = 0;(X) < (Y);++(X))
#define peat(X,Y) for (;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define rall(X) (X).rbegin(),(X).rend()
#define eb emplace_back
#define UNIQUE(X) (X).erase(unique(all(X)),(X).end())

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

int main()
{
    ll s;
    cin >> s;
    
    for (ll i = 0; i < s; ++i) {
        if (i < 1000000 && s <= 3 * (i + 1e6) * (i + 1e6)) {
            cout << i << endl;
            return 0;
        }
        if (i >= 1e6 && 3*(i-1e6)*(i-1e6) <= s && s <= 3*(i+1e6)*(i+1e6)) {
            cout << i << endl;
            return 0;
        }
    }
    
    return 0;
}





0