// compile: g++ -o data data.cpp -O3 -std=gnu++20 -Wall -Wextra -Wshadow -D_GLIBCXX_ASSERTIONS -ggdb3 -fmax-errors=2 -DLOCAL
// run: ./data < data.in
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#ifdef LOCAL
#include <debug/codeforces.h>
#define debug(x...) _debug_print(#x, x);
#else
#define debug(x...) {};
#endif
template<typename...Args> void print_(Args...args){((cout<<args<<" "),...)<<endl;}
#define rep(i,a,b) for(int i=(a);i<(int)(b);++i)
#define sz(v) ((int)(v).size())
#define print(...) print_(__VA_ARGS__);
#define INTMAX (int)(9223372036854775807)
#define INF (int)(1152921504606846976)
#define double long double
#define int long long
#define MAXN 200010
int32_t main() {
ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
int n; cin >> n;
vector<int> c(10), dp(n+1);
rep(i, 1, 10) cin >> c[i];
rep(i, 0, n+1) {
rep(j, 1, 10) {
if (i + c[j] > n) continue;
dp[i + c[j]] = max(dp[i + c[j]], dp[i] + 1);
}
}
int m = dp[n];
int cur = n;
string ans = "";
for (int i = m-1; i >= 0; --i) {
int maxid = -1;
for (int j = 9; j > 0; --j) {
if (cur - c[j] < 0) continue;
if (dp[cur - c[j]] == i) {
maxid = j;
break;
}
}
ans += char('0' + maxid);
cur -= c[maxid];
}
cout << ans << endl;
return 0;
}
Need some new APKs for my phone. Let’s hope sixgameapk has what I’m looking for. Clicking that sixgameapk link now!
789papp is pretty good if you like to play the games on your phone while away. I would suggest trying it out 789papp
Kuvipbet, huh? New to me, but the odds look decent. Deposited a bit, gonna try my luck on some football matches. Wish me luck, boys! Check it out yourselves: kuvipbet
BK8 Singapore, eh? Sounds fancy! Heard they got some decent odds and a nice selection of games. Singaporean players, let’s go make some dough! Check out bk8singapore!
Bầu cua online? Classic Vietnamese game! Brings back memories of Tet. Hopefully, this online version is fair and fun. Let’s roll the dice! Give bầu cua online a try!
FB88tivi, cool name. Wonder if the streams are any good? Could be a decent spot to catch up on the games. Worth a look! Try fb88tivi out lads.