結果

問題 No.1162 Many Quotients hard
ユーザー kotatsugame
提出日時 2020-10-07 21:46:45
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 724 ms / 2,000 ms
コード長 277 bytes
コンパイル時間 447 ms
コンパイル使用メモリ 63,232 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-20 04:10:57
合計ジャッジ時間 9,972 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 42
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
long N;
main()
{
	cin>>N;
	long ans=0;
	while((ans+1)*(ans+1)<=N)ans++;
	long r=N/(ans+1);
	while(r>=1)
	{
		long t=N/r;
		long l=N/(t+1);
		if(l+1==r)
		{
			ans+=r;
			break;
		}
		r=l;
		cout<<r<<endl;
		ans++;
	}
	cout<<ans<<endl;
}
0