結果

問題 No.1675 Strange Minimum Query
ユーザー tailstails
提出日時 2021-09-10 22:45:28
言語 cLay
(20240104-1)
結果
WA  
実行時間 -
コード長 490 bytes
コンパイル時間 6,497 ms
コンパイル使用メモリ 210,788 KB
実行使用メモリ 14,880 KB
最終ジャッジ日時 2023-09-19 02:39:30
合計ジャッジ時間 14,468 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
9,716 KB
testcase_01 AC 3 ms
9,492 KB
testcase_02 AC 3 ms
9,448 KB
testcase_03 AC 30 ms
12,872 KB
testcase_04 AC 26 ms
13,548 KB
testcase_05 AC 6 ms
11,020 KB
testcase_06 AC 34 ms
12,948 KB
testcase_07 AC 36 ms
13,136 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 32 ms
14,596 KB
testcase_14 AC 25 ms
14,500 KB
testcase_15 WA -
testcase_16 AC 3 ms
9,492 KB
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 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

using P=pair<ll,pair<ll,ll>>;
P a[2d5];
ll s[2d5];
ll z[2d5];
{
	ll@n,@q;
	rep(i,q){
		ll@l,@r,@b;
		a[i]={-b,{r,l-1}};
	}
	sortA(q,a);
	ll fb=0,fi=0;
	rep(i,q){
		ll b=-a[i].first;
		ll l=a[i].second.second;
		ll r=a[i].second.first;
		ll f=(fb==b&&fi>=l);
		while(1){
			ll t=l;
			while(t<r&&s[t]){
				t=s[t];
			}
			s[l]=t+1;
			if(t>=r){
				break;
			}
			l=t;
			f=1;
			z[l]=b;
			if(fb!=b||fi<l){
				fb=b;
				fi=l;
			}
		}
		if(!f){
			wt(-1);
			exit(0);
		}
	}
	wt(z(n));
}
0