結果

問題 No.413 +5,000,000pts
ユーザー kotatsugamekotatsugame
提出日時 2020-02-20 04:08:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 347 bytes
コンパイル時間 731 ms
コンパイル使用メモリ 69,112 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-04-17 06:17:20
合計ジャッジ時間 1,352 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
5,248 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    8 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<cmath>
using namespace std;
long calc(long d)
{
	return(long)((-1+sqrt(1+4*d))/2.0);
}
main()
{
	int cnt=0;
	for(long t=999999999;cnt<100000;t--)
	{
		long d=t*t+t-1;
		long lim=(t-1)*(t-1)+t-1;
		while(lim<=d&&cnt<100000)
		{
			if(calc(d)!=t-1)
			{
				cout<<d<<endl;
				cnt++;
			}
			else break;
			d--;
		}
	}
}
0