結果

問題 No.164 ちっちゃくないよ!!
ユーザー kuuso1kuuso1
提出日時 2015-03-12 23:38:29
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,442 bytes
コンパイル時間 3,975 ms
コンパイル使用メモリ 106,116 KB
実行使用メモリ 25,188 KB
最終ジャッジ日時 2023-09-07 02:01:45
合計ジャッジ時間 4,240 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
20,960 KB
testcase_01 AC 63 ms
21,084 KB
testcase_02 WA -
testcase_03 AC 63 ms
20,992 KB
testcase_04 AC 65 ms
21,108 KB
testcase_05 AC 67 ms
23,008 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
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;
using System.Collections.Generic;
using System.Numerics;

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

class Sol{
	public void Solve(){
		
		char c='.';
		for(int i=0;i<N;i++){
			for(int j=0;j<S[i].Length;j++){
				c=(char)Math.Max((int)c,(int)S[i][j]);
			}
		}
		
		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');
		
		BigInteger B=D[c]+1;
		
		BigInteger Min=0;
		for(int i=0;i<N;i++){
			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