#define HAVE_STRUCT_TIMESPEC
#include<bits/stdc++.h>
using namespace std;
int ans[];
int ans2[];
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;
cin>>t;
while(t--){
int n;
string s;
cin>>n>>s;
int mx=n;
for(int i=;i<n;++i){
int cnt=;
while(i<n&&s[i]=='<'){
++cnt;
++i;
}
for(int j=i;j>i-cnt;--j){
ans[j]=mx;//尽可能将大的数放在前面
--mx;
}
}
int mn=;
for(int i=;i<n;++i){
int cnt=;
while(i<n&&s[i]=='>'){
++cnt;
++i;
}
for(int j=i;j>i-cnt;--j){
ans2[j]=mn;//尽可能将小的数放在前面
++mn;
}
}
for(int i=;i<n;++i)
cout<<ans[i]<<" ";
cout<<"\n";
for(int i=;i<n;++i)
cout<<ans2[i]<<" ";
cout<<"\n";
}
return ;
}

Codeforces Round #620 (Div. 2)D(LIS,构造)的更多相关文章

  1. Codeforces Round #620 (Div. 2)

    Codeforces Round #620 (Div. 2) A. Two Rabbits 题意 两只兔子相向而跳,一只一次跳距离a,另一只一次跳距离b,每次同时跳,问是否可能到同一位置 题解 每次跳 ...

  2. Codeforces Round #620 (Div. 2)D dilworld定理

    题:https://codeforces.com/contest/1304/problem/D 题意:给定长度为n-1的只含’>'和‘<’的字符串,让你构造出俩个排列,俩个排列相邻的数字之 ...

  3. Codeforces Round #277 (Div. 2) E. LIS of Sequence DP

    E. LIS of Sequence Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/486/pr ...

  4. Codeforces Round #339 (Div. 1) C. Necklace 构造题

    C. Necklace 题目连接: http://www.codeforces.com/contest/613/problem/C Description Ivan wants to make a n ...

  5. Codeforces Round #620 (Div. 2) D

    构造一个排列,要求相邻之间的数满足给定的大小关系,然后构造出两个序列,一个序列是所有可能的序列中LIS最长的,一个所有可能的序列中LIS最短的 最短的构造方法:我们考虑所有单调递增的部分,可以发现要让 ...

  6. Codeforces Round #620 (Div. 2) A-F代码 (暂无记录题解)

    A. Two Rabbits (手速题) #include<bits/stdc++.h> using namespace std; typedef long long ll; int ma ...

  7. Codeforces Round #620 (Div. 2)E LCA

    题:https://codeforces.com/contest/1304/problem/E 题意:给定一颗树,边权为1,m次询问,每次询问给定x,y,a,b,k,问能否在原树上添加x到y的边,a到 ...

  8. Codeforces Round #181 (Div. 2) A. Array 构造

    A. Array 题目连接: http://www.codeforces.com/contest/300/problem/A Description Vitaly has an array of n ...

  9. Codeforces Round #306 (Div. 2) ABCDE(构造)

    A. Two Substrings 题意:给一个字符串,求是否含有不重叠的子串"AB"和"BA",长度1e5. 题解:看起来很简单,但是一直错,各种考虑不周全, ...

随机推荐

  1. udp_demo(傻瓜来回发送)

    代码讲解 import socket # 发送数据 def send_data(udp_socket, dest_ip, dest_port): send_msg = input('请输入要发送的数据 ...

  2. 0级搭建类013-CentOS 8.x 安装

    CentOS 8 操作系统安装

  3. mysql 时间,时间戳,字符串之间相互转换

    时间转字符串 date_format(now(),'%Y-%m-%d') 时间转时间戳 unix_timestamp(now()) 字符串转时间 str_to_date('2020-01-19','% ...

  4. smarty循环item命名规范

    使用smarty循环渲染数据时第二次循环item复制命名不规范 item=data 后面代码使用data会与后台返回数据冲突 {%foreach from=$data.bind_data key=ke ...

  5. 项目打jar包和运行

    打包成jar包和部署,运行. 1.在pom.xml中加入  <packaging>jar</packaging> <groupId>com.demo02</g ...

  6. Gin_渲染

    1. 各种数据响应格式 package main import ( "github.com/gin-gonic/gin" "github.com/gin-gonic/gi ...

  7. LED And Incandescent, Who Is Suitable For Holiday Lighting?

    Fast-fire advantages of LED lighting: Eco-friendly-LEDs are not made of toxic chemicals, such as mer ...

  8. C语言-浮点数的秘密

    一.浮点数的秘密 1.内存中的浮点数 浮点数在内存中的存储方式为:符号位.指数.尾数 十进制浮点数的内存表示: 实例分析: #include <stdio.h> //打印十进制的内存表示 ...

  9. NOI2005 维护数列 lg2042

    这道题据说是noi题目中算是比较毒瘤的数据结构题了,5k多的代码加上随手写挂细节,我调了两天 题面见https://www.luogu.org/problemnew/show/P2042 (歪个题,这 ...

  10. es报错org.frameworkset.elasticsearch.ElasticSearchException: {"error":{"root_cause":[{"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"}],

    今天es在保存数据的时候报错 org.frameworkset.elasticsearch.ElasticSearchException: {"error":{"root ...