結果

問題 No.164 ちっちゃくないよ!!
ユーザー __math__math
提出日時 2015-03-12 23:25:21
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,260 bytes
コンパイル時間 1,639 ms
コンパイル使用メモリ 100,644 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-07 01:27:12
合計ジャッジ時間 1,747 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_DEPRECATE

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>
#include <fstream>
#include <iterator>
#include <bitset>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;

#define FOR(i,n) for(int i = 0; i < (n); i++)
#define sz(c) ((int)(c).size())
#define ten(x) ((int)1e##x)
#define tenll(x) ((ll)1e##x)

int main(){
	int n; cin >> n;
	vector<vector<int> > v;
	int mx = 0;
	FOR(i, n){
		string s; cin >> s;
		v.emplace_back();
		for (auto c : s) {
			int x;
			if ('0' <= c && c <= '9') x = c - '0';
			else x = c - 'A' + 10;
			v.back().push_back(x);
			mx = max(mx, x);
		}
	}
	mx++;
	ull ans = ULLONG_MAX;
	for (auto& a : v) {
		ull tmp = 0;
		for (auto b : a) {
			tmp = tmp * mx + b;
		}
		ans = min(ans, tmp);
	}
	cout << ans << endl;
}
0