結果
| 問題 | No.164 ちっちゃくないよ!! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-02-11 12:05:16 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 319 bytes |
| 記録 | |
| コンパイル時間 | 444 ms |
| コンパイル使用メモリ | 66,380 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-01 07:16:31 |
| 合計ジャッジ時間 | 928 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
コンパイルメッセージ
main.cpp:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
3 | main(){
| ^~~~
ソースコード
#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,i=0;
for(;s.size()>i;i++)mx=max(mx,s[i]-(s[i]<='9'?47:54));--i;
for(;0<=i;i--)z+=q*(s[i]-(s[i]<='9'?48:55)),q*=mx;
ans=min(z,(ans==-1?z:ans));
}
cout << ans << endl;
}