結果

問題 No.164 ちっちゃくないよ!!
ユーザー kuuso1kuuso1
提出日時 2015-03-12 23:50:04
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 1,445 bytes
コンパイル時間 2,738 ms
コンパイル使用メモリ 105,504 KB
実行使用メモリ 23,072 KB
最終ジャッジ日時 2023-08-03 17:04:38
合計ジャッジ時間 3,994 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
20,992 KB
testcase_01 AC 61 ms
20,912 KB
testcase_02 AC 60 ms
20,864 KB
testcase_03 AC 62 ms
20,884 KB
testcase_04 AC 61 ms
20,952 KB
testcase_05 AC 65 ms
20,940 KB
testcase_06 AC 64 ms
23,072 KB
testcase_07 AC 63 ms
20,872 KB
testcase_08 AC 63 ms
18,872 KB
testcase_09 AC 63 ms
20,932 KB
testcase_10 AC 61 ms
20,880 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.Numerics;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		Dictionary<char,int> D=new Dictionary<char,int>();
		for(char x='0';x<='9';x++)D[x]=(int)(x-'0');
		for(char x='A';x<='Z';x++)D[x]=10+(int)(x-'A');
		for(int i=0;i<N;i++){
		}
		
		
		BigInteger Min=0;
		for(int i=0;i<N;i++){
			char c='.';
			for(int j=0;j<S[i].Length;j++){
				c=(char)Math.Max((int)c,(int)S[i][j]);
			}
			BigInteger B=D[c]+1;
			
			BigInteger bb=1;
			BigInteger bi=0;
			for(int j=S[i].Length-1;j>=0;j--){
				bi+=bb*D[S[i][j]];
				bb*=B;
			}
			if(i==0)Min=bi;
			Min=Min>bi?bi:Min;
		}
		
		Console.WriteLine(Min);
		
	}
	int N;
	String[] S;
	public Sol(){
		N=ri();
		S=new String[N];
		for(int i=0;i<N;i++)S[i]=rs();
	}




	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(){return Console.ReadLine().Split(' ');}
	static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));}
	static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}
	static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}
}
0