結果
| 問題 |
No.2865 Base 10 Subsets 2
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-08-30 21:26:45 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 926 bytes |
| コンパイル時間 | 4,217 ms |
| コンパイル使用メモリ | 293,224 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-08-30 21:26:51 |
| 合計ジャッジ時間 | 4,616 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
ソースコード
#ifdef LOCAL
#include <local.hpp>
#else
#pragma GCC optimize("O3")
// #pragma target("arch=skylake-avx512")
#include <bits/stdc++.h>
#define debug(...) ((void)0)
#endif
using namespace std;
using ll = long long;
using ld = long double;
void solve(int) {
string N;
cin >> N;
vector<ll> num;
for (int i = 0; i < (int)N.size(); i++) {
num.push_back(N[i] - '0' + 1);
}
reverse(num.begin(), num.end());
debug(num);
ll K;
cin >> K;
K -= 1;
vector<ll> ans;
for (auto&& x : num) {
ans.push_back(K % x);
K /= x;
if (K == 0) break;
}
reverse(ans.begin(), ans.end());
for (auto&& x : ans) {
cout << x;
}
cout << endl;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t = 1;
// cin >> t;
for (int i = 1; i <= t; i++) {
solve(i);
}
#ifdef LOCAL
postprocess();
#endif
}