結果

問題 No.413 +5,000,000pts
ユーザー koprickykopricky
提出日時 2017-08-18 07:38:36
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,251 bytes
コンパイル時間 1,356 ms
コンパイル使用メモリ 158,980 KB
実行使用メモリ 6,816 KB
最終ジャッジ日時 2024-04-22 15:37:35
合計ジャッジ時間 1,883 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(a, b) for(auto (a): (b))
#define all(v) (v).begin(),(v).end()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define svec(v) cout<<#v<<":";rep(kbrni,v.size())cout<<" "<<v[kbrni];cout<<endl
#define sset(s) cout<<#s<<":";each(kbrni,s)cout<<" "<<kbrni;cout<<endl
#define smap(m) cout<<#m<<":";each(kbrni,m)cout<<" {"<<kbrni.first<<":"<<kbrni.second<<"}";cout<<endl

using namespace std;

typedef pair<int,int>P;

const int MAX_N = 100005;

ll calc(ll d) {
  return (ll)((-1 + sqrt(1 + 4*d)) / 2.0);
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n=1;
    rep(i,18){
        n *= 10;
    }
    int cnt = 0;
    while(cnt >= 100000){
        ll res = calc(n);
        if(res*res + res > n){
            cout << n << endl;
            n--;
            continue;
        }
        res++;
        if(res*res + res <= n){
            cout << n << endl;
            n--;
        }
    }
    return 0;
}
0