結果

問題 No.164 ちっちゃくないよ!!
ユーザー tonegawa
提出日時 2020-08-16 21:50:01
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 293 bytes
コンパイル時間 698 ms
コンパイル使用メモリ 67,456 KB
最終ジャッジ日時 2025-01-13 02:07:29
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
    4 | main(){
      | ^~~~

ソースコード

diff #

#include <iostream>
using namespace std;
long t,a=-1;
main(){
    cin>>t;
	while(t--){
		string s;cin>>s;
		long z=0,q=1;int m=2,i=0;
		for(;s.size()>i;i++)m=max(m,s[i]-(s[i]<='9'?47:54));--i;
		for(;0<=i;i--)z+=q*(s[i]-(s[i]<='9'?48:55)),q*=m;
		a=min(z,(a==-1?z:a));
	}
	cout << a << endl;
}
0