結果
問題 | No.164 ちっちゃくないよ!! |
ユーザー | lloyz |
提出日時 | 2023-06-08 21:26:30 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 106 ms / 2,000 ms |
コード長 | 717 bytes |
コンパイル時間 | 309 ms |
コンパイル使用メモリ | 87,320 KB |
実行使用メモリ | 78,168 KB |
最終ジャッジ日時 | 2023-08-30 01:22:30 |
合計ジャッジ時間 | 2,020 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 71 ms
71,368 KB |
testcase_01 | AC | 72 ms
71,616 KB |
testcase_02 | AC | 69 ms
71,428 KB |
testcase_03 | AC | 70 ms
71,432 KB |
testcase_04 | AC | 70 ms
71,528 KB |
testcase_05 | AC | 93 ms
76,832 KB |
testcase_06 | AC | 106 ms
78,168 KB |
testcase_07 | AC | 93 ms
76,908 KB |
testcase_08 | AC | 102 ms
77,064 KB |
testcase_09 | AC | 105 ms
77,064 KB |
testcase_10 | AC | 71 ms
71,480 KB |
ソースコード
n = int(input()) L = [list(input()) for _ in range(n)] ans = 1 << 63 for i in range(n): res = 0 m = len(L[i]) max_ = '0' for j in range(m): if L[i][j].isdigit(): if max_.isdigit(): max_ = max(max_, L[i][j]) else: if max_.isdigit(): max_ = L[i][j] else: max_ = max(max_, L[i][j]) if max_.isdigit(): d = int(max_) + 1 else: d = ord(max_) - ord('A') + 11 for j in range(m): if L[i][j].isdigit(): res += pow(d, m - j - 1) * int(L[i][j]) else: res += pow(d, m - j - 1) * (ord(L[i][j]) - ord('A') + 10) ans = min(ans, res) print(ans)