Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03251 (python)

Fixed submission:
#!/usr/bin/env python3
import sys
try:
    from typing import List
except ImportError:
    pass


def solve(N: int, M: int, X: int, Y: int, x: "List[int]", y: "List[int]"):
    xs = set(x)
    xs.add(X)
    ys = set(y)
    ys.add(Y)
    x1 = min(xs)
    x2 = max(xs)
    y1 = min(ys)
    y2 = max(ys)
    print("No War" if (x2 < y1 or y2 < x1) else "War")


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    Y = int(next(tokens))  # type: int
    x = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    y = [int(next(tokens)) for _ in range(M)]  # type: "List[int]"
    solve(N, M, X, Y, x, y)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
try:
    from typing import List
except ImportError:
    pass


def solve(N: int, M: int, X: int, Y: int, x: "List[int]", y: "List[int]"):
    xs = {X, *x}
    ys = {Y, *y}
    x1 = min(xs)
    x2 = max(xs)
    y1 = min(ys)
    y2 = max(ys)
    print("No War" if (x2 < y1 or y2 < x1) else "War")


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    Y = int(next(tokens))  # type: int
    x = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    y = [int(next(tokens)) for _ in range(M)]  # type: "List[int]"
    solve(N, M, X, Y, x, y)


if __name__ == '__main__':
    main()
Problem p03361 (python)

Fixed submission:
#!/usr/bin/env python3
import sys
try:
    from typing import List
except ImportError:
    pass

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(H: int, W: int, s: "List[str]"):
    print(YES if all(
        any(
            s[y + dy][x + dx] == "#"
            for dx, dy in [(1, 0), (0, 1), (-1, 0), (0, -1)]
            if 0 <= x + dx < W and 0 <= y + dy < H
        )
        for y in range(H)
        for x in range(W)
        if s[y][x] == "#"
    ) else NO)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    s = [next(tokens) for _ in range(H)]  # type: "List[str]"
    solve(H, W, s)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
try:
    from typing import List
except ImportError:
    pass

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(H: int, W: int, s: "List[str]"):
    print(YES if all(
        any(
            s[y + dy][x + dx] == "#"
            for dx, dy in [(1, 0), (0, 1), (-1, 0), (0, -1)]
            if 0 <= x + dx < W and 0 <= y + dy < H
        )
        for y in range(H)
        for x in range(W)
        if s[y][x] == "#"
    ) else NO)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    s = [next(tokens) for _ in range(W)]  # type: "List[str]"
    solve(H, W, s)


if __name__ == '__main__':
    main()
Problem p03660 (python)

Fixed submission:
#!/usr/bin/env python3
from collections import deque
import sys
try:
    from typing import Deque, List
except ImportError:
    pass


def bfs(G: "List[List[int]]", a: int):
    q = deque()  # type: Deque[int]
    q.append(a)
    dist = [-1] * len(G)
    dist[a] = 0
    while q:
        s = q.popleft()
        for t in G[s]:
            if dist[t] >= 0:
                continue
            q.append(t)
            dist[t] = dist[s] + 1
    return dist


def solve(N: int, a: "List[int]", b: "List[int]"):
    G = [[] for i in range(N)]
    for ai, bi in zip(a, b):
        ai -= 1
        bi -= 1
        G[ai].append(bi)
        G[bi].append(ai)
    db = bfs(G, 0)
    dw = bfs(G, N - 1)
    bn = sum((dbi <= dwi) for dbi, dwi in zip(db, dw))
    wn = N - bn
    if bn > wn:
        print("Fennec")
    else:
        print("Snuke")


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int()] * (N - 1)  # type: "List[int]"
    b = [int()] * (N - 1)  # type: "List[int]"
    for i in range(N - 1):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
    solve(N, a, b)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
from collections import deque
import sys
try:
    from typing import Deque, List
except ImportError:
    pass


def dfs(G: "List[List[int]]", a: int, b: int, par: int = -1):
    for t in G[a]:
        if t == par:
            continue
        if t == b:
            return [t]
        path = dfs(G, t, b, a)
        if path:
            return [t] + path
    return None


def bfs(G: "List[List[int]]", a: int, par: int = -1):
    q = deque()  # type: Deque[int]
    q.append(a)
    visited = {par, a}
    while q:
        s = q.popleft()
        for t in G[s]:
            if t in visited:
                continue
            q.append(t)
            visited.add(t)
    return len(visited) - 1


def solve(N: int, a: "List[int]", b: "List[int]"):
    G = [[] for i in range(N)]
    for ai, bi in zip(a, b):
        ai -= 1
        bi -= 1
        G[ai].append(bi)
        G[bi].append(ai)
    path = dfs(G, 0, N - 1)
    assert path
    path = [0] + path
    bb = path[(len(path) - 1) // 2]
    wb = path[(len(path) + 1) // 2]
    bn = bfs(G, bb, wb)
    wn = bfs(G, wb, bb)
    if bn > wn:
        print("Fennec")
    else:
        print("Snuke")


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int()] * (N - 1)  # type: "List[int]"
    b = [int()] * (N - 1)  # type: "List[int]"
    for i in range(N - 1):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
    solve(N, a, b)


if __name__ == '__main__':
    main()
Problem p03665 (python)

Fixed submission:
def ncr(n, r):
    ans = 1
    if r * 2 > n:
        return ncr(n, n - r)
    for i in xrange(n - r + 1, n + 1):
        ans *= i
    for i in xrange(1, r + 1):
        ans //= i
    return ans


def main():
    n, p = [int(_) for _ in raw_input().split()]
    o = 0
    e = 0
    for ai in (int(_) for _ in raw_input().split()):
        if ai % 2 == 1:
            o += 1
        else:
            e += 1
    t = 2 ** e
    ans = 0
    for q in xrange(p, o + 1, 2):
        ans += t * ncr(o, q)
    return ans


if __name__ == '__main__':
    print(main())

Buggy submission (verdict: Runtime Error):
def ncr(n, r):
    ans = 1
    if r * 2 >= n:
        return ncr(n, n - r)
    for i in xrange(n - r + 1, n + 1):
        ans *= i
    for i in xrange(1, r + 1):
        ans //= i
    return ans


def main():
    n, p = [int(_) for _ in raw_input().split()]
    o = 0
    e = 0
    for ai in (int(_) for _ in raw_input().split()):
        if ai % 2 == 1:
            o += 1
        else:
            e += 1
    t = 2 ** e
    ans = 0
    for q in xrange(p, o + 1, 2):
        ans += t * ncr(o, q)
    return ans


if __name__ == '__main__':
    print(main())
Problem p03668 (python)

Fixed submission:
import sys
sys.setrecursionlimit(700000)


def main():

    def nim(i, parent=None):
        ret = 0
        for j in edges[i]:
            if j == parent:
                continue
            ret ^= nim(j, i) + 1
        return ret

    n = int(raw_input())
    edges = [[] for i in xrange(n)]
    for i in xrange(n - 1):
        x, y = [int(_) - 1 for _ in raw_input().split()]
        edges[x].append(y)
        edges[y].append(x)
    if nim(0) == 0:
        return "Bob"
    else:
        return "Alice"


if __name__ == '__main__':
    print(main())

Buggy submission (verdict: Runtime Error):
def main():

    def nim(i, parent=None):
        ret = 0
        for j in edges[i]:
            if j == parent:
                continue
            ret ^= nim(j, i) + 1
        return ret

    n = int(raw_input())
    edges = [[] for i in xrange(n)]
    for i in xrange(n - 1):
        x, y = [int(_) - 1 for _ in raw_input().split()]
        edges[x].append(y)
        edges[y].append(x)
    if nim(0) == 0:
        return "Bob"
    else:
        return "Alice"


if __name__ == '__main__':
    print(main())
Problem p03746 (python)

Fixed submission:
n, m = [int(x) for x in raw_input().split()]

t = [[] for i in xrange(n)]

for i in xrange(m):
    a, b = [int(x) - 1 for x in raw_input().split()]
    t[a].append(b)
    t[b].append(a)

pre = [a]
pos = [b]
visited = {a, b}

while 1:
    for ne in t[pre[-1]]:
        if ne not in visited:
            visited.add(ne)
            pre.append(ne)
            break
    else:
        break


while 1:
    for ne in t[pos[-1]]:
        if ne not in visited:
            visited.add(ne)
            pos.append(ne)
            break
    else:
        break

print(len(pre) + len(pos))
print(" ".join(str(x + 1) for x in reversed(pre)) + " " + " ".join(str(x + 1) for x in pos))

Buggy submission (verdict: Runtime Error):
n, m = [int(x) for x in raw_input().split()]

t = [[] for i in xrange(m)]

for i in xrange(m):
    a, b = [int(x) - 1 for x in raw_input().split()]
    t[a].append(b)
    t[b].append(a)

pre = [a]
pos = [b]
visited = {a, b}

while 1:
    for ne in t[pre[-1]]:
        if ne not in visited:
            visited.add(ne)
            pre.append(ne)
            break
    else:
        break


while 1:
    for ne in t[pos[-1]]:
        if ne not in visited:
            visited.add(ne)
            pos.append(ne)
            break
    else:
        break

print(len(pre) + len(pos))
print(" ".join(str(x + 1) for x in reversed(pre)) + " " + " ".join(str(x + 1) for x in pos))
Problem p03836 (python)

Fixed submission:
sx, sy, tx, ty = [int(x) for x in raw_input().split()]

w = tx - sx
h = ty - sy

c = "U" * h + "R" * (w + 1) + "D" * (h + 1) + "L" * w
print c + "LULU" + c

Buggy submission (verdict: Runtime Error):
"U" * h + "R" * (w + 1) + "D" * (h + 1) + "L" * (w + 1)
Problem p03855 (python)

Fixed submission:
#http://www.geocities.jp/m_hiroi/light/pyalgo61.html
class UF(object):
    def __init__(self, n):
        self.table = [None for i in range(n)]
    def find(self, x):
        if self.table[x] is None:
            return x
        else:
            self.table[x] = self.find(self.table[x])
            return self.table[x]
    def union(self, x, y):
        s1 = self.find(x)
        s2 = self.find(y)
        if s1 != s2:
            self.table[s2] = s1

n, k, l = [int(x) for x in raw_input().split()]
d = UF(n)
t = UF(n)
for i in range(k):
    p, q = [int(x) - 1 for x in raw_input().split()]
    d.union(p, q)
for i in range(l):
    r, s = [int(x) - 1 for x in raw_input().split()]
    t.union(r, s)
res = {}
for i in range(n):
    key = (d.find(i), t.find(i))
    res[key] = res.get(key, 0) + 1
for i in range(n):
    print res[(d.find(i), t.find(i))],

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>

using namespace std;

int table[2][200000] = {{}, {}};

int uffind(int i, int x) {
  if (table[i][x] == -1) {
    return x;
  }
  return (table[i][x] = uffind(i, table[i][x]));
}

void ufunion(int i, int x, int y) {
  int s1 = uffind(i, x), s2 = uffind(i, y);
  if (s1 != s2) {
    table[i][s2] = s1;
  }
}

int main() {
  for (int i = 0; i < 200000; i++) {
    table[0][i] = table[1][i] = -1;
  }
  int n, k, l;
  cin >> n >> k >> l;
  for (int i = 0; i < k; i++) {
    int p, q;
    cin >> p >> q;
    p--; q--;
    ufunion(0, p, q);
  }
  for (int i = 0; i < l; i++) {
    int r, s;
    cin >> r >> s;
    r--; s--;
    ufunion(1, r, s);
  }
  map<int, vector<int> > d2;
  map<int, vector<int> > t2;
  for (int i = 0; i < n; i++) {
    int sd = uffind(0, i);
    decltype(d2)::iterator itd = d2.find(sd);
    if (itd == d2.end()) {
      vector<int> vd(1, i);
      d2.insert(make_pair(sd, vd));
    } else {
      itd->second.push_back(i);
    }
    int st = uffind(1, i);
    decltype(t2)::iterator itt = t2.find(st);
    if (itt == t2.end()) {
      vector<int> vt(1, i);
      t2.insert(make_pair(st, vt));
    } else {
      itt->second.push_back(i);
    }
  }
  for (int i = 0; i < n; i++) {
    decltype(d2)::iterator itd = d2.find(uffind(0, i));
    decltype(t2)::iterator itt = t2.find(uffind(1, i));
    vector<int> vd = itd->second;
    vector<int> vt = itt->second;
    vector<int> res(vd.size() + vt.size());
    sort(vd.begin(), vd.end());
    sort(vt.begin(), vt.end());
    vector<int>::iterator it = set_intersection(vd.begin(), vd.end(), vt.begin(), vt.end(), res.begin());
    res.resize(it - res.begin());
    cout << res.size();
    if (i != n - 1) {
      cout << ' ';
    }
  }
  cout << endl;
  return 0;
}
Problem p04014 (python)

Fixed submission:
#!/usr/bin/env python3
import sys


def f(b: int, n: int) -> int:
    if n < b:
        return n
    return f(b, n // b) + n % b


def sqrt(n: int):
    lb = 0
    hb = n + 1
    while hb - lb > 1:
        m = (lb + hb) // 2
        if m * m <= n:
            lb = m
        else:
            hb = m
    return lb


def solve(n: int, s: int):
    if s == n:
        print(n + 1)
        return
    sn = sqrt(n)
    for b in range(2, sn + 1):
        if f(b, n) == s:
            print(b)
            return
    for p in reversed(range(1, sn + 1)):
        q = s - p
        if q < 0:
            continue
        b, r = divmod(n - q, p)
        if r != 0 or b <= p:
            continue
        if f(b, n) == s:
            print(b)
            return
    print(-1)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    n = int(next(tokens))  # type: int
    s = int(next(tokens))  # type: int
    solve(n, s)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys


def f(b: int, n: int) -> int:
    if n < b:
        return n
    return f(b, n // b) + n % b


def solve(n: int, s: int):
    for b in range(2, int(n ** 0.5) + 1):
        if f(b, n) == s:
            print(b)
            return
    for p in reversed(range(int(n ** 0.5))):
        q = s - p
        if p == 0:
            b, r = n + 1, 0
        else:
            b, r = divmod(n - q, p)
            if r != 0 or b == 1:
                continue
        if f(b, n) == s:
            print(b)
            return
    print(-1)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    n = int(next(tokens))  # type: int
    s = int(next(tokens))  # type: int
    solve(n, s)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys


def f(b: int, n: int) -> int:
    if n < b:
        return n
    return f(b, n // b) + n % b


def solve(n: int, s: int):
    for b in range(2, int(n ** 0.5) + 1):
        if f(b, n) == s:
            print(b)
            return
    for p in reversed(range(int(n ** 0.5))):
        q = s - p
        if p == 0:
            b, r = n + 1, 0
        else:
            b, r = divmod(n - q, p)
        if r != 0:
            continue
        if f(b, n) == s:
            print(b)
            return
    print(-1)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    n = int(next(tokens))  # type: int
    s = int(next(tokens))  # type: int
    solve(n, s)


if __name__ == '__main__':
    main()
Problem p04039 (python)

Fixed submission:
n,k=raw_input().split();u=sorted({chr(x)for x in range(48,59)}-set(raw_input().split()));z=u[0];n=list(n)
for i,d in enumerate(n):
 if d in u:continue
 n[i:]=[next(e for e in u if e>d)]+[z]*(len(n)-i-1)
 for j in range(i-1,-1,-1):
  if n[j+1]<':':break
  n[j:j+2]=[next(e for e in u if e>n[j]),z]
 else:
  if n[0]>'9':n=[u[1 if'1'>z else 0]]+[z]*len(n)
print"".join(n)

Buggy submission (verdict: Runtime Error):
n,k=raw_input().split();u=sorted({chr(x)for x in range(48,59)}-set(raw_input().split()));z=u[0];n=list(n)
i=next(i for i,d in enumerate(n)if d not in u)
n[i:]=[next(e for e in u if e>n[i])]+[z]*(len(n)-i-1)
for j in range(i-1,-1,-1):
 if n[j+1]<':':break
 n[j:j+2]=[next(e for e in u if e>n[j]),z]
else:
 if n[0]>'9':n=[u[1 if'1'>z else 0]]+[z]*len(n)
print"".join(n)

Buggy submission (verdict: Runtime Error):
n,k=raw_input().split()
u=sorted({chr(x)for x in range(48,59)}-set(raw_input().split()))
n=list(n)
for i,d in enumerate(n):
 if d not in u:
  n[i:]=[next(e for e in u if e>d)]+[u[0]]*(len(n)-i-1)
  for j in range(i-1,-1,-1):
   if n[j+1]!=':':break
   n[j:j+2]=[next(e for e in u if e>n[j+1]),u[0]]
  else:
   if n[0]==':':n=[u[1 if'1'>u[0]else 0]]+[u[0]]*len(n)
print"".join(n)

Buggy submission (verdict: Runtime Error):
n,k=raw_input().split()
u=sorted({chr(x)for x in range(48,59)}-set(raw_input().split()))
n=list(n)
for i,d in enumerate(n):
 if d not in u:
  n[i:]=[next(e for e in u if e>d)]+[u[0]]*(len(n)-i-1)
  for j in range(i-1,-1,-1):
   if n[j+1]!=':':break
   n[j:j+2]=[next(e for e in u if e>n[j+1]),u[0]]
  else:n=[u[1 if'1'>u[0]else 0]]+[u[0]]*len(n)
print"".join(n)

Buggy submission (verdict: Runtime Error):
n,k=raw_input().split()
u=sorted({str(x)for x in range(10)}-set(raw_input().split()))
n=list(n)
for i,d in enumerate(n):
 if d not in u:n[i:]=[next(e for e in u if e>d)]+[u[0]]*(len(n)-i-1)
print"".join(n)
Problem p02713 (python)

Fixed submission:
import math
N=int(input())
C=0
 
for l in range(N):
    for n in range(N):
        for m in range(N):
            if l==0 or m==0 or n==0:
                C+=1
            else:
                C+=math.gcd(math.gcd(l+1,m+1),n+1)
 
print(C)

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
C=0
 
for l in range(N):
    for n in range(N):
        for m in range(N):
            if l==0 or m==0 or n==0:
                C+=1
            else:
                C+=math.gcd(math.gcd(l+1,m+1),n+1)
 
print(C
Problem p02812 (python)

Fixed submission:
N=int(input())
A=list(input())
cnt=0

for n in range(N):
    if n==N-1 or n==N-2:
        continue
    elif A[n]=="A":
        if A[n+1]=="B":
            if A[n+2]=="C":
                cnt+=1
            else:
                continue
        else:
            continue
    else:
        continue

print(cnt)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(input())
cnt=0

for n in range(N):
    if A[n]=="A":
        if A[n+1]=="B":
            if A[n+2]=="C":
                cnt+=1
            else:
                continue
        else:
            continue
    else:
        continue

print(cnt)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(input())
cnt=0

for n in range(N):
    if A[n]=="A":
        if A[n+1]=="B":
            if A[n+2]=="C":
                cnt+=1
            else:
                continue
        else:
            continue
    else:
        continue

print(cnt)
Problem p03071 (python)

Fixed submission:
A,B=map(int,input().split())
print(max(2*A-1,2*B-1,A+B))

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
input(max(2*A-1,2*B-1,A+B))

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
input(max(2*A-1,2*B-1,A+B))

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
input(max(2*A-1,2*B-1,A+B))
Problem p02677 (python)

Fixed submission:
# C
import math
#A:短針,B:長針,H:短針の位置,M:長針の位置
A,B,H,M = map(int,input().split(' '))
rad = abs((H*30+M/2)-M*6)
rad = math.radians(min(rad,360-rad))
print('{:.20f}'.format((A**2 + B**2 - 2*A*B*math.cos(rad))**0.5))

Buggy submission (verdict: Runtime Error):
# C
import math
#A:短針,B:長針,H:短針の位置,M:長針の位置
A,B,H,M = map(int,input().split(' '))

#radian = degree/180*PI
rad = abs(H/6*math.pi-M/30*math.pi)
rad = min(rad,360-rad)
print('{:.15f}'.format(A*A + B*B - 2*A*B*math.cos(rad))**0.5)
Problem p02683 (python)

Fixed submission:
#coding :utf-8

N,M,X=map(int,input().split())

C=[]
A=[]
for i in range(N):
  t=list(map(int,input().split()))
  C.append(t[0])
  A.append(t[1:])
result=-1

for i in range(1<<N):
  t=[0]*M
  c=0
  for j in range(N):
    if ((i>>j) & 1==0):
      continue
    c+=C[j]
    for k in range(M):
      t[k]+=A[j][k]
    
  
  if all(x>=X for x in t):
    if result==-1:
      result=c
    else:
      result=min(result,c)

print(result)

Buggy submission (verdict: Runtime Error):
#coding :utf-8
import numpy as np

N,M,X=map(int,input().split())
a=[]
for i in range(N):
    a.append(list(map(int,input().split())))

suma=sum(a[0][])
print(suma,a)
Problem p02741 (python)

Fixed submission:
# coding: utf-8
N=int(input())

l=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(l[N-1])

Buggy submission (verdict: Runtime Error):
# coding: utf-8
H,W=map(int,input().split())

if H==1 or W==1:
  print(1)
else:
  if H*W%2==0:
    print(int(H*W/2))
  else:
    print(int(H*W/2+0.5))
Problem p02952 (python)

Fixed submission:
n=int(input())
s=len(str(n))
if n<10:
    print(n)
else:
    if s%2==0:
        s=s-1
        x=''
        for i in range(s-1):
            if i%2==0:
                x+='9'
            else:
                x+='0'
        x+='9'
        print(x)
    else:
        z=s-2
        x = ''
        for i in range(z - 1):
            if i % 2 == 0:
                x += '9'
            else:
                x += '0'
        x += '9'
        x=int(x)
        x+=n-int('9'*(z+1))
        print(x)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=len(str(n))
if s%2==0:
    s=s-1
    x=''
    for i in range(s-1):
        if i%2==0:
            x+='9'
        else:
            x+='0'
    x+='9'
    print(x)
else:
    z=s-2
    x = ''
    for i in range(z - 1):
        if i % 2 == 0:
            x += '9'
        else:
            x += '0'
    x += '9'
    x=int(x)
    x+=n-int('9'*(z+1))
    print(x)
Problem p02706 (python)

Fixed submission:
N, M = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
sum_a = 0
for i in a:
    sum_a += i
if sum_a > N:
    print(-1)
else:
    print(N - sum_a)

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    x=list(map(int,input().split(" ")))
    y = list(map(int, input().split(" ")))
    num=0
    for i in y:
        num+=i
    if x[0]<y:
        print(-1)
    else: print(x[0]-y)
Problem p02705 (python)

Fixed submission:
import math
R=float(input())
print(2*R*math.pi)

Buggy submission (verdict: Runtime Error):
import math
float R
R=float(input())
print(2*R*math.pi)

Buggy submission (verdict: Runtime Error):
import math
float R
R=float(input())
print(2*math.pi*R)

Buggy submission (verdict: Runtime Error):
import math
froat R
R=input()
print(2*math.pi*R)
Problem p02841 (python)

Fixed submission:
a=list(map(int, input().split()))
b=list(map(int, input().split()))
ou=b[0]-a[0]
if ou == 1:
  print(1)
elif ou==0:
  print(0)
elif ou==1-12:
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
X=float(N)/1.08
if X%1==0.0:
    print(int(X))
else:
    Y=math.floor(X)
    if math.floor(Y*1.08)==N or math.floor((Y-1)*1.08)==N:
        print(Y)
    else:
        print(":(")