-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2096a.cpp
More file actions
43 lines (39 loc) · 762 Bytes
/
2096a.cpp
File metadata and controls
43 lines (39 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <bits/stdc++.h>
using namespace std;
#define NO cout<<"NO\n"
#define YES cout<<"YES\n"
#define F first
#define S second
#define cases int _; cin >> _; while(_--)
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef set<int> si;
int main() {
cases {
int n;
cin >> n;
string s;
cin >> s;
int l = 1;
int r = n;
vector<int> a(n);
for (int i = n - 2; i >= 0; i--) {
if (s[i] == '<') {
a[i + 1] = l;
l++;
}
if (s[i] == '>') {
a[i + 1] = r;
r--;
}
}
a[0] = l;
for (int i = 0; i < n; i++) {
cout << a[i] << " ";
}
cout << '\n';
}
return 0;
}