結果

問題 No.164 ちっちゃくないよ!!
ユーザー NoNo
提出日時 2015-06-12 19:49:34
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 5,988 bytes
コンパイル時間 989 ms
コンパイル使用メモリ 122,276 KB
実行使用メモリ 28,288 KB
最終ジャッジ日時 2024-07-06 15:53:13
合計ジャッジ時間 1,900 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
19,584 KB
testcase_01 AC 22 ms
20,096 KB
testcase_02 AC 22 ms
20,096 KB
testcase_03 WA -
testcase_04 AC 23 ms
19,840 KB
testcase_05 WA -
testcase_06 AC 27 ms
20,096 KB
testcase_07 AC 24 ms
20,096 KB
testcase_08 AC 25 ms
19,840 KB
testcase_09 AC 26 ms
20,224 KB
testcase_10 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

namespace foryuki
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string[] num = new string[N];
            for (int i = 0; i < N; i++)
            {
                num[i] = Console.ReadLine();
            }

            decimal[] kouho = new decimal[N];

            for (int i = 0; i < N; i++)
            {
                kouho[i] = a(num[i]);
            }

            Console.WriteLine(kouho.Min());
            Console.ReadLine();
        }

        static decimal a(string num)
        {
            int kisu;
            decimal dn = 0;

            if (num.Contains("Z")) kisu = 36;
            else if (num.Contains("Y")) kisu = 35;
            else if (num.Contains("X")) kisu = 34;
            else if (num.Contains("W")) kisu = 33;
            else if (num.Contains("V")) kisu = 32;
            else if (num.Contains("U")) kisu = 31;
            else if (num.Contains("T")) kisu = 30;
            else if (num.Contains("S")) kisu = 29;
            else if (num.Contains("R")) kisu = 28;
            else if (num.Contains("Q")) kisu = 27;
            else if (num.Contains("P")) kisu = 26;
            else if (num.Contains("O")) kisu = 25;
            else if (num.Contains("N")) kisu = 24;
            else if (num.Contains("M")) kisu = 23;
            else if (num.Contains("L")) kisu = 22;
            else if (num.Contains("K")) kisu = 21;
            else if (num.Contains("J")) kisu = 20;
            else if (num.Contains("I")) kisu = 19;
            else if (num.Contains("H")) kisu = 18;
            else if (num.Contains("G")) kisu = 17;
            else if (num.Contains("F")) kisu = 16;
            else if (num.Contains("E")) kisu = 15;
            else if (num.Contains("D")) kisu = 14;
            else if (num.Contains("C")) kisu = 13;
            else if (num.Contains("B")) kisu = 12;
            else if (num.Contains("A")) kisu = 11;
            else if (num.Contains("9")) kisu = 10;
            else if (num.Contains("8")) kisu = 9;
            else if (num.Contains("7")) kisu = 8;
            else if (num.Contains("6")) kisu = 7;
            else if (num.Contains("5")) kisu = 6;
            else if (num.Contains("4")) kisu = 5;
            else if (num.Contains("3")) kisu = 4;
            else if (num.Contains("2")) kisu = 3;
            else if (num.Contains("1")) kisu = 2;
            else kisu = 1;

            string sisu;

            for (int i = 0; i < num.Length; i++)
            {
                sisu = num[num.Length - 1 - i].ToString();
                switch (sisu)
                {
                    case "Z":
                        sisu = "35";
                        break;
                    case "Y":
                        sisu = "34";
                        break;
                    case "X":
                        sisu = "33";
                        break;
                    case "W":
                        sisu = "32";
                        break;
                    case "V":
                        sisu = "31";
                        break;
                    case "U":
                        sisu = "30";
                        break;
                    case "T":
                        sisu = "29";
                        break;
                    case "S":
                        sisu = "28";
                        break;
                    case "R":
                        sisu = "27";
                        break;
                    case "Q":
                        sisu = "26";
                        break;
                    case "P":
                        sisu = "25";
                        break;
                    case "O":
                        sisu = "24";
                        break;
                    case "N":
                        sisu = "23";
                        break;
                    case "M":
                        sisu = "22";
                        break;
                    case "L":
                        sisu = "21";
                        break;
                    case "K":
                        sisu = "20";
                        break;
                    case "J":
                        sisu = "19";
                        break;
                    case "I":
                        sisu = "18";
                        break;
                    case "H":
                        sisu = "17";
                        break;
                    case "G":
                        sisu = "16";
                        break;
                    case "F":
                        sisu = "15";
                        break;
                    case "E":
                        sisu = "14";
                        break;
                    case "D":
                        sisu = "13";
                        break;
                    case "C":
                        sisu = "12";
                        break;
                    case "B":
                        sisu = "11";
                        break;
                    case "A":
                        sisu = "10";
                        break;
                    default:
                        break;
                }
                dn += decimal.Parse(sisu) * (decimal)Math.Pow(kisu, i);
            }
            return dn;
        }

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

        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