結果

問題 No.164 ちっちゃくないよ!!
ユーザー ngtkanangtkana
提出日時 2020-03-24 10:32:25
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 735 bytes
コンパイル時間 2,088 ms
コンパイル使用メモリ 201,664 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-30 05:12:34
合計ジャッジ時間 3,086 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 WA -
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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 base=0;
    for(auto&&s:a)for(char c:s){
        cmx(base,cal(c));
    }
    base++;
    lint ans=std::numeric_limits<lint>::max();
    for(auto&&s:a){
        lint now=0;
        for(char c:s){
            now=base*now+cal(c);
        }
        cmn(ans,now);
    }
    std::cout<<ans<<'\n';
}
0