結果
| 問題 |
No.2865 Base 10 Subsets 2
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-08-30 23:48:24 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 910 bytes |
| コンパイル時間 | 1,634 ms |
| コンパイル使用メモリ | 130,404 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-08-30 23:48:28 |
| 合計ジャッジ時間 | 2,716 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 WA * 7 |
ソースコード
#pragma GCC optimize("O2")
#ifdef local
#include <C++/core/io/debug_print.hpp>
#else
#define dump(...) void(0);
#endif
#include <iostream>
#include <valarray>
namespace man {
}
int main() {
std::cin.tie(nullptr) -> sync_with_stdio(false);
int64_t n, k;
std::cin >> n >> k;
const auto sol = [](const int64_t n, int64_t k) -> std::string {
std::string s;
if(--k == 0) {
return "0";
}
std::valarray<int> v(1, 19);
int id = 0;
for(int64_t i = n; i > 0; ++id, i /= 10) {
v[id + 1] = v[id] * (i % 10 + 1);
}
bool c = false;
dump(v);
while(id >= 0) {
const int x = k / v[id];
if(x > 0 || c) {
s += std::to_string(x);
c = true;
}
k %= v[id--];
}
return s;
};
std::cout << sol(n, k) << '\n';
}