結果
| 問題 | No.164 ちっちゃくないよ!! |
| コンテスト | |
| ユーザー |
h_noson
|
| 提出日時 | 2016-03-14 12:52:29 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,040 bytes |
| 記録 | |
| コンパイル時間 | 503 ms |
| コンパイル使用メモリ | 59,256 KB |
| 実行使用メモリ | 13,824 KB |
| 最終ジャッジ日時 | 2024-10-01 05:08:44 |
| 合計ジャッジ時間 | 6,949 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 10 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define RREP(i,s,e) for (i = e-1; i >= s; i--)
#define rrep(i,n) RREP(i,0,n)
#define REP(i,s,e) for (i = s; i < e; i++)
#define rep(i,n) REP(i,0,n)
#define INF 1e8
typedef long long ll;
ll pow(ll a, int n) {
if (a == 0)
return 1;
else
return a * pow(a,n-1);
}
int main() {
int i, j, n;
ll ans;
cin >> n;
ans = pow(36,12);
rep (i,n) {
int base, w;
ll x, v;
string s;
cin >> s;
w = s.size();
base = 0;
for (char c : s) {
if (isdigit(c))
base = max(base,c - '0');
else
base = max(base,c - 'A' + 10);
}
base++;
v = 0;
rep (j,w){
if (isdigit(s[w-j-1]))
x = s[w-j-1] - '0';
else
x = s[w-j-1] - 'A' + 10;
v += pow(base,j)*x;
}
ans = min(ans,v);
}
cout << ans << endl;
return 0;
}
h_noson