結果

問題 No.413 +5,000,000pts
ユーザー furafura
提出日時 2020-10-21 18:34:10
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 15 ms / 5,000 ms
コード長 406 bytes
コンパイル時間 2,026 ms
コンパイル使用メモリ 200,268 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-09-28 14:17:48
合計ジャッジ時間 2,749 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;
using lint=long long;

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

int main(){
	vector<lint> ans;
	for(lint t=1e9;t>0;t--) if(t*t+t-1<=1e18) {
		lint s=calc(t*t+t-1);
		if(s==t){
			ans.emplace_back(t*t+t-1);
			if(ans.size()==1e5) break;
		}
	}
	rep(i,ans.size()) printf("%lld\n",ans[i]);

	return 0;
}
0