結果
問題 | No.2865 Base 10 Subsets 2 |
ユーザー |
|
提出日時 | 2024-06-27 20:59:43 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 665 bytes |
コンパイル時間 | 2,731 ms |
コンパイル使用メモリ | 246,524 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-08-30 20:50:08 |
合計ジャッジ時間 | 3,314 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main(){ long long n,k; cin >> n >> k; if(k == 1){ cout << 0 << endl; return 0; } vector<long long> a(20,1); int now = 0; while(n > 0){ now++; a[now] = a[now - 1] * (n % 10 + 1); n /= 10; } // for(int j = 0;j <= now;j++){ // cout << a[j] << " "; // } // cout << endl; bool c = 0; k--; for(int j = now;j >= 0;j--){ //cout << k << endl; if((k / a[j] > 0) || c == 1){ cout << k / a[j]; c = 1; } k %= a[j]; } cout << endl; return 0; }