結果

問題 No.164 ちっちゃくないよ!!
ユーザー CleyLCleyL
提出日時 2020-02-11 11:54:34
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 362 bytes
コンパイル時間 505 ms
コンパイル使用メモリ 65,340 KB
実行使用メモリ 6,548 KB
最終ジャッジ日時 2024-04-08 14:34:50
合計ジャッジ時間 1,020 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~

ソースコード

diff #

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