QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#647337#9255. Python ProgramMu_Silk#Compile Error//C++20878b2024-10-17 13:26:562024-10-17 13:26:56

Judging History

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

  • [2024-10-17 13:26:56]
  • 评测
  • [2024-10-17 13:26:56]
  • 提交

answer

import math

def solve():
    s=input()
    l1=input().split(' ')
    l2=input()[4:].split(' ')
    sym=l1[1]

    rg1=list(map(int,l1[3][6:-2].split(','))) 
    if(len(rg1)<3):rg1.append(1)

    rg2=l2[3][6:-2].split(',')
    if(len(rg2)<3):rg2.append('1')

    ans=0
    for i in range(rg1[0],rg1[1],rg1[2]):
        l,r,s=rg2
        if(l==sym):l=i
        else: l=int(l)

        if(r==sym):r=i
        else: r=int(r)

        if(s==sym):s=i
        else: s=int(s)

        l1,r1,cnt=0,abs(r-l)+1,0
        while(r1>=l1):
            m=(l1+r1)>>1
            if (s>0 and l+s*(m-1)<r) or (s<0 and l+s*(m-1)>r):
                cnt=m
                l1=m+1
            else:
                r1=m-1
        # print(l,r,s,cnt)
        ans+=(l+l+(cnt-1)*s)*cnt//2

    print(ans)

_=1
# _=int(input())
while(_>0):
    _-=1
    solve()

詳細信息

answer.code:35:11: error: invalid preprocessing directive #print
   35 |         # print(l,r,s,cnt)
      |           ^~~~~
answer.code:41:3: error: invalid preprocessing directive #_
   41 | # _=int(input())
      |   ^
answer.code:1:1: error: ‘import’ does not name a type
    1 | import math
      | ^~~~~~
answer.code:1:1: note: C++20 ‘import’ only available with ‘-fmodules-ts’, which is not yet enabled with ‘-std=c++20’