結果

問題 No.537 ユーザーID
ユーザー kimnykimny
提出日時 2017-12-10 21:49:18
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 332 ms / 2,000 ms
コード長 1,588 bytes
コンパイル時間 2,085 ms
コンパイル使用メモリ 104,320 KB
実行使用メモリ 18,532 KB
最終ジャッジ日時 2024-05-07 17:00:09
合計ジャッジ時間 4,580 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
17,536 KB
testcase_01 AC 19 ms
17,408 KB
testcase_02 AC 18 ms
17,280 KB
testcase_03 AC 19 ms
17,664 KB
testcase_04 AC 19 ms
17,792 KB
testcase_05 AC 18 ms
17,664 KB
testcase_06 AC 19 ms
17,792 KB
testcase_07 AC 18 ms
17,664 KB
testcase_08 AC 18 ms
17,664 KB
testcase_09 AC 19 ms
17,664 KB
testcase_10 AC 18 ms
17,408 KB
testcase_11 AC 19 ms
17,664 KB
testcase_12 AC 19 ms
17,664 KB
testcase_13 AC 20 ms
17,664 KB
testcase_14 AC 19 ms
17,408 KB
testcase_15 AC 19 ms
17,792 KB
testcase_16 AC 19 ms
17,664 KB
testcase_17 AC 20 ms
17,664 KB
testcase_18 AC 36 ms
17,536 KB
testcase_19 AC 31 ms
17,792 KB
testcase_20 AC 29 ms
17,536 KB
testcase_21 AC 32 ms
17,920 KB
testcase_22 AC 39 ms
17,536 KB
testcase_23 AC 33 ms
17,664 KB
testcase_24 AC 23 ms
17,920 KB
testcase_25 AC 41 ms
17,536 KB
testcase_26 AC 45 ms
17,408 KB
testcase_27 AC 36 ms
17,408 KB
testcase_28 AC 126 ms
18,048 KB
testcase_29 AC 332 ms
18,532 KB
testcase_30 AC 237 ms
18,304 KB
testcase_31 AC 29 ms
17,664 KB
testcase_32 AC 29 ms
17,664 KB
testcase_33 AC 106 ms
18,048 KB
testcase_34 AC 38 ms
17,536 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
using System.Text;
using System.Threading.Tasks;

namespace yukicoder_537 {
    class Program {
        static void Main(string[] args) {
            long n = long.Parse(Console.ReadLine());
            long count = 0;
            for(int i = 1; i <= Math.Sqrt(n); i++) {
                if (n % i == 0) {
                    count++;
                }
            }
            long[,] a = new long[count, 2];
            for(int i = 0; i < count; i++) {
                if (i == 0) {
                    a[i, 0] = 1;
                    a[i, 1] = n;
                } else {
                    for (long k = a[i - 1, 0] + 1; k <= Math.Sqrt(n); k++) {
                        if (n % k == 0) {
                            a[i, 0] = k;
                            a[i, 1] = n / k;
                            break;
                        }
                    }
                }
            }
            string[] s = new string[count * 2];
            for(int i = 0; i < count; i++) {
                s[i * 2] = a[i, 0].ToString() + a[i, 1].ToString();
                s[i * 2 + 1] = a[i, 1].ToString() + a[i, 0].ToString();
            }
            long total = count*2;
            for(int i = 0; i < count * 2 - 1; i++) {
                for(int k = i + 1; k < count * 2; k++) {
                    if (s[i].Equals(s[k])) {
                        total--;
                    }
                }
            }
            
            Console.WriteLine(total);
            Console.ReadLine();
        }
    }
}
0