QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#824706#1259. Game On BoardWorld_CreaterAC ✓0ms3680kbC++17279b2024-12-21 15:20:432024-12-21 15:20:45

Judging History

你现在查看的是最新测评结果

  • [2024-12-21 15:20:45]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3680kb
  • [2024-12-21 15:20:43]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int mod=998244353;
int qpow(int a,int b)
{
	if(b==0) return 1;
	int g=qpow(a,b/2);
	g=1ll*g*g%mod;
	if(b&1) g=1ll*g*a%mod;
	return g;
}
int main()
{
	int n,m;
	cin>>n>>m;
	cout<<1ll*qpow(n,m-1)*qpow(m,n-1)%mod;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3544kb

input:

1 1

output:

1

result:

ok answer is '1'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

2 2

output:

4

result:

ok answer is '4'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

1 100000000

output:

1

result:

ok answer is '1'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

1000000000 1

output:

1

result:

ok answer is '1'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3680kb

input:

998244353 1

output:

1

result:

ok answer is '1'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3504kb

input:

2 998244353

output:

0

result:

ok answer is '0'

Test #7:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

998244353 1000000000

output:

0

result:

ok answer is '0'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

1000000000 1000000000

output:

246032221

result:

ok answer is '246032221'

Test #9:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

654654 765433688

output:

931405037

result:

ok answer is '931405037'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

1000000000 999999999

output:

204552645

result:

ok answer is '204552645'

Test #11:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

666666666 777777777

output:

487109550

result:

ok answer is '487109550'

Test #12:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

998244353 998244353

output:

0

result:

ok answer is '0'