| 比赛 | 
    20251022赛前模拟1 | 
    评测结果 | 
    AAAAAAAAAAAAAAAAAAAA | 
    | 题目名称 | 
    正负游戏 | 
    最终得分 | 
    100 | 
    | 用户昵称 | 
    梦那边的美好TE | 
    运行时间 | 
    0.081 s  | 
    | 代码语言 | 
    C++ | 
    内存使用 | 
    3.81 MiB  | 
    | 提交时间 | 
    2025-10-22 09:07:20 | 
显示代码纯文本
#include <iostream>
#include <cstdio>
using namespace std;
typedef long long ll;
const int mod=998244353;
ll n,m,k;
ll ksm(ll a,ll b){
	ll ans=1;
	while(b){
		if(b&1)ans=(ans*a)%mod;
		a=(a*a)%mod;
		b>>=1;
	}
	return ans;
}
int main(){
	freopen("plusminus.in","r",stdin); 
	freopen("plusminus.out","w",stdout);
	scanf("%lld %lld",&n,&m);
	scanf("%lld",&k);
	for(int i=1,x,y;i<=k;i++){
		scanf("%d %d",&x,&y);
	}
	if((n&1)==(m&1))printf("%lld\n",ksm(2,n*m-n-m-k+1));
	else printf("0\n");
	return 0;
}