結果
問題 | No.164 ちっちゃくないよ!! |
ユーザー |
![]() |
提出日時 | 2015-03-12 23:50:04 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 33 ms / 2,000 ms |
コード長 | 1,445 bytes |
コンパイル時間 | 2,141 ms |
コンパイル使用メモリ | 115,208 KB |
実行使用メモリ | 20,096 KB |
最終ジャッジ日時 | 2024-10-13 14:08:05 |
合計ジャッジ時間 | 2,960 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 |
コンパイルメッセージ
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; 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));} }