Codeforces Round #602 DIV1 A問題 (500pt)
Codeforces Round #602 DIV2 C問題 (1250pt)
Technocup 2020 - Elimination Round 3 C問題 (1250pt)
Problem description
省略
省略
C++に変換後のコードはこちら
//no-unlocked
int N, K; char S[2002], t[2002];
int ress, res1[2000], res2[2000];
{
int i, j, x;
REP(rd_int()){
rd(N,K,S);
ress = 0;
x = 0;
rep(i,K-1) t[x++] = '(', t[x++] = ')';
rep(i,N/2-K+1) t[x++] ='(';
rep(i,N/2-K+1) t[x++] =')';
rep(i,N){
rep(j,i,N) if(S[j]==t[i]) break;
if(j==i) continue;
reverse(S+i,S+j+1);
arrInsert(ress,ress,res1,i,res2,j);
}
wt(ress);
rep(i,ress) wt(res1[i]+1, res2[i]+1);
}
}
Current time: 2024年04月25日19時07分56秒
Last modified: 2020年02月23日07時35分12秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces CF602 CF_Div1_A CF_Div2_C
トップページに戻る
Logged in as: unknown user (not login)