/ SeriousOJ /

Record Detail

Runtime Error


  
# Status Time Cost Memory Cost
#1 Accepted 19ms 3.023 MiB
#2 Runtime Error Traceback (most recent call last): File "foo.py", line 15, in <module> ValueError: invalid literal for int() with base 10: '\r' 20ms 3.121 MiB
#3 Accepted 30ms 3.352 MiB
#4 Accepted 30ms 3.141 MiB
#5 Accepted 28ms 2.984 MiB
#6 Accepted 29ms 3.074 MiB

Code

s = input()  # y=-2x

for _ in range(int(input())):
    x, y = map(int, input().split())

    if "x" not in s:
        m = 0
        c = int(s)
    else:
        n = s.index("x")
        m = int(s[2:n]) 
        if n == len(s) - 1:
            c = 0
        else:
            c = int(s[(n+1):])

    if y == (m * x + c):
        print("YES")
    else:
        print("NO")

Information

Submit By
Type
Submission
Problem
P1015 Friend in need is a friend indeed
Contest
Brain booster - 1
Language
Python 3 (Python 3.12.3)
Submit At
2023-12-31 16:21:10
Judged At
2024-11-11 03:45:13
Judged By
Score
80
Total Time
30ms
Peak Memory
3.352 MiB