QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#24171#3004. It's a Mod, Mod, Mod, Mod WorldJesus123TL 0ms0kbPython3301b2022-03-27 04:06:532022-04-30 05:13:51

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-04-30 05:13:51]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:0kb
  • [2022-03-27 04:06:53]
  • 提交

answer


w = int(input())
respuesta = 0
lista = ""
for i in range (0, w):
    p, q, n= [int(c) for c in input().split(' ')]
    for j in range (1, n+1):
        respuesta = respuesta + (p * j) % q
        
    lista = lista + str(respuesta) + "\n"
    respuesta = 0
lista = lista[:-1]
print(lista)

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Time Limit Exceeded

input:

91125
999956 999956 999956
999956 999956 999957
999956 999956 999958
999956 999956 999959
999956 999956 999960
999956 999956 999961
999956 999956 999962
999956 999956 999963
999956 999956 999964
999956 999956 999965
999956 999956 999966
999956 999956 999967
999956 999956 999968
999956 999956 999969
...

output:


result: