QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#873967#10026. ConditionskangkunmaWA 553ms19696kbPython3602b2025-01-27 10:41:252025-01-27 10:41:28

Judging History

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

  • [2025-01-27 10:41:28]
  • 评测
  • 测评结果:WA
  • 用时:553ms
  • 内存:19696kb
  • [2025-01-27 10:41:25]
  • 提交

answer

n,k=map(int,input().split());L=[*map(int,input().split())];l=int(input());L.sort()
while L[0]<l:
    L.pop(0)
    if not L:break
P=[1]*len(L);A=1e200;t=1e200;s=l
for i in range(len(L)):
    P[i]+=(L[i]%k>0)+('7' in str(L[i]))
    if P[i]==1:A=min(A,L[i]);break
if L:t=0
while L:
    if L:
        if L[t]==s:
            t+=1
            if t==len(L):break
            else:s+=1;continue
    if (s%k>0)+('7' in str(s))==1:A=min(A,s);break
    s+=1
for i in range(len(str(s))):
    if str(s)[i]=='7':s=int(str(s)[0:i]+'8'+'0'*(len(str(s))-i-1));break
while s%k<1:s+=1
print(min(A,s))

详细

Test #1:

score: 100
Accepted
time: 10ms
memory: 8960kb

input:

5 9
181 182 184 178 81
173

output:

183

result:

ok 1 number(s): "183"

Test #2:

score: 0
Accepted
time: 10ms
memory: 9088kb

input:

1 888
888
888

output:

888

result:

ok 1 number(s): "888"

Test #3:

score: 0
Accepted
time: 10ms
memory: 9088kb

input:

1 2
446045505715847841
446045505715847840

output:

446045505715847840

result:

ok 1 number(s): "446045505715847840"

Test #4:

score: 0
Accepted
time: 553ms
memory: 19696kb

input:

100000 2
807962039062642490 880804964852722181 959725108988558937 594626785134501686 425482088894481449 676340104851509102 184450829310697710 631877387138697085 52728672294669025 360898372723015602 6758339167934099 169723381631741667 406281307220834232 11651333431455040 781335560876284346 8773369475...

output:

553478267720574478

result:

ok 1 number(s): "553478267720574478"

Test #5:

score: 0
Accepted
time: 212ms
memory: 19628kb

input:

100000 3
684875005129803765 709098012012528708 480894812691843935 192802234728574672 799328602200981241 816471042629902122 194852021641282532 699223097341173575 596346349877414625 176222175627714339 911245369353368570 429322911687891360 515479936110493603 318619854148565908 160597363142745651 195387...

output:

148669606523663815

result:

ok 1 number(s): "148669606523663815"

Test #6:

score: 0
Accepted
time: 365ms
memory: 19688kb

input:

100000 5
129494210963132304 277019632493463182 386180392318275419 520645308532061468 88972209392634514 669807243084456043 635809818965533308 715392780430009958 354309393033185135 549190749359853390 777757033042928397 905856356625845550 143774491908446012 574022081032628882 640426775109784241 1851134...

output:

300497756969678765

result:

ok 1 number(s): "300497756969678765"

Test #7:

score: 0
Accepted
time: 347ms
memory: 19692kb

input:

100000 7
630822406695744794 477299390470644195 325470478979428035 773343975310451318 860269241601790411 101706754174582047 211559169298240794 239266330575232906 746309663186601546 362697807276446450 939315921108841058 116129249092347232 650083292606092865 812361550420281815 226516627188856570 951699...

output:

288572584144291902

result:

ok 1 number(s): "288572584144291902"

Test #8:

score: 0
Accepted
time: 483ms
memory: 19628kb

input:

100000 25
51251644203166986 549351402988938382 694279130383632841 610525253804544230 684458492906151126 63232279536897262 728804590399630632 291342690465464012 194922149827118905 746519072305836528 209329582989387196 726180874956001415 356192042900226118 41271443347288072 320793885253192869 54527838...

output:

450584562204254438

result:

ok 1 number(s): "450584562204254438"

Test #9:

score: 0
Accepted
time: 540ms
memory: 19640kb

input:

100000 32
463368628487406643 32647027737340446 344652639707823670 414342912951134976 63972678207079586 972366953374863143 859270940516474839 784322982136643294 2430962027938898 432618021641274361 422102578966278816 812064681088426935 942541394200907148 386856316607581033 11960934554215668 5041449983...

output:

532870465189583872

result:

ok 1 number(s): "532870465189583872"

Test #10:

score: 0
Accepted
time: 419ms
memory: 19668kb

input:

100000 100
726365925473781288 924852326078181754 680717644501350132 942354243692678078 357845021224262895 184664913916063131 749794077317842485 444475377976962781 32723326228523426 715609806650973237 726148256788320316 804022754483820714 39483491261139602 435161988498900685 541146587201417187 326082...

output:

362668605596203312

result:

ok 1 number(s): "362668605596203312"

Test #11:

score: 0
Accepted
time: 273ms
memory: 19692kb

input:

100000 1000
213374267762435606 630244611191270176 270892479411716908 613708807444358255 800356952328819698 553899275792778005 737488305057083500 394268546663867130 735883788770776926 850875058688863503 668377457838859652 873643870954055067 262670968170311139 789750775255797395 313093051914250860 293...

output:

194667277645046000

result:

ok 1 number(s): "194667277645046000"

Test #12:

score: 0
Accepted
time: 185ms
memory: 19692kb

input:

100000 10000
452070894975760946 337069889090535748 892949699617554660 443760795735970006 342125240978475357 417709879885164419 906610750998236440 56898276610137316 75278311247943484 131799424501986167 251157111971599445 808114861853555350 72487575026078468 235500535254336056 873647535026452995 15786...

output:

114379812821900000

result:

ok 1 number(s): "114379812821900000"

Test #13:

score: 0
Accepted
time: 521ms
memory: 19664kb

input:

100000 100000
100389176858559494 313029182489444206 669454448895346361 593794830868581369 601202905778519705 780440644483437193 203838634811628902 560998404692185886 691897537625646765 503545870898705041 356866336175445747 703387109179580197 462612329667370863 129485094397505941 387080130384163501 6...

output:

463353164761600000

result:

ok 1 number(s): "463353164761600000"

Test #14:

score: -100
Wrong Answer
time: 8ms
memory: 8960kb

input:

1 2
537276664084910570
537276664084910570

output:

538000000000000001

result:

wrong answer 1st numbers differ - expected: '537276664084910572', found: '538000000000000001'