QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#352213#4867. So Easy!mr9952RE 0ms0kbPython3291b2024-03-12 23:46:342024-03-12 23:46:35

Judging History

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

  • [2024-03-12 23:46:35]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2024-03-12 23:46:34]
  • 提交

answer

import math


def calculate_Sn(a, b, n, m):
    result = (int((a + math.sqrt(b)) ** n)+1) % m
    return result


# Read input from standard input
import sys

for line in sys.stdin:
    a, b, n, m = map(int, line.split())
    result = calculate_Sn(a, b, n, m)
    print(result)

詳細信息

Test #1:

score: 0
Dangerous Syscalls

input:

2 3 1 2012
2 3 2 2012
2 2 1 2012
31603 998691525 860250282 20381
4062 16491843 2741468 17921
26061 679145378 8235021 22991
16225 263237214 865378598 7182
18902 357253267 137732528 3407
25414 645847050 674769818 7114
6903 47648125 254957745 1556
16577 274779382 158233677 1099
939 880815 990631973 610...

output:

4
14
4

result: