QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#504684 | #9107. Zayin and Count | PhantomThreshold# | Compile Error | / | / | C++20 | 1.3kb | 2024-08-04 14:47:22 | 2024-08-04 14:47:23 |
Judging History
answer
T=int(input())
for tt in range(T):
a=list(map(int,input().split()))
b=list(map(int,input().split()))
sa=sum(a)
sb=sum(b)
sx=input()
if sx=="0":
cnt=0
else:
cnt=a[0]
for digit in range(1,len(sx)):
cnt+=((sa-1) if a[0] else sa)*sa**(digit-1)
#print("???",cnt)
for i in range(len(sx)):
for j in range(int(sx[i])):
#print("?",i,j)
if i==0 and j==0:
continue
if a[j]:
cnt+=sa**(len(sx)-i-1)
#print("sub",sa**(len(sx)-i-1))
#print("!! ",cnt)
if(cnt==0 and b[0]):
print("0")
continue
elif b[0]:
cnt-=1
lans=0
for digit in range(1,100):
if cnt>=((sb-1) if b[0] else sb)*sb**(digit-1):
cnt-=((sb-1) if b[0] else sb)*sb**(digit-1)
else:
lans=digit
break
#print("len",lans,"cnt",cnt)
ans=""
for i in range(lans):
for j in range(10):
if i==0 and j==0:
continue
if b[j]:
if cnt>=sb**(lans-i-1):
cnt-=sb**(lans-i-1)
else:
ans+=str(j)
break
print(ans)
详细
answer.code:14:6: error: invalid preprocessing directive #print 14 | #print("???",cnt) | ^~~~~ answer.code:17:14: error: invalid preprocessing directive #print 17 | #print("?",i,j) | ^~~~~ answer.code:22:18: error: invalid preprocessing directive #print 22 | #print("sub",sa**(len(sx)-i-1)) | ^~~~~ answer.code:23:6: error: invalid preprocessing directive #print 23 | #print("!! ",cnt) | ^~~~~ answer.code:36:6: error: invalid preprocessing directive #print 36 | #print("len",lans,"cnt",cnt) | ^~~~~ answer.code:1:1: error: ‘T’ does not name a type 1 | T=int(input()) | ^