結果

問題 No.1328 alligachi-problem
ユーザー tailstails
提出日時 2020-12-25 13:15:29
言語 cLay
(20240104-1)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 472 bytes
コンパイル時間 2,057 ms
コンパイル使用メモリ 166,820 KB
実行使用メモリ 11,976 KB
最終ジャッジ日時 2023-09-19 01:59:31
合計ジャッジ時間 7,311 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
9,672 KB
testcase_01 AC 3 ms
9,564 KB
testcase_02 AC 3 ms
9,480 KB
testcase_03 AC 2 ms
7,676 KB
testcase_04 AC 3 ms
9,456 KB
testcase_05 AC 3 ms
9,744 KB
testcase_06 AC 3 ms
9,644 KB
testcase_07 AC 3 ms
9,568 KB
testcase_08 AC 3 ms
9,604 KB
testcase_09 AC 33 ms
11,552 KB
testcase_10 AC 24 ms
10,704 KB
testcase_11 AC 34 ms
11,556 KB
testcase_12 AC 33 ms
11,444 KB
testcase_13 AC 34 ms
11,568 KB
testcase_14 AC 33 ms
11,448 KB
testcase_15 AC 24 ms
10,712 KB
testcase_16 AC 33 ms
11,564 KB
testcase_17 AC 33 ms
11,512 KB
testcase_18 AC 33 ms
11,504 KB
testcase_19 AC 33 ms
11,792 KB
testcase_20 AC 33 ms
11,756 KB
testcase_21 AC 34 ms
11,800 KB
testcase_22 AC 34 ms
11,556 KB
testcase_23 AC 24 ms
10,776 KB
testcase_24 AC 27 ms
11,976 KB
testcase_25 AC 28 ms
11,864 KB
testcase_26 AC 25 ms
11,132 KB
testcase_27 AC 26 ms
9,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

long es[4][2d5];
int en[4],er[4],l[2];
int aa[2d5];

{
	int @n;
	rep(i,n){
		char @c,@x;
		int @y;
		int k=(c=='R'?0:2)|(x=='R'?0:1);
		es[k][en[k]++]=(ll)y<<32|i;
	}
	rep(k,4){
		sort(es[k],es[k]+en[k]);
	}
	rep(i,n){
		int a=0,b=0;
		rep(k,4){
			if(er[k]<en[k]&&es[k][er[k]]>>32==l[k&1]){
				a|=1<<k;
				b|=(int[]){2,12,3,4}[k];
			}
		}
		int k=ffs(a&~b)-1;
		if(k<0){
			wt("No");
			exit(0);
		}
		aa[i]=es[k][er[k]++]+1;
		++l[k>>1];
	}
	wt("Yes");
	wt(aa(n));
}
0