結果
| 問題 | No.164 ちっちゃくないよ!! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-02-11 11:51:44 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 403 bytes |
| 記録 | |
| コンパイル時間 | 600 ms |
| コンパイル使用メモリ | 68,160 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-01 07:16:13 |
| 合計ジャッジ時間 | 1,064 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main(){
| ^~~~
ソースコード
#include <iostream>
#include <algorithm>
using namespace std;
main(){
int t;cin>>t;
long long ans=-1;
while(t--){
string s;cin>>s;
int mx=2;for(int i = 0; s.size() > i; i++)mx = max(mx,s[i]-(s[i]<='9'?47:54));
long long z=0,q=1;
reverse(s.begin(),s.end());
for(int i=0;s.size()>i;i++)z+=q*(s[i]-(s[i]<='9'?48:55)),q*=mx;
if(ans==-1)ans=z;
else ans=min(ans,z);
}
cout << ans << endl;
}