結果
問題 | No.164 ちっちゃくないよ!! |
ユーザー |
|
提出日時 | 2019-08-08 00:36:20 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 448 bytes |
コンパイル時間 | 2,198 ms |
コンパイル使用メモリ | 193,364 KB |
最終ジャッジ日時 | 2025-01-07 10:59:09 |
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; int f(char c) { if ('0' <= c && c <= '9') return c-'0'; return c-'A'+10; } int main() { int n;cin>>n; ll ans = LLONG_MAX; for (int i=0;i<n;i++) { string s; cin>>s; int mx=0; for (char c:s) mx=max(mx,f(c)+1); ll d=0; for (char c:s) d=mx*d+f(c); ans=min(ans,d); } cout<<ans<<endl; return 0; }