#include <vector>
#include <iostream>
#include <stack>
using namespace std;
int main(){
stack<int> st;
int n,a,cnt = 1;
cin >> n;
vector<string> arr;
for(int i=0;i<n;i++){
cin >> a;
while(cnt<=a){
st.push(cnt);
cnt++;
arr.push_back("+");
}
if(st.top() == a){
st.pop();
arr.push_back("-");
}
else{
cout << "NO";
return 0;
}
}
for(auto &a : arr)
cout << a << endl;
}
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
마지막 해결 방법