Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys
import math
INF=1e9
mod=1e9+7
n,m=[int(i) for i in input().split()]
a=[int(i) for i in input().split()]
g=1
init=0
num=a[0]
while(num%2==0):
    num/=2
    init+=1
for i in range(1,n):
    num=a[i]
    cnt=0
    while(num%2==0):
        num/=2
        cnt+=1
    if(cnt!=init):
        print(0)
        sys.exit()
for i in range(n):
    a[i]//=2
    g=g*a[i]//math.gcd(g,a[i])
#print(g)
ans=(m//g)
if(ans%2==1):
    print(ans//2+1)
else:
    print(ans//2)

Fixed submission:
import sys
import math
INF=1e9
mod=1e9+7

def gcd(a,b):
    if (b==0):
        return a
    return gcd(b,a%b)
 
def lcm(a,b):
    return (a//gcd(a,b))*b
 

n,m=[int(i) for i in input().split()]
a=[int(i) for i in input().split()]
g=1
init=0
for i in range(n):
    a[i]//=2
num=a[0]
while(num%2==0):
    num/=2
    init+=1
for i in range(1,n):
    num=a[i]
    cnt=0
    while(num%2==0):
        num/=2
        cnt+=1
    if(cnt!=init):
        print(0)
        sys.exit()
for i in range(n):
    g=lcm(g,a[i])
#print(g)
ans=(m//g)
if(ans%2==1):
    print(ans//2+1)
else:
    print(ans//2)

Buggy python submission (verdict: Runtime Error):
import sys
import math
INF=1e9
mod=1e9+7
n,m=[int(i) for i in input().split()]
a=[int(i) for i in input().split()]
g=1
for i in range(n):
    a[i]//=2
    g=g*a[i]//math.gcd(g,a[i])
#print(g)
ans=(m//g)
if(ans%2==1):
    print(ans//2+1)
else:
    print(ans//2)

Fixed submission:
import sys
import math
INF=1e9
mod=1e9+7

def gcd(a,b):
    if (b==0):
        return a
    return gcd(b,a%b)
 
def lcm(a,b):
    return (a//gcd(a,b))*b
 

n,m=[int(i) for i in input().split()]
a=[int(i) for i in input().split()]
g=1
init=0
for i in range(n):
    a[i]//=2
num=a[0]
while(num%2==0):
    num/=2
    init+=1
for i in range(1,n):
    num=a[i]
    cnt=0
    while(num%2==0):
        num/=2
        cnt+=1
    if(cnt!=init):
        print(0)
        sys.exit()
for i in range(n):
    g=lcm(g,a[i])
#print(g)
ans=(m//g)
if(ans%2==1):
    print(ans//2+1)
else:
    print(ans//2)

Buggy python submission (verdict: Runtime Error):
import sys
import math
INF=1e9
mod=1e9+7
n,m=map(int,input().split())
a=list(map(int,input().split()))
g=1
for i in range(n):
    a[i]//=2
    g=g*a[i]//math.gcd(g,a[i])
#print(g)
ans=(m//g)
if(ans%2==1):
    print(ans//2+1)
else:
    print(ans//2)

Fixed submission:
import sys
import math
INF=1e9
mod=1e9+7

def gcd(a,b):
    if (b==0):
        return a
    return gcd(b,a%b)
 
def lcm(a,b):
    return (a//gcd(a,b))*b
 

n,m=[int(i) for i in input().split()]
a=[int(i) for i in input().split()]
g=1
init=0
for i in range(n):
    a[i]//=2
num=a[0]
while(num%2==0):
    num/=2
    init+=1
for i in range(1,n):
    num=a[i]
    cnt=0
    while(num%2==0):
        num/=2
        cnt+=1
    if(cnt!=init):
        print(0)
        sys.exit()
for i in range(n):
    g=lcm(g,a[i])
#print(g)
ans=(m//g)
if(ans%2==1):
    print(ans//2+1)
else:
    print(ans//2)
Buggy python submission (verdict: Runtime Error):
x = int(input())
if x == 0:
  print(1)
elif x == 1:
  print(0)
else:
  break

Fixed submission:
x = int(input())
print(1-x)
Buggy python submission (verdict: Runtime Error):
from decimal import *
import math
a,b,c = map(int,input().split())
a2 = Decimal(str(math.sqrt(Decimal(str(a))))
b2 = Decimal(str(math.sqrt(Decimal(str(b))))
c2 = Decimal(str(math.sqrt(Decimal(str(c))))

if a2 + b2 < c2:
    print('Yes')
else:
    print('No')

Fixed submission:
a,b,c = map(int,input().split())

if c-a-b>0:
    if 4*a*b<(c-a-b)**2:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
import math
from decimal import *
a,b,c = map(int,input().split())
if a+b >= c:
    print('No')
else:
    sq = Decimal(((a*b)**(1/2))*2)
    if (a+b+sqin) <c:
        print('Yes')
    else:
        print('No')

Fixed submission:
a,b,c = map(int,input().split())

if c-a-b>0:
    if 4*a*b<(c-a-b)**2:
        print('Yes')
    else:
        print('No')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
for i in range(n):
    si = input()
    s.append(si)
    
s.sort()
sset = set(s)
ns = len(sset)
cou = []
pri = []
pre = 0

for i in range(ns):
    c = s.count(s[pre])
    cou.append(c)
    pre += c
    pri.append(s[pre-1])
    
M = max(cou)
for i in range(ns):
    if cou[i] == M:
        print(pri[i])

Fixed submission:
import collections

n = int(input())
s = []
for i in range(n):
    si = input()
    s.append(si)
    
s.sort()
counted = collections.Counter(s)
M = max(counted.values())

ms = [k for k, v in counted.items() if v == M]
ms.sort()

for i in range(len(ms)):
    print(ms[i])
Buggy python submission (verdict: Time Limit Exceeded):
h,w,k = map(int,input().split())

s = []
isk = []
for l in range(h):
    sl = input()
    isk.append(sl.count("#"))
    s.append(list(sl))
 

pa = [[0,0] for i in range(h)]
for i in range(h-1):
    if isk[i] == 0:
        pa[i+1][0] = pa[i][0] + 1
    if isk[h-1-i] == 0:
        pa[h-1-i-1][1] = pa[h-1-i][1] + 1
 
res = [[] for l in range(h)]       
now = 1
for i in range(h):
    nowk = isk[i]
    nownow = now
    pp = pa[i][0]
    aa = pa[i][1]
    if nowk != 0:
        for j in range(w):
            p = pp
            a = aa
            if s[i][j] == "#" and nowk != 0:
                res[i].append(nownow)
                while p > 0:
                    if len(res[i-p]) < w:
                        res[i-p].append(nownow)
                        p -= 1
                while a > 0:
                    if len(res[i+a]) < w:
                        res[i+a].append(nownow)
                        a -= 1
                now += 1
                nowk -= 1
                if nowk != 0:
                    nownow += 1
            else:
                res[i].append(nownow)
                while p > 0:
                    if len(res[i-p]) < w:
                        res[i-p].append(nownow)
                        p -= 1
                while a > 0:
                    if len(res[i+a]) < w:
                        res[i+a].append(nownow)
                        a -= 1
                
for l in range(h):
    print(" ".join(map(str,res[l])))
                

Fixed submission:
h,w,k = map(int,input().split())

s = []
isk = []
for l in range(h):
    sl = input()
    isk.append(sl.count("#"))
    s.append(list(sl))
 

pa = [[0,0] for i in range(h)]
for i in range(h-1):
    if isk[i] == 0:
        pa[i+1][0] = pa[i][0] + 1
    if isk[h-1-i] == 0:
        pa[h-1-i-1][1] = pa[h-1-i][1] + 1
 
res = [[] for l in range(h)]       
now = 1
for i in range(h):
    nowk = isk[i]
    nownow = now
    p = pa[i][0]
    a = pa[i][1]
    if nowk != 0:
        for j in range(w):
            if s[i][j] == "#" and nowk != 0:
                res[i].append(nownow)
                now += 1
                nowk -= 1
                if nowk != 0:
                    nownow += 1
            else:
                res[i].append(nownow)
        while p > 0:
            res[i-p] = res[i]
            p -= 1
        while a > 0:
            res[i+a] = res[i]
            a -= 1
                
for l in range(h):
    print(" ".join(map(str,res[l])))
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(range(1,n+1))
sum = (n*(n-1))//2
print(sum)

Fixed submission:
n = int(input())
sum = (n*(n-1))//2
print(sum)
Buggy python submission (verdict: Runtime Error):
n, q = map(int,input().split())
tree = [[] for i in range(n)]
v = [0]*n
for i in range(n-1):
    a1,b1 = [int(i) for i in input().split()]
    tree[a1-1].append(b1)
for i in range(q):
    p1,x1 = [int(i) for i in input().split()]
    v[p1 - 1] += x1
for i in range(n):
    for j in range(len(tree[i])):
        v[tree[i][j]-1] += v[i]
for i in range(n):
    print(str(v[i]) +" ",end="")

Fixed submission:
a = int(input())
s = input()
if a >= 3200:
  print(s)
else:
  print('red')
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
#define rep(i,s,n) for(int i=s;i<n;i++)
#define pb push_back
#define all(x) (x).begin(),(x).end()
using namespace std;
using P=pair<int,int>;
using G=vector<vector<int>>;
using ll=long long;
ll N;
vector<ll> H, S;
vector<bool> seen;
vector<ll>sum;
vector<int> pl;

bool isYes(ll mid)
{
	vector<ll> count(N, 0);
	for (ll i = 0; i < N; ++i)
	{
		if (mid - H[i] < 0) return false;
		++count[min(N-1, (mid - H[i]) / S[i])];
	}
	for (ll i = 0; i < N-1; ++i)
		count[i+1] += count[i];
	for (ll i = 0; i < N; ++i)
		if (count[i] > i+1)
			return false;
	return true;
}
//普通の深さ優先探索seenを返す感じ
void dfs2(const G &G,int v){
    seen[v] = true; //v探索済み
	sum[v]+=pl[v];

    for(auto next_v :G[v]){
        if(seen[next_v])continue;//もう探索していた
		sum[next_v]+=sum[v];
        dfs2(G,next_v);
    }
}

void dfs(const G &G, int v, int p) {
	sum[v]+=pl[v];

    for (auto nv : G[v]) {
        if (nv == p) continue; // nv が親 p だったらダメ
		sum[nv]+=sum[v];
        dfs(G, nv, v); // v は新たに nv の親になります
    }
}

int main(int argc, char **argv){
	ll n,q; cin>>n>>q;
	G graph(n);
	sum.assign(n,0);
	pl.assign(n,0);

	rep(i,0,n-1){
		int a,b; cin>>a>>b;
		graph[a-1].push_back(b-1);
	}
	rep(i,0,q){
		int p,x; cin>>p>>x;
		pl[p-1]+=x;
	}

	seen.assign(n,false);
	rep(i,0,n){
		dfs2(graph,i);
	}

	rep(i,0,n){
		cout<<sum[i]<<" ";
	}

}


Fixed submission:
n, q = map(int,input().split())
tree = [[] for i in range(n)]
v = [0]*n
for i in range(n-1):
    a1,b1 = [int(i) for i in input().split()]
    tree[a1-1].append(b1)
for i in range(q):
    p1,x1 = [int(i) for i in input().split()]
    v[p1 - 1] += x1
for i in range(n):
    for j in range(len(tree[i])):
        v[tree[i][j]-1] += v[i]
for i in range(n):
    print(str(v[i]) +" ",end="")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [input() for i in range(n)]
for i in range(n):
    s[i] = sorted(s[i])
l = [s[0]]
count = [1]
result = 0
for i in range(1,n):
    exis = False
    for j in range(len(l)):
        if s[i] == l[j]:
            result += count[j]
            count[j] += 1
            exis = True
    if exis == False:
        l.append(s[i])
        count.append(1)
    
print(result)

Fixed submission:
n = int(input())
s = [input() for i in range(n)]
for i in range(n):
    s[i] = sorted(s[i])
s.sort()
result = 0
count = 1
for i in range(n-1):
    if s[i] == s[i+1]:
        count += 1
    else:
        result += (count*(count-1))//2
        count = 1
result += count*(count-1)//2
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [input() for i in range(n)]
for i in range(n):
    s[i] = sorted(s[i])
count = 0
l = [s[0]]
for i in range(1,n):
    exis = False
    for j in range(len(l)):
        if s[i] == l[j]:
            count += 1
    l.append(s[i])
print(count)

Fixed submission:
n = int(input())
s = [input() for i in range(n)]
for i in range(n):
    s[i] = sorted(s[i])
s.sort()
result = 0
count = 1
for i in range(n-1):
    if s[i] == s[i+1]:
        count += 1
    else:
        result += (count*(count-1))//2
        count = 1
result += count*(count-1)//2
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
'''
Created on 2019/08/11

@author: remuo402
'''
n,m = map(int,input().split())
jobs = [[] for i in range(100001)]
for i in range(n):
    a1,b1 = map(int,input().split())
    jobs[a1 - 1].append(b1)
result = 0
for i in range(m):
    jobs_1 = 0
    jobs_2 = 0
    reward = 0
    for j in range(i+1):
        if len(jobs[j]) != 0:
            reward = max(reward,max(jobs[j]))
            jobs_1 = j
            jobs_2 = jobs[j].index(max(jobs[j]))
    if reward != 0:
        result += reward
        del jobs[jobs_1][jobs_2]
print(result)

Fixed submission:
from heapq import heappush, heappop
n,m = map(int,input().split())
jobs = [[] for i in range(100001)]
for i in range(n):
    a1,b1 = map(int,input().split())
    jobs[a1].append(b1)

reward = 0
heapsort = []
for daysLeft in range(1,m+1):
    if len(jobs[daysLeft]) != 0:
        for i in jobs[daysLeft]:
            heappush(heapsort,-i)
    if len(heapsort) > 0:
        reward += -heappop(heapsort)
print(reward)

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
jobs = [[] for i in range(100001)]
for i in range(n):
    a1,b1 = map(int,input().split())
    jobs[a1 - 1].append(b1)
result = 0
for i in range(m):
    jobs_1 = 0
    jobs_2 = 0
    reward = 0
    for j in range(i+1):
        if len(jobs[j]) != 0:
            reward = max(reward,max(jobs[j]))
            jobs_1 = j
            jobs_2 = jobs[j].index(max(jobs[j]))
    if reward != 0:
        result += reward
        del jobs[jobs_1][jobs_2]
print(result)

Fixed submission:
from heapq import heappush, heappop
n,m = map(int,input().split())
jobs = [[] for i in range(100001)]
for i in range(n):
    a1,b1 = map(int,input().split())
    jobs[a1].append(b1)

reward = 0
heapsort = []
for daysLeft in range(1,m+1):
    if len(jobs[daysLeft]) != 0:
        for i in jobs[daysLeft]:
            heappush(heapsort,-i)
    if len(heapsort) > 0:
        reward += -heappop(heapsort)
print(reward)

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
jobs = [[] for i in range(100001)]
for i in range(n):
    a1,b1 = map(int,input().split())
    jobs[a1 - 1].append(b1)
result = 0
for i in range(m):
    jobs_1 = 0
    jobs_2 = 0
    reward = 0
    for j in range(i+1):
        if len(jobs[j]) != 0:
            reward = max(reward,max(jobs[j]))
            jobs_1 = j
            jobs_2 = jobs[j].index(max(jobs[j]))
    if reward != 0:
        result += reward
        del jobs[jobs_1][jobs_2]
print(result

Fixed submission:
from heapq import heappush, heappop
n,m = map(int,input().split())
jobs = [[] for i in range(100001)]
for i in range(n):
    a1,b1 = map(int,input().split())
    jobs[a1].append(b1)

reward = 0
heapsort = []
for daysLeft in range(1,m+1):
    if len(jobs[daysLeft]) != 0:
        for i in jobs[daysLeft]:
            heappush(heapsort,-i)
    if len(heapsort) > 0:
        reward += -heappop(heapsort)
print(reward)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for i in range(n)]
ahead = 0
back = max(a[1:])
result = [back]
for i in range(1,n-1):
    ahead = max(ahead,a[i-1])
    if back == a[i]:
        back = max(a[(i+1):])
    result.append(max(ahead,back))
ahead = max(ahead,a[n-2])
result.append(ahead)
for j in range(n):
    print(result[j])

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]
a2 = sorted(a)
ma = a2[-1]
se = a2[-2]
result = []
for i in range(n):
    if a[i] == ma:
        result.append(se)
    else:
        result.append(ma)
for j in range(n):
    print(result[j])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
d = list(map(int,input().split()))
k_max = max(d)
k_min = min(d)
result = 0
for k in range(k_min,k_max+1):
    count = 0
    for i in range(n):
        if d[i] >= k:
            count += 1
        if count > n//2:
            break
    if count == n//2:
        result += 1
print(result)

Fixed submission:
n = int(input())
d = list(map(int,input().split()))
d.sort()
l = d[n//2 -1]
r = d[n//2]
print(r - l)
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
a = [int(input()) for i in range(m)]

mod = 1000000007
result = [0]*(n+1)
result[0] = 1
for i in range(1,n+1):
    if i in a:
        result[i] = 0
    else:
        result[i] = (result[i-1] + result[i-2])%mod

print(result[n])

Fixed submission:
n,m = map(int,input().split())
a = set([int(input()) for i in range(m)])

mod = 1000000007
result = [0]*(n+1)
result[0] = 1
for i in range(1,n+1):
    if i in a:
        result[i] = 0
    else:
        result[i] = (result[i-1] + result[i-2])%mod

print(result[n])

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
a = [int(input()) for i in range(m)]

mod = 1000000007
result = [0]*(n+1)
result[0] = 1
for i in range(1,n+1):
    if i in a:
        result[i] = 0
    else:
        result[i] = (result[i-1] + result[i-2])%mod

print(result[n])

Fixed submission:
n,m = map(int,input().split())
a = set([int(input()) for i in range(m)])

mod = 1000000007
result = [0]*(n+1)
result[0] = 1
for i in range(1,n+1):
    if i in a:
        result[i] = 0
    else:
        result[i] = (result[i-1] + result[i-2])%mod

print(result[n])

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
a = []
for i in range(m):
    a.append(int(input()))

mod = 1000000007
result = [0]*(n+1)
result[0] = 1
for i in range(1,n+1):
    result[i] = (result[i-1] + result[i-2])%mod
    if i in a:
        result[i] = 0

print(result[n])

Fixed submission:
n,m = map(int,input().split())
a = set([int(input()) for i in range(m)])

mod = 1000000007
result = [0]*(n+1)
result[0] = 1
for i in range(1,n+1):
    if i in a:
        result[i] = 0
    else:
        result[i] = (result[i-1] + result[i-2])%mod

print(result[n])
Buggy python submission (verdict: Time Limit Exceeded):
n,q = map(int,input().split())
s = input()
l = []
r = []
for i in range(q):
    li,ri = map(int,input().split())
    l.append(li)
    r.append(ri)
  
al = [0]*n  
for i in range(n-1):
    if s[i] == "A" and s[i+1] == "C":
        al[i] = 1
        
for j in range(q):
    left = l[j]
    right = r[j]
    print(sum(al[left-1:right-1]))

Fixed submission:
n,q = map(int,input().split())
s = input()
l = []
r = []
for i in range(q):
    li,ri = map(int,input().split())
    l.append(li)
    r.append(ri)
  
al = [0]*n
for i in range(1,n):
    if s[i-1] == "A" and s[i] == "C":
        al[i] = al[i-1] + 1
    else:
        al[i] = al[i-1]
        
for j in range(q):
    left = l[j]-1
    right = r[j]-1
    print(al[right]-al[left])

Buggy python submission (verdict: Time Limit Exceeded):
n,q = map(int,input().split())
s = input()
l = []
r = []
for i in range(q):
    li,ri = map(int,input().split())
    l.append(li)
    r.append(ri)
    
for i in range(q):
    print(s.count("AC",l[i]-1,r[i]))

Fixed submission:
n,q = map(int,input().split())
s = input()
l = []
r = []
for i in range(q):
    li,ri = map(int,input().split())
    l.append(li)
    r.append(ri)
  
al = [0]*n
for i in range(1,n):
    if s[i-1] == "A" and s[i] == "C":
        al[i] = al[i-1] + 1
    else:
        al[i] = al[i-1]
        
for j in range(q):
    left = l[j]-1
    right = r[j]-1
    print(al[right]-al[left])
Buggy python submission (verdict: Runtime Error):
n = int(input())
a, b = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
for i in range(n):
    if p[i] > a:
        key1 = i-1
        break
for i in range(key1+1,n):
    if p[i] > b:
        key2 = i-1
        break
print(min(key1+1,key2-key1,len(p)-1-key2))

Fixed submission:
n = int(input())
a, b = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
key1 = 0
key2 = n-1
for i in range(n):
    if p[i] > a:
        key1 = i-1
        break
for i in range(key1+1,n):
    if p[i] > b:
        key2 = i-1
        break
print(min(key1+1,key2-key1,len(p)-1-key2))
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n < 105:
    print(0)
elif n >= 105 and n < 165:
    print(1)
elif 10n >= 165 and n < 195:
    print(2)
else:
    print(3)

Fixed submission:
n = int(input())
result = 0
l = list(range(1,n+1,2))
for i in l:
    s = 1
    for j in range(1,i,2):
        if i % j == 0:
            s += 1
    if s == 8:
        result += 1
print(result)

Buggy python submission (verdict: Runtime Error):
n = int(input())
if n < 105:
    print(0)
elif n >= 105 and n < 165:
    print(1)
elif 10n >= 165 and n < 195:
    print(2)
else:
    print(3)

Fixed submission:
n = int(input())
result = 0
l = list(range(1,n+1,2))
for i in l:
    s = 1
    for j in range(1,i,2):
        if i % j == 0:
            s += 1
    if s == 8:
        result += 1
print(result)
Buggy python submission (verdict: Runtime Error):
from astropy.units import count
n = int(input())
a = list(map(int,input().split()))
a.sort()
v = a[0]
count = 1
result = 0
for i in range(1,n):
    if v == a[i]:
        count += 1
    else:
        if v == count:
            v = a[i]
            count = 1
        else:
            if count > v:
                result += count -v
                v = a[i]
                count = 1
            else:
                result += count
                v = a[i]
                count = 1
if v != count:
    if count > v:
        result += count -v
    else:
        result += count
print(result)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a.sort()
v = a[0]
count = 1
result = 0
for i in range(1,n):
    if v == a[i]:
        count += 1
    else:
        if v == count:
            v = a[i]
            count = 1
        else:
            if count > v:
                result += count -v
                v = a[i]
                count = 1
            else:
                result += count
                v = a[i]
                count = 1
if v != count:
    if count > v:
        result += count -v
    else:
        result += count
print(result)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
ig a + b + c >= 22:
  print("bust")
else:
  print("win")

Fixed submission:
a, b, c = map(int, input().split())
if a + b + c >= 22:
  print("bust")
else:
  print("win")
Buggy python submission (verdict: Time Limit Exceeded):
MOD = 10**9 + 7
N = int(input())
A = list(map(int, input().split()))

ans = 0
m = 1
for i in range(60):
    bits = sum(((a >> i) & 1 for a in A))
    ans += (bits * (N - bits) * m)
    ans %= MOD
    m <<= 1
print(ans % MOD)


Fixed submission:
MOD = 10**9 + 7
N = int(input())
A = list(map(int, input().split()))

ans = 0
m = 1
for i in range(60):
    bits = sum((a & m for a in A))
    bits //= m
    ans += (bits * (N - bits) * m)
    ans %= MOD
    m <<= 1
print(ans % MOD)

Buggy python submission (verdict: Time Limit Exceeded):
MOD = 10**9 + 7
N = int(input())
A = list(map(int, input().split()))

ans = 0
for i in range(N - 1):
    for j in range(i + 1, N):
        ans += A[i] ^ A[j]
        ans %= MOD
print(ans)


Fixed submission:
MOD = 10**9 + 7
N = int(input())
A = list(map(int, input().split()))

ans = 0
m = 1
for i in range(60):
    bits = sum((a & m for a in A))
    bits //= m
    ans += (bits * (N - bits) * m)
    ans %= MOD
    m <<= 1
print(ans % MOD)
Buggy python submission (verdict: Runtime Error):
XMAX = 10**5
X = int(input())
dp = [False] * XMAX
dp[0] = True

for i in range(0, X + 1):
    for p in range(100, 106):
        if i - p >= 0 and dp[i - p]:
            dp[i] = True
            next
if dp[X]:
    print(1)
else:
    print(0)

Fixed submission:
X = int(input())
for i in range(1, X + 1):
    if X >= 100 * i and X <= 105 * i:
        print(1)
        exit()
print(0)