結果

問題 No.170 スワップ文字列(Easy)
ユーザー AreTrashAreTrash
提出日時 2016-04-15 17:31:30
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 53 ms / 5,000 ms
コード長 583 bytes
コンパイル時間 3,393 ms
コンパイル使用メモリ 100,464 KB
実行使用メモリ 22,600 KB
最終ジャッジ日時 2023-08-24 16:28:24
合計ジャッジ時間 4,617 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
18,420 KB
testcase_01 AC 51 ms
22,592 KB
testcase_02 AC 50 ms
20,460 KB
testcase_03 AC 51 ms
20,480 KB
testcase_04 AC 50 ms
22,596 KB
testcase_05 AC 51 ms
22,600 KB
testcase_06 AC 50 ms
20,548 KB
testcase_07 AC 50 ms
18,516 KB
testcase_08 AC 51 ms
20,544 KB
testcase_09 AC 52 ms
22,556 KB
testcase_10 AC 53 ms
20,612 KB
testcase_11 AC 51 ms
20,524 KB
testcase_12 AC 51 ms
20,396 KB
testcase_13 AC 51 ms
20,564 KB
testcase_14 AC 50 ms
20,556 KB
testcase_15 AC 50 ms
20,488 KB
testcase_16 AC 51 ms
20,440 KB
testcase_17 AC 50 ms
20,628 KB
testcase_18 AC 51 ms
20,552 KB
testcase_19 AC 51 ms
22,536 KB
testcase_20 AC 51 ms
22,528 KB
testcase_21 AC 51 ms
20,520 KB
testcase_22 AC 50 ms
22,496 KB
testcase_23 AC 50 ms
18,512 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace No170_1{
    public class Program{
        public static void Main(string[] args){
            var str = Console.ReadLine();
            var length = str.Length;
            var charCount = new int[26];
            var result = 1;

            foreach(var s in str)
                charCount[s - 'A']++;

            for(var i = 2; i <= length; i++)
                result *= i;

            foreach(var cc in charCount)
                for(var i = 2; i <= cc; i++)
                    result /= i;

            Console.WriteLine(--result);
        }
    }
}
0