結果

問題 No.2716 Falcon Method
ユーザー tailstails
提出日時 2024-04-05 21:56:40
言語 cLay
(20240104-1)
結果
WA  
実行時間 -
コード長 464 bytes
コンパイル時間 2,999 ms
コンパイル使用メモリ 175,932 KB
実行使用メモリ 15,420 KB
最終ジャッジ日時 2024-04-05 21:56:45
合計ジャッジ時間 4,942 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,616 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 2 ms
7,616 KB
testcase_26 AC 2 ms
7,616 KB
testcase_27 WA -
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

ll@n,@q;
string@s;
ll ax[2n+1],ay[2n+1];
ax[0]=0;
ay[0]=0;
rep(i,2n){
	if(s[i%n]=='D'){
		ax[i+1]=ax[i]+1;
		ay[i+1]=ay[i];
	}else{
		ax[i+1]=ax[i];
		ay[i+1]=ay[i]+1;
	}
}
rep(q){
	ll@h,@w,@p,z;
	if(ax[n]==0||ay[n]!=0&&h/ax[n]>w/ay[n]){
		z=bsearch_min[ll,j,p,p+n](ay[j]-ay[p]>=w);
	}
	else if(ay[n]==0||ax[n]!=0&&h/ax[n]<w/ay[n]){
		z=bsearch_min[ll,j,p,p+n](ax[j]-ax[p]>=h);
	}
	else{
		z=bsearch_min[ll,j,p,p+n](ax[j]-ax[p]>=h||ay[j]-ay[p]>=w);
	}
	wt(z%n);
}
0