Submission #20384923


Source Code Expand

Copy
P = 998244353
n, m, k = map(int, input().strip().split(' '))
if n == 1:
print(pow(k, m, P))
elif m == 1:
print(pow(k, n, P))
else:
ans = 0
for i in range(1, k+1):
ans += (((pow(i, m, P) - pow(i-1, m, P)) % P) * pow(k-i+1, n, P)) % P
ans %= P
print(ans)
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
P = 998244353

n, m, k = map(int, input().strip().split(' '))
if n == 1:
    print(pow(k, m, P))
elif m == 1:
    print(pow(k, n, P))
else:
    ans = 0
    for i in range(1, k+1):
        ans += (((pow(i, m, P) - pow(i-1, m, P)) % P) * pow(k-i+1, n, P)) % P
        ans %= P
    print(ans)

Submission Info

Submission Time
Task D - Sky Reflector
User albert0liu0
Language Python (3.8.2)
Score 600
Code Size 303 Byte
Status AC
Exec Time 1165 ms
Memory 9048 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 600 / 600
Status
AC × 3
AC × 15
Set Name Test Cases
Sample s1.txt, s2.txt, s3.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, s1.txt, s2.txt, s3.txt
Case Name Status Exec Time Memory
01.txt AC 1165 ms 8888 KB
02.txt AC 568 ms 9032 KB
03.txt AC 18 ms 8940 KB
04.txt AC 17 ms 8916 KB
05.txt AC 18 ms 8976 KB
06.txt AC 17 ms 8964 KB
07.txt AC 17 ms 9048 KB
08.txt AC 18 ms 8968 KB
09.txt AC 159 ms 8972 KB
10.txt AC 340 ms 9048 KB
11.txt AC 216 ms 8876 KB
12.txt AC 24 ms 8872 KB
s1.txt AC 25 ms 8856 KB
s2.txt AC 18 ms 8864 KB
s3.txt AC 409 ms 9032 KB


2025-03-05 (Wed)
18:09:58 +00:00