結果

問題 No.537 ユーザーID
ユーザー kimnykimny
提出日時 2017-12-10 21:49:18
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 462 ms / 2,000 ms
コード長 1,588 bytes
コンパイル時間 5,253 ms
コンパイル使用メモリ 108,184 KB
実行使用メモリ 22,820 KB
最終ジャッジ日時 2023-08-20 09:58:25
合計ジャッジ時間 10,094 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
20,776 KB
testcase_01 AC 56 ms
18,764 KB
testcase_02 AC 56 ms
20,668 KB
testcase_03 AC 56 ms
20,768 KB
testcase_04 AC 56 ms
18,568 KB
testcase_05 AC 57 ms
20,640 KB
testcase_06 AC 59 ms
20,716 KB
testcase_07 AC 63 ms
20,744 KB
testcase_08 AC 57 ms
20,776 KB
testcase_09 AC 56 ms
20,672 KB
testcase_10 AC 57 ms
18,844 KB
testcase_11 AC 56 ms
20,868 KB
testcase_12 AC 55 ms
18,616 KB
testcase_13 AC 58 ms
20,584 KB
testcase_14 AC 57 ms
18,764 KB
testcase_15 AC 58 ms
20,788 KB
testcase_16 AC 57 ms
20,672 KB
testcase_17 AC 58 ms
20,636 KB
testcase_18 AC 77 ms
20,696 KB
testcase_19 AC 74 ms
22,748 KB
testcase_20 AC 68 ms
20,664 KB
testcase_21 AC 71 ms
22,692 KB
testcase_22 AC 78 ms
20,728 KB
testcase_23 AC 71 ms
20,632 KB
testcase_24 AC 60 ms
20,892 KB
testcase_25 AC 79 ms
20,704 KB
testcase_26 AC 84 ms
22,816 KB
testcase_27 AC 74 ms
18,772 KB
testcase_28 AC 196 ms
22,692 KB
testcase_29 AC 462 ms
22,820 KB
testcase_30 AC 347 ms
20,792 KB
testcase_31 AC 65 ms
18,648 KB
testcase_32 AC 66 ms
20,816 KB
testcase_33 AC 167 ms
20,640 KB
testcase_34 AC 76 ms
22,820 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