結果

問題 No.170 スワップ文字列(Easy)
ユーザー mencottonmencotton
提出日時 2018-02-18 16:49:28
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 57 ms / 5,000 ms
コード長 735 bytes
コンパイル時間 4,487 ms
コンパイル使用メモリ 104,408 KB
実行使用メモリ 22,728 KB
最終ジャッジ日時 2023-09-07 11:05:48
合計ジャッジ時間 7,291 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
20,644 KB
testcase_01 AC 57 ms
20,584 KB
testcase_02 AC 56 ms
20,692 KB
testcase_03 AC 56 ms
22,660 KB
testcase_04 AC 57 ms
20,572 KB
testcase_05 AC 56 ms
20,564 KB
testcase_06 AC 55 ms
20,520 KB
testcase_07 AC 55 ms
20,576 KB
testcase_08 AC 55 ms
20,648 KB
testcase_09 AC 55 ms
22,540 KB
testcase_10 AC 56 ms
22,728 KB
testcase_11 AC 55 ms
22,532 KB
testcase_12 AC 57 ms
18,416 KB
testcase_13 AC 55 ms
20,604 KB
testcase_14 AC 55 ms
20,540 KB
testcase_15 AC 56 ms
20,428 KB
testcase_16 AC 56 ms
20,576 KB
testcase_17 AC 56 ms
20,608 KB
testcase_18 AC 54 ms
20,604 KB
testcase_19 AC 55 ms
20,648 KB
testcase_20 AC 55 ms
22,696 KB
testcase_21 AC 54 ms
20,540 KB
testcase_22 AC 56 ms
20,588 KB
testcase_23 AC 55 ms
18,588 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;

namespace _170
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            Dictionary<char,int> dic = new Dictionary<char,int>();
            for (int i = 0; i < s.Length; i++)
            {
                if (!dic.ContainsKey(s[i])) dic[s[i]] = 0;
                dic[s[i]]++;
            }
            long ret = 1;
            for (int i = 1; i <= s.Length; i++) ret *= i;
            foreach (var item in dic)
            {
                int a = 1;
                for (int i = 1; i <= item.Value; i++) a *= i;
                ret /= a;
            }
            Console.WriteLine(ret - 1);
        }
    }
}
0