#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. gulp常用插件之gulp-imagemin使用

    更多gulp常用插件使用请访问:gulp常用插件汇总 gulp-imagemin这是一款缩小PNG,JPEG,GIF和SVG图像的插件. 更多使用文档请点击访问gulp-imagemin工具官网. 安 ...

  2. element-ui 1.4.13

    Form 表单 rules 表单校验函数需要访问实例中的属性时应该把校验规则写为computed,校验函数写入methods <el-form-item prop="taxableIn ...

  3. SQLServer 数据库索引碎片

    --改成当前库 use DB_Name --创建变量 指定要查看的表 declare @table_id int set @table_id=object_id('TableName') --执行 d ...

  4. npx是什么

    npx是一个执行npm软件包的二进制文件,通俗的讲,他可以执行npm的一些指令 在npm>5.2.0 的时候npm里面就集成了npx 比如npx webpack 他会执行node_modules ...

  5. Java连载76-基础数据类型包装类型及其方法简介

    一.java中八种基本数据类型对应的包装类型 基本数据类型      包装类型 byte                    java.lang.Byte short                ...

  6. html中引入调用另一个html文件

    第一种: <body> <div id="page1"></div> <div id="page2"></ ...

  7. canvas转盘转动?

    怎么实现类似转盘转动的效果? 现在这种实现思路是,canvas每次draw()并不是让图形在旋转,而是让每一份的颜色改变到达好像是转动的效果, 但是现在有一个问题,一开始渲染的颜色数量于份数是相同的, ...

  8. ActiveMQ使用JDBC持久化

    步骤一:创建一个数据库            步骤二:配置activemq.xml配置文件                1.在persistenceAdapter加入如下配置 <!--crea ...

  9. AspxGridView 客户端点击获取对应的列值

    Html 内容: <dx:ASPxGridView ID="ASPxGridViewCluster" runat="server" Width=" ...

  10. [转]shallow heap & retained heap

    所有包含Heap Profling功能的工具(MAT, Yourkit, JProfiler, TPTP等)都会使用到两个名词,一个是Shallow Size,另一个是 Retained Size.  ...