結果

問題 No.171 スワップ文字列(Med)
ユーザー NoNo
提出日時 2015-06-16 18:51:07
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 68 ms / 1,000 ms
コード長 1,265 bytes
コンパイル時間 2,306 ms
コンパイル使用メモリ 105,208 KB
実行使用メモリ 23,960 KB
最終ジャッジ日時 2023-09-21 09:04:08
合計ジャッジ時間 3,841 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
23,812 KB
testcase_01 AC 64 ms
21,788 KB
testcase_02 AC 65 ms
22,000 KB
testcase_03 AC 66 ms
22,080 KB
testcase_04 AC 66 ms
19,836 KB
testcase_05 AC 66 ms
21,960 KB
testcase_06 AC 67 ms
21,888 KB
testcase_07 AC 67 ms
21,812 KB
testcase_08 AC 68 ms
23,920 KB
testcase_09 AC 66 ms
21,904 KB
testcase_10 AC 63 ms
23,960 KB
testcase_11 AC 63 ms
21,932 KB
testcase_12 AC 65 ms
19,832 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;
using System.Numerics;
namespace foryuki
{
    class Program
    {
        static void Main(string[] args)
        {
            char[] c = Console.ReadLine().ToCharArray();

            BigInteger a = 1;
            for (int i = 1; i <= c.Length; i++)
            {
                a *= i;
            }

            BigInteger b = 1;
            var q1 = c.Distinct();
            foreach (var i in q1)
            {
                int k = c.Where(x => x == i).Count();
                for (int j = 1; j <= k; j++)
                {
                    b *= j;
                }
            }

            Console.WriteLine((a / b - 1) % 573);
        }



        //-------------------------------------------------------------

        static int[] ConvertStringArrayToIntArray(string[] array)
        {
            return Array.ConvertAll(array, str => int.Parse(str));
        }

        static List<int> ConvertStringArrayToIntList(string[] str)
        {
            var list = new List<int>();
            foreach (var c in str)
            {
                list.Add(int.Parse(c));
            }
            return list;
        }
    }
}
0