結果
問題 |
No.164 ちっちゃくないよ!!
|
ユーザー |
👑 |
提出日時 | 2020-02-11 11:54:34 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 362 bytes |
コンパイル時間 | 437 ms |
コンパイル使用メモリ | 66,292 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-01 07:16:17 |
合計ジャッジ時間 | 884 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 WA * 10 |
コンパイルメッセージ
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; 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; }