結果

問題 No.1459 スマホを落としたいだけなのに
ユーザー 沙耶花
提出日時 2021-03-31 21:32:51
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 454 bytes
コンパイル時間 3,949 ms
コンパイル使用メモリ 249,288 KB
最終ジャッジ日時 2025-01-20 02:57:27
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 6
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000000


int main(){
	
	int N;
	cin>>N;
	
	long long ng = 0LL,ok = Inf;
	
	while(ok-ng>1LL){
		long long mid = (ok+ng)/2;
		
		long long t = mid;
		t *= mid+1;
		t /= 2;
		if(t>=N)ok = mid;
		else ng = mid;
		
	}
	cout<<ok<<endl;
	
    return 0;
}
0