結果
| 問題 | No.1157 Many Quotients easy |
| ユーザー |
|
| 提出日時 | 2025-12-09 22:09:39 |
| 言語 | C# (.NET 8.0.404) |
| 結果 |
AC
|
| 実行時間 | 65 ms / 2,000 ms |
| コード長 | 659 bytes |
| 記録 | |
| コンパイル時間 | 7,788 ms |
| コンパイル使用メモリ | 167,340 KB |
| 実行使用メモリ | 187,404 KB |
| 最終ジャッジ日時 | 2025-12-09 22:09:50 |
| 合計ジャッジ時間 | 10,809 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (99 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System;
using System.Collections.Generic;
class Program
{
static void Main()
{
// 入力を受け取る
int n = int.Parse(Console.ReadLine());
// 商の値を格納するためのセットを作成
HashSet<int> quotients = new HashSet<int>();
// 1からnまでの数で割った商を計算
for (int i = 1; i <= n; i++)
{
int quotient = n / i;
quotients.Add(quotient); // 計算した商をセットに追加(重複しない)
}
// 結果として、セットのサイズを出力
Console.WriteLine(quotients.Count);
}
}