結果

問題 No.537 ユーザーID
ユーザー bayashiko_r
提出日時 2018-11-18 01:53:20
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 47 ms / 2,000 ms
コード長 624 bytes
コンパイル時間 1,132 ms
コンパイル使用メモリ 112,908 KB
実行使用メモリ 26,912 KB
最終ジャッジ日時 2024-12-24 14:48:50
合計ジャッジ時間 3,600 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

class Program {
    static void Main(string[] args) {
        //入力
        long N = long.Parse(Console.ReadLine());

        //1~Nまで割り算をして、数字をくっつける
        List<string> ansArray = new List<string> { };
        for (long i = 1; i <= Math.Sqrt(N); i++) {
            if (N % i == 0) {
                ansArray.Add(i.ToString() + (N / i).ToString());
                ansArray.Add((N / i).ToString() + i.ToString());
            }
        }

        //出力
        Console.WriteLine(ansArray.Distinct().Count());
    }
}
0