結果

問題 No.170 スワップ文字列(Easy)
ユーザー AreTrash
提出日時 2016-04-15 17:31:30
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 25 ms / 5,000 ms
コード長 583 bytes
コンパイル時間 837 ms
コンパイル使用メモリ 103,424 KB
実行使用メモリ 17,536 KB
最終ジャッジ日時 2024-12-23 00:37:13
合計ジャッジ時間 2,218 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
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