Problem p02987 (python)

Fixed submission:
S = input()

a = 1
b = 1
first = S[0]
second = ""
for i in range(3):
    if S[i+1] == first:
        a += 1
    elif second == "":
        second = S[i+1]
    elif second == S[i+1]:
        b+= 1

if a == 2 and b == 2:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#coding:utf-8
import bisect
from collections import deque
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = True

def index(a,b):
    return str(min(a,b)) + , +  str(max(a, b))

def main(given = sys.stdin.readline):
    input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    XLMIIS = lambda x : [LMIIS() for _ in range(x)]

    s = input()
    if s[0] == s[1] == s[2]:
        print(No)
    elif s[0] == s[1] and s[2] == s[3]:
        print(Yes)
    elif s[0] == s[2] and s[1] == s[3]:
        print(Yes)
    elif s[0] == s[3] and s[1] == s[2]:
        print(Yes)
    else:
        print(No)




if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#coding:utf-8
import bisect
from collections import deque
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = True

def index(a,b):
    return str(min(a,b)) + , +  str(max(a, b))

def main(given = sys.stdin.readline):
    input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    XLMIIS = lambda x : [LMIIS() for _ in range(x)]

    s = input()
    if s[0] == s[1] == s[2]:
        print(No)
    elif s[0] == s[1] and s[2] == s[3]:
        print(Yes)
    elif s[0] == s[2] and s[1] == s[3]:
        print(Yes)
    elif s[0] == s[3] and s[1] == s[2]:
        print(Yes)
    else:
        print(No)




if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#coding:utf-8
import bisect
from collections import deque
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = True

def index(a,b):
    return str(min(a,b)) + , +  str(max(a, b))

def main(given = sys.stdin.readline):
    input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    XLMIIS = lambda x : [LMIIS() for _ in range(x)]

    s = input()
    if s[0] == s[1] == s[2]:
        print(No)
    elif s[0] == s[1] and s[2] == s[3]:
        print(Yes)
    elif s[0] == s[2] and s[1] == s[3]:
        print(Yes)
    elif s[0] == s[3] and s[1] == s[2]:
        print(Yes)
    else:
        print(No)




if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#coding:utf-8
import bisect
from collections import deque
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = True

def index(a,b):
    return str(min(a,b)) + , +  str(max(a, b))

def main(given = sys.stdin.readline):
    input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    XLMIIS = lambda x : [LMIIS() for _ in range(x)]

    s = input()
    if s[0] == s[1] == s[2]:
        print(No)
    elif s[0] == s[1] and s[2] == s[3]:
        print(Yes)
    elif s[0] == s[2] and s[1] == s[3]:
        print(Yes)
    elif s[0] == s[3] and s[1] == s[2]:
        print(Yes)
    else:
        print(No)




if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#coding:utf-8
import bisect
from collections import deque
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = True

def index(a,b):
    return str(min(a,b)) + , +  str(max(a, b))

def main(given = sys.stdin.readline):
    input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    XLMIIS = lambda x : [LMIIS() for _ in range(x)]

    s = input()
    if s[0] == s[1] == s[2]:
        print(No)
    elif s[0] == s[1] and s[2] == s[3]:
        print(Yes)
    elif s[0] == s[2] and s[1] == s[3]:
        print(Yes)
    elif s[0] == s[3] and s[1] == s[2]:
        print(Yes)
    else:
        print(No)




if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#coding:utf-8import bisectfrom collections import dequeimport syssys.setrecursionlimit(10**6)write = sys.stdout.writedbg = lambda *something : print(*something) if DEBUG else 0DEBUG = Truedef index(a,b):    return str(min(a,b)) + , +  str(max(a, b))def main(given = sys.stdin.readline):    input = lambda : given().rstrip()    LMIIS = lambda : list(map(int,input().split()))    II = lambda : int(input())    XLMIIS = lambda x : [LMIIS() for _ in range(x)]    s = input()    if s[0] == s[1] == s[2]:        print(No)    elif s[0] == s[1] and s[2] == s[3]:        print(Yes)    elif s[0] == s[2] and s[1] == s[3]:        print(Yes)    elif s[0] == s[3] and s[1] == s[2]:        print(Yes)    else:        print(No)if __name__ == '__main__':    main()

Buggy submission (verdict: Runtime Error):
ijjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

Buggy submission (verdict: Runtime Error):
atcoder.py

Buggy submission (verdict: Runtime Error):
testtest