/ SeriousOJ /

Record Detail

Runtime Error


  
# Status Time Cost Memory Cost
#1 Accepted 13ms 2.844 MiB
#2 Runtime Error Traceback (most recent call last): File "foo.py", line 16, in <module> ValueError: invalid literal for int() with base 10: '\r' 12ms 2.883 MiB
#3 Accepted 17ms 2.789 MiB
#4 Accepted 17ms 2.848 MiB
#5 Accepted 16ms 2.742 MiB
#6 Accepted 17ms 2.711 MiB

Code

s = input()
for i in range(int(input())):
    X, Y = map(int, input().split())
    LHS, RHS = s.split('=')
    if 'y' in LHS:
        LHS = LHS.replace('y', '1')
        LHS_NEW = int(LHS)*Y
    else:
        LHS_NEW = int(LHS)
    if 'x' in RHS:
        L, R = RHS.split('x')
        L_NEW = int(L)*X
        if R == '':
            R_NEW = 0
        else:
            R_NEW = int(R)
        RHS_NEW = L_NEW + R_NEW
    else:
        RHS_NEW = int(RHS)
    if LHS_NEW == RHS_NEW:
        print("YES")
    else:
        print("NO")

Information

Submit By
Type
Submission
Problem
P1015 Friend in need is a friend indeed
Language
Python 3 (Python 3.12.3)
Submit At
2024-01-08 12:32:17
Judged At
2024-01-08 12:32:17
Judged By
Score
80
Total Time
17ms
Peak Memory
2.883 MiB