結果
| 問題 | 
                            No.2480 Sequence Sum
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2023-09-22 21:36:26 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 3 ms / 500 ms | 
| コード長 | 262 bytes | 
| コンパイル時間 | 498 ms | 
| コンパイル使用メモリ | 63,104 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-26 14:34:02 | 
| 合計ジャッジ時間 | 1,174 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 13 | 
ソースコード
#include<iostream>
#include<cassert>
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int N;
	cin>>N;
	int ans=0;
	int l=1;
	while(l<N)
	{
		int q=N/l;
		int r=N/q;
		ans+=r-l;
		if(N%r>0)ans++;
		l=r+1;
	}
	cout<<ans<<endl;
}