#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define mind(a,b) (a>b?b:a) #define maxd(a,b) (a>b?a:b) #define absd(x) (x<0?-(x):x) #define pow2(x) ((x)*(x)) #define rep(i,n) for(int i=0; i=0; --i) #define repl(i,s,n) for(int i=s; i<=n; ++i) #define replr(i,s,n) for(int i=n; i>=s; --i) #define repf(i,s,n,j) for(int i=s; i<=n; i+=j) #define repe(e,obj) for(auto e : obj) #define SP << " " << #define COL << " : " << #define COM << ", " << #define ARR << " -> " << #define PNT(STR) cout << STR << endl #define POS(X,Y) "(" << X << ", " << Y << ")" #define DEB(A) " (" << #A << ") " << A #define DEBREP(i,n,val) for(int i=0; i P; //typedef pair P; typedef pair PI; typedef pair IP; typedef pair PP; typedef priority_queue, greater

> pvqueue; #define N 110 #define W 100005 ll n, x; ll a[N]; struct Value { Value(ll x, string s) : x(x), s(s) {} Value() : x(0), s("") {} ll x; string s; bool operator<(const Value& v) const { return x < v.x; } }; Value dp[W]; int main() { cin >> n >> x; rep(i, n) cin >> a[i]; if(n < 30) { set p0; p0.insert(Value(0, "")); rep(i, n/2) { set p0_2; for(set::iterator it = p0.begin(); it != p0.end(); ++it) { Value v = *it; p0_2.insert(Value(v.x,v.s+"x")); p0_2.insert(Value(v.x+a[i], v.s+"o")); } p0 = p0_2; } set p1; p1.insert(Value(0, "")); repl(i, n/2, n-1) { set p1_2; for(set::iterator it = p1.begin(); it != p1.end(); ++it) { Value v = *it; p1_2.insert(Value(v.x, v.s+"x")); p1_2.insert(Value(v.x+a[i], v.s+"o")); } p1 = p1_2; } set::iterator p0_it = p0.begin(); set::reverse_iterator p1_rit = p1.rbegin(); while(p0_it != p0.end() && p1_rit != p1.rend()) { Value v0 = *p0_it, v1 = *p1_rit; if(v0.x + v1.x == x) { cout << v0.s + v1.s << endl; exit(0); } ++p0_it; while(p0_it != p0.end() && p1_rit != p1.rend() && (*p0_it).x + (*p1_rit).x > x) ++p1_rit; } cout << "No" << endl; } else { dp[0].x = 1; rep(i, n) { replr(j, a[i], W-1) { if(!dp[j].x && dp[j-a[i]].x) { dp[j].x = 1; dp[j].s = dp[j-a[i]].s + "o"; } else { dp[j].s += "x"; } } rep(j, a[i]) { dp[j].s += "x"; } } if(dp[x].x) { cout << dp[x].s << endl; } else { cout << "No" << endl; } } return 0; }