結果
問題 |
No.164 ちっちゃくないよ!!
|
ユーザー |
![]() |
提出日時 | 2020-03-24 10:37:06 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 741 bytes |
コンパイル時間 | 2,918 ms |
コンパイル使用メモリ | 194,360 KB |
最終ジャッジ日時 | 2025-01-09 10:00:58 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 |
ソースコード
#include<bits/stdc++.h> using lint=long long; void cmx(lint&x,lint y){if(x<y)x=y;} void cmn(lint&x,lint y){if(x>y)x=y;} int main(){ std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false); std::cout.setf(std::ios_base::fixed);std::cout.precision(15); lint n;std::cin>>n; std::vector<std::string>a(n); for(auto&&s:a)std::cin>>s; auto cal=[&](char c){ return std::isdigit(c)?c-'0':c-'A'+10; }; lint ans=std::numeric_limits<lint>::max(); for(auto&&s:a){ lint base=0; for(char c:s){ cmx(base,cal(c)); } base++; lint now=0; for(char c:s){ now=base*now+cal(c); } cmn(ans,now); } std::cout<<ans<<'\n'; }