結果
問題 | No.164 ちっちゃくないよ!! |
ユーザー |
|
提出日時 | 2015-03-18 01:05:47 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 807 bytes |
コンパイル時間 | 554 ms |
コンパイル使用メモリ | 75,404 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-13 14:12:59 |
合計ジャッジ時間 | 1,123 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 |
ソースコード
#include <cstdint> #include <iostream> #include <fstream> #include <string> #include <vector> #include <map> #include <set> #include <algorithm> using namespace std; int N; vector<string> V; vector<int64_t> VV; void input(istream& in) { in >> N; V.resize(N); for (int i = 0; i < N; i++) { in >> V[i]; } } int64_t resolve() { VV.reserve(N); for (string& s : V) { int base = 2; for (char ch : s) { if (ch > base) { base = ch; } } base = (base < 'A') ? (base - '0') : (base - 'A' + 10); base++; int64_t value = 0; for (char ch : s) { value *= base; value += (ch < 'A') ? (ch - '0') : (ch - 'A' + 10); } VV.push_back(value); } int64_t value = *min_element(VV.begin(), VV.end()); return value; } int main() { input(cin); cout << resolve() << endl; return 0; }