結果

問題 No.1157 Many Quotients easy
ユーザー RISE70226821RISE70226821
提出日時 2020-08-18 10:37:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 155 ms / 2,000 ms
コード長 489 bytes
コンパイル時間 2,259 ms
コンパイル使用メモリ 75,576 KB
実行使用メモリ 41,756 KB
最終ジャッジ日時 2024-04-20 06:32:23
合計ジャッジ時間 6,484 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
41,392 KB
testcase_01 AC 132 ms
41,628 KB
testcase_02 AC 114 ms
41,256 KB
testcase_03 AC 132 ms
41,576 KB
testcase_04 AC 145 ms
41,288 KB
testcase_05 AC 145 ms
41,500 KB
testcase_06 AC 142 ms
41,036 KB
testcase_07 AC 121 ms
41,756 KB
testcase_08 AC 132 ms
41,424 KB
testcase_09 AC 135 ms
40,368 KB
testcase_10 AC 140 ms
41,560 KB
testcase_11 AC 142 ms
41,700 KB
testcase_12 AC 143 ms
41,496 KB
testcase_13 AC 144 ms
41,212 KB
testcase_14 AC 154 ms
41,416 KB
testcase_15 AC 136 ms
41,260 KB
testcase_16 AC 155 ms
41,036 KB
testcase_17 AC 126 ms
41,468 KB
testcase_18 AC 119 ms
41,724 KB
testcase_19 AC 127 ms
41,140 KB
testcase_20 AC 124 ms
41,208 KB
testcase_21 AC 99 ms
41,044 KB
testcase_22 AC 101 ms
41,244 KB
testcase_23 AC 102 ms
41,576 KB
権限があれば一括ダウンロードができます

ソースコード

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