結果
| 問題 | No.164 ちっちゃくないよ!! |
| コンテスト | |
| ユーザー |
SSRS
|
| 提出日時 | 2020-11-18 07:39:14 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 654 bytes |
| コンパイル時間 | 592 ms |
| コンパイル使用メモリ | 70,852 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-23 08:50:48 |
| 合計ジャッジ時間 | 1,115 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
using namespace std;
const long long INF = 5000000000000000000;
int main(){
int N;
cin >> N;
vector<string> V(N);
for (int i = 0; i < N; i++){
cin >> V[i];
}
long long ans = INF;
for (int i = 0; i < N; i++){
int L = V[i].size();
vector<int> d(L);
for (int j = 0; j < L; j++){
if (isdigit(V[i][j])){
d[j] = V[i][j] - '0';
} else {
d[j] = V[i][j] - 'A' + 10;
}
}
int b = 2;
for (int j = 0; j < L; j++){
b = max(b, d[j] + 1);
}
long long num = 0;
for (int j = 0; j < L; j++){
num = num * b + d[j];
}
ans = min(ans, num);
}
cout << ans << endl;
}
SSRS