結果

問題 No.2230 Good Omen of White Lotus
ユーザー たたき@競プロたたき@競プロ
提出日時 2023-08-08 12:48:45
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 410 ms / 2,000 ms
コード長 903 bytes
コンパイル時間 7,217 ms
コンパイル使用メモリ 338,688 KB
実行使用メモリ 28,160 KB
最終ジャッジ日時 2024-04-26 05:42:03
合計ジャッジ時間 13,996 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 2 ms
6,816 KB
testcase_02 AC 2 ms
6,816 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 64 ms
6,940 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 99 ms
6,940 KB
testcase_17 AC 102 ms
6,944 KB
testcase_18 AC 100 ms
6,940 KB
testcase_19 AC 99 ms
6,940 KB
testcase_20 AC 8 ms
6,944 KB
testcase_21 AC 2 ms
6,944 KB
testcase_22 AC 10 ms
6,944 KB
testcase_23 AC 11 ms
6,940 KB
testcase_24 AC 6 ms
6,940 KB
testcase_25 AC 5 ms
6,940 KB
testcase_26 AC 4 ms
6,944 KB
testcase_27 AC 202 ms
28,160 KB
testcase_28 AC 237 ms
27,904 KB
testcase_29 AC 123 ms
7,116 KB
testcase_30 AC 155 ms
6,988 KB
testcase_31 AC 245 ms
27,904 KB
testcase_32 AC 241 ms
28,032 KB
testcase_33 AC 410 ms
19,840 KB
testcase_34 AC 401 ms
20,096 KB
testcase_35 AC 399 ms
19,840 KB
testcase_36 AC 399 ms
19,968 KB
testcase_37 AC 386 ms
20,096 KB
testcase_38 AC 397 ms
19,840 KB
testcase_39 AC 386 ms
20,096 KB
testcase_40 AC 109 ms
11,520 KB
testcase_41 AC 74 ms
6,940 KB
testcase_42 AC 254 ms
13,952 KB
testcase_43 AC 12 ms
6,940 KB
testcase_44 AC 329 ms
16,768 KB
testcase_45 AC 81 ms
7,168 KB
testcase_46 AC 188 ms
13,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using mint=modint998244353; //1000000007;
using ll=long long;
using pp=pair<int,int>;
#define sr string 
#define vc vector
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define pb push_back
#define all(v) v.begin(),v.end()
#define pque priority_queue
#define bpc(a) __builtin_popcount(a)
int op(int a,int b){return max(a,b);}
int e(){return -1e8;}
int main(){
	int h,w,n,p;cin>>h>>w>>n>>p;
	map<int,vc<int>>m;
	rep(i,n){
		int a,b;
		cin>>a>>b; a--;b--;
		m[a].pb(b);
	}
	for(auto&[z,a]:m)sort(all(a));
	segtree<int,op,e>sg(w);
	sg.set(0,0);
	for(auto [z,v]:m){
		for(auto x:v){
			int a=sg.prod(0,x+1);
			sg.set(x,a+1);
		}
	}
	int ax=sg.prod(0,w);
	mint t=2; t/=p;
	mint ans=(1-t).pow(ax);
	t/=2;
	ans*=(1-t).pow(h+w-3-ax);
	ans=1-ans;
	cout<<ans.val();
  //cout<<"\n"<<ax;
}
0