Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- #define endl "\n"
- int main()
- {
- ios_base::sync_with_stdio(false);
- cin.tie(nullptr);
- cout.tie(nullptr);
- int t;
- cin>>t;
- while (t--)
- {
- int n;
- cin>>n;
- string s;
- cin>>s;
- int bad = 0;
- for (int i = 0; i < n - 1; i++)
- {
- if (s[i] == '>') bad++;
- }
- cout<<bad + 1<<" ";
- int j = 2;
- int c_bad = bad;
- for (int i = 0; i < n - 1; i++)
- {
- if (s[i] == '>')
- {
- cout<<c_bad<<" ";
- c_bad--;
- }
- else
- {
- cout<<bad + j<<" ";
- j++;
- }
- }
- cout<<endl;
- bad = 0;
- for (int i = 0; i < n - 1; i++)
- {
- if (s[i] == '<') bad++;
- }
- cout<<n - bad<<" ";
- j = n;//- bad - 1;
- c_bad = 1; // low
- for (int i = 0; i < n - 1; i++)
- {
- if (s[i] == '<')
- {
- int len = 0;
- int k = i;
- while (s[k] == '<')
- {
- len++;
- k++;
- }
- while(k--)
- cout<<c_bad + <<" ";
- c_bad++;
- }
- else
- {
- cout<<j<<" ";
- j--;
- }
- }
- cout<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement