結果
問題 | No.164 ちっちゃくないよ!! |
ユーザー | No |
提出日時 | 2015-06-12 20:44:08 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 34 ms / 2,000 ms |
コード長 | 6,100 bytes |
コンパイル時間 | 1,801 ms |
コンパイル使用メモリ | 117,580 KB |
実行使用メモリ | 20,224 KB |
最終ジャッジ日時 | 2024-10-13 14:16:03 |
合計ジャッジ時間 | 1,785 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 27 ms
19,840 KB |
testcase_01 | AC | 27 ms
19,840 KB |
testcase_02 | AC | 26 ms
19,840 KB |
testcase_03 | AC | 28 ms
19,712 KB |
testcase_04 | AC | 28 ms
19,584 KB |
testcase_05 | AC | 34 ms
20,224 KB |
testcase_06 | AC | 34 ms
20,096 KB |
testcase_07 | AC | 31 ms
19,968 KB |
testcase_08 | AC | 31 ms
19,840 KB |
testcase_09 | AC | 32 ms
19,840 KB |
testcase_10 | AC | 28 ms
19,712 KB |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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()); } 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 = 10; 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; } decimal ccc = 1; for (int k = 0; k < i; k++) { ccc = ccc * kisu; } dn += decimal.Parse(sisu) * ccc; } 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; } } }