五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

算法競賽2021 ICPC Southeastern Europe Regional Contest_ABC Legacy

2022-04-02 14:43 作者:Clayton_Zhou  | 我要投稿


//#include "stdafx.h"

#include<cstdio>

#include<cctype>

#include<vector>

#include<algorithm>

?#include <queue>


using namespace std;

? ?

// Case 1: ACB......? ? ? ? Case 2:? ABAC


int n=5;

char vis[201000];

//char abc[2010000]="ABBACC";

?

char abc[201000]="ABCACBABAB";

//priority_queue<pair<? int, int>> a;?

?

queue<int>R;


int main(){

int ac=0,bc=0,cc=0;

int x;

int Ab,Ac,Bc;

? scanf("%d",&n);??

scanf("%s",abc);??


/*

for( x=0;x<2*n;x++)

{

scanf("%d",&num[x][0]);??

scanf("%d",&num[x][1]);?

}? */

?

for( x=0;x<2*n;x++) ?

if(abc[x]=='A')ac++;

else if(abc[x]=='B')bc++;

else cc++;

?

// printf("%d %d, %d\n",ac,bc,cc);?


if(ac+bc>=cc && ((ac+bc-cc )%2==0))

? ?Ab=(ac+bc-cc )/2;

else {printf("NO\n");return 0;}


? if(ac+cc>=bc && ((ac+cc-bc )%2==0))

? Ac=(ac+cc-bc )/2;

else {printf("NO\n");return 0;}


? if(cc+bc>=ac && ((cc+bc-ac )%2==0))

? Bc=(cc+bc-ac )/2;

else {printf("NO\n");return 0;}

?

int tmp=-1;

for( x=0;x<2*n;x++)

if(Bc && abc[x]=='B')

{

if(tmp<x) tmp=x+1;


while( abc[tmp]!='C' && tmp <2*n)tmp++;?

if(tmp==2*n){printf("NO\n");return 0;}

R.push (x);? vis[x]=1;

R.push (tmp);? ?vis[tmp]=1;tmp++;?

Bc--;

}// the end of for( x=0;x<2*n;x++) ?

//if(Bc){printf("NO\n");return 0;}


?

tmp=2*n;

? for( x=2*n-1;x>=0;x--)

? if(!vis[x])

if(abc[x]=='B'|| abc[x]=='C')

{

if(tmp>x) tmp=x-1;

while(? abc[tmp]!='A'? ?&& tmp >=0)tmp--;?

if(tmp==-1){printf("NO\n");return 0;}

R.push (tmp);? tmp--;// vis[tmp]=1;

? R.push (x);? //vis[x]=1; ??


}// the end of for( x=0;x<2*n;x++) ?


printf("YES\n");

int first;

while(!R.empty())

{

first= R.front()+1;

R.pop();?

printf("%d %d\n",first,R.front() +1);

R.pop(); ??

}

return 0;

}


算法競賽2021 ICPC Southeastern Europe Regional Contest_ABC Legacy的評論 (共 條)

分享到微博請遵守國家法律
兰考县| 修武县| 墨脱县| 惠东县| 栾川县| 天台县| 资溪县| 宾川县| 南乐县| 广元市| 锡林郭勒盟| 木兰县| 疏勒县| 宜城市| 嘉善县| 铁力市| 西畴县| 安达市| 巴林右旗| 万州区| 江津市| 哈尔滨市| 闸北区| 长治县| 遂宁市| 合水县| 卫辉市| 崇左市| 昌吉市| 岳阳县| 勃利县| 清涧县| 横峰县| 呼伦贝尔市| 新野县| 宁南县| 武邑县| 铅山县| 南康市| 岳阳市| 麻城市|