結果

問題 No.1157 Many Quotients easy
ユーザー RISE70226821
提出日時 2020-08-18 10:37:15
言語 Java
(openjdk 23)
結果
AC  
実行時間 154 ms / 2,000 ms
コード長 489 bytes
コンパイル時間 2,195 ms
コンパイル使用メモリ 75,224 KB
実行使用メモリ 54,520 KB
最終ジャッジ日時 2024-10-12 01:39:52
合計ジャッジ時間 7,002 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.lang.*;
import java.io.*;

public class Main {
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		// 入力
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		// カウント
		Set<Integer> hs = new HashSet<>();
		for(int i = 1; i <= N; i++){
			int sho = N / i;
			if(!hs.contains(sho)){
				hs.add(sho);
			}
		}
		
		// 出力
		System.out.println(hs.size());
	}
}
0