結果

問題 No.413 +5,000,000pts
ユーザー fura
提出日時 2020-10-21 18:34:10
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 15 ms / 5,000 ms
コード長 406 bytes
コンパイル時間 2,047 ms
コンパイル使用メモリ 195,108 KB
最終ジャッジ日時 2025-01-15 12:17:00
ジャッジサーバーID
(参考情報)
judge2 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1
権限があれば一括ダウンロードができます

ソースコード

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