結果

問題 No.170 スワップ文字列(Easy)
ユーザー mbanmban
提出日時 2016-11-18 19:23:28
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 54 ms / 5,000 ms
コード長 821 bytes
コンパイル時間 2,140 ms
コンパイル使用メモリ 97,364 KB
実行使用メモリ 22,608 KB
最終ジャッジ日時 2023-08-24 16:35:37
合計ジャッジ時間 4,713 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
20,496 KB
testcase_01 AC 53 ms
20,452 KB
testcase_02 AC 53 ms
22,456 KB
testcase_03 AC 52 ms
20,468 KB
testcase_04 AC 52 ms
22,540 KB
testcase_05 AC 53 ms
22,608 KB
testcase_06 AC 53 ms
22,436 KB
testcase_07 AC 53 ms
22,512 KB
testcase_08 AC 51 ms
20,532 KB
testcase_09 AC 53 ms
22,524 KB
testcase_10 AC 53 ms
20,452 KB
testcase_11 AC 52 ms
22,432 KB
testcase_12 AC 52 ms
20,588 KB
testcase_13 AC 52 ms
20,492 KB
testcase_14 AC 53 ms
20,524 KB
testcase_15 AC 53 ms
20,516 KB
testcase_16 AC 53 ms
22,508 KB
testcase_17 AC 52 ms
20,540 KB
testcase_18 AC 54 ms
22,504 KB
testcase_19 AC 53 ms
20,552 KB
testcase_20 AC 54 ms
22,500 KB
testcase_21 AC 53 ms
20,464 KB
testcase_22 AC 53 ms
22,596 KB
testcase_23 AC 52 ms
18,440 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;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;

public class Magatro
{
    static void Main()
    {
        List<int> C = new List<int>();
        string s = Console.ReadLine();
        string w = s;
        while (s.Length > 0)
        {
            string q = s.Replace(s[0].ToString(), "");
            C.Add(s.Length - q.Length);
            s = q;
        }
        int ans = kaizyou(w.Length);
        for(int i = 0; i < C.Count; i++)
        {
            ans /= kaizyou(C[i]);
        }
        Console.WriteLine(ans-1);
    }
    static int kaizyou(int n)
    {
        if (n == 0)
        {
            return 1;
        }
        return n * (kaizyou(n - 1));
    }
}


0