# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1157087 | fhvirus | Sequence (BOI14_sequence) | C++20 | 87 ms | 1096 KiB |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
#ifdef OWO
#define debug(args...) _debug(#args,args)
#define _OO(args...) ostream& operator<<(ostream&O,args)
#define _DEF(S) template<class...T>_OO(S<T...>);
#define _DEC(S,B,E,F) template<class...T>_OO(S<T...>s){O<<B;int c=0;for(auto i:s)O<<(c++?", ":"")<<F;return O<<E;}
_DEF(vector);_DEF(deque);_DEF(set);_DEF(multiset);_DEF(unordered_set);_DEF(map);_DEF(unordered_map);_DEF(pair);_DEF(tuple);template<class T,size_t N>_OO(array<T,N>);
_DEC(vector,'[',']',i);_DEC(deque,'[',']',i);_DEC(set,'{','}',i);_DEC(multiset,'{','}',i);_DEC(unordered_set,'{','}',i);_DEC(map,'{','}',i.first<<':'<<i.second);_DEC(unordered_map,'{','}',i.first<<':'<<i.second);
template<class...T>_OO(pair<T...>p){return O<<'('<<p.first<<','<<p.second<<')';}template<class...T>_OO(tuple<T...>t){return O<<'(',apply([&O](T...s){int c=0;(...,(O<<(c++?", ":"")<<s));},t),O<<')';}template<class T,size_t N>_OO(array<T,N>a){return O<<vector<T>(begin(a),end(a));}
template<class...T>void _debug(const char* s,T...a){int c=sizeof...(T);if(!c){cerr<<"\033[1;32mvoid\033[0m\n";return;}(cerr<<"\033[1;32m("<<s<<") = (",...,(cerr<<a<<(--c?", ":")\033[0m\n")));}
#else
#define debug(...) ((void)0)
#endif
ll solve(vi B, bool need, bool can9) {
debug(B, need, can9);
if (B.empty()) { return 0; }
if (sz(B) == 1) {
if (B[0] == 1) return 10;
ll ans = 0;
rep (d, 1, 10) if (B[0] >> d & 1) {
ans = ans * 10 + d;
if (B[0] & 1) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |