Datasets:

problem_id
stringlengths
6
6
buggy_code
stringlengths
8
526k
fixed_code
stringlengths
12
526k
labels
listlengths
0
15
⌀
buggy_submission_id
int64
1
1.54M
fixed_submission_id
int64
2
1.54M
user_id
stringlengths
10
10
language
stringclasses
8 values
p02677
abhm=tuple(map(float, input().split())) a=abhm[0] b=abhm[1] h=abhm[2] m=abhm[3] import math as mt pi=mt.pi print(pi) c=pi*(h+m/60)/6 d=pi*m/30 print(mt.sqrt((a*mt.cos(c)-b*mt.cos(d))**2+(a*mt.sin(c)-b*mt.sin(d))**2))
abhm=tuple(map(float, input().split())) a=abhm[0] b=abhm[1] h=abhm[2] m=abhm[3] import math as mt pi=mt.pi c=pi*(h+m/60)/6 d=pi*m/30 print(mt.sqrt((a*mt.cos(c)-b*mt.cos(d))**2+(a*mt.sin(c)-b*mt.sin(d))**2))
[ "call.remove" ]
399,726
399,727
u336968242
python
p02677
abhm=tuple(map(int, input().split())) a=abhm[0] b=abhm[1] h=abhm[2] m=abhm[3] import math as mt pi=mt.pi print(pi) c=pi*(h+m/60)/6 d=pi*m/30 print(mt.sqrt((a*mt.cos(c)-b*mt.cos(d))**2+(a*mt.sin(c)-b*mt.sin(d))**2))
abhm=tuple(map(float, input().split())) a=abhm[0] b=abhm[1] h=abhm[2] m=abhm[3] import math as mt pi=mt.pi c=pi*(h+m/60)/6 d=pi*m/30 print(mt.sqrt((a*mt.cos(c)-b*mt.cos(d))**2+(a*mt.sin(c)-b*mt.sin(d))**2))
[ "assignment.value.change", "identifier.change", "call.arguments.change", "call.remove" ]
399,728
399,727
u336968242
python
p02677
a,b,h,m = map(int,input().split()) import math t =abs(30*h + 0.5*m - 6*m) angle = min(t, 360-t) l = a**2 + b** 2 -2*a*b*math.cos(angle*3.1415/180) print(l**0.5)
a,b,h,m = map(int,input().split()) import math t =abs(30*h + 0.5*m - 6*m) angle = min(t, 360-t) l = a**2 + b** 2 -2*a*b*math.cos(angle*3.14159265358979323846/180) print(l**0.5)
[ "literal.number.float.change", "assignment.value.change", "call.arguments.change", "expression.operation.binary.change" ]
399,729
399,730
u252828980
python
p02677
from math import cos,pi a,b,h,m = map(int, input().split()) deg = abs((h*60 + m)/2.0 - m*6) deg = min(deg, 360-deg) print(deg) print((a**2+b**2-2*a*b*cos(deg/180 * pi))**0.5)
from math import cos,pi a,b,h,m = map(int, input().split()) deg = abs((h*60 + m)/2.0 - m*6) deg = min(deg, 360-deg) print((a**2+b**2-2*a*b*cos(deg/180 * pi))**0.5)
[ "call.remove" ]
399,737
399,738
u699295339
python
p02677
# Code for C - : (Colon) # Use input() to fetch data from STDIN import math [a, b, h, m] = map(int, input().split()) ht = 360 * h / 12 + 360 * m / 60 / 12 mt = 360 * m / 60 t = abs(ht - mt) if abs(ht - mt) <= 180 else abs(ht - mt) - 180 print(math.sqrt(a * a + b * b - 2 * a * b * math.cos(math.radians(t))))
# Code for C - : (Colon) # Use input() to fetch data from STDIN import math [a, b, h, m] = map(int, input().split()) ht = 360 * h / 12 + 360 * m / 60 / 12 mt = 360 * m / 60 t = abs(ht - mt) if abs(ht - mt) <= 180 else 360 - abs(ht - mt) print(math.sqrt(a * a + b * b - 2 * a * b * math.cos(math.radians(t))))
[ "expression.operation.binary.remove" ]
399,741
399,742
u638629468
python
p02677
# Code for C - : (Colon) # Use input() to fetch data from STDIN import math [a, b, h, m] = map(int, input().split()) ht = 360 * h / 12 + 360 * m / 60 / 12 mt = 360 * m / 60 t = abs(ht - mt) if abs(ht - mt) < 180 else abs(ht - mt) - 180 print(math.sqrt(a * a + b * b - 2 * a * b * math.cos(math.radians(t))))
# Code for C - : (Colon) # Use input() to fetch data from STDIN import math [a, b, h, m] = map(int, input().split()) ht = 360 * h / 12 + 360 * m / 60 / 12 mt = 360 * m / 60 t = abs(ht - mt) if abs(ht - mt) <= 180 else 360 - abs(ht - mt) print(math.sqrt(a * a + b * b - 2 * a * b * math.cos(math.radians(t))))
[ "expression.operator.compare.change", "assignment.value.change", "expression.operation.binary.remove" ]
399,743
399,742
u638629468
python
p02677
import numpy as np def main(): A, B, H, M = map(int, input().split()) omega_m = 1.0/60.0 omega_h = 1.0/12.0 a = (H + M/60.0) * omega_h b = (60.0*H + M) * omega_m theta = (a - b) * 360.0 c = np.sqrt(A**2 + B**2 - 2.0*A*B*np.abs(np.cos(theta/180.0*np.pi))) print(c) if __name__ == '__main__...
import numpy as np def main(): A, B, H, M = map(int, input().split()) omega_m = 1.0/60.0 omega_h = 1.0/12.0 a = (H + M/60.0) * omega_h b = (60.0*H + M) * omega_m theta = (a - b) * 360.0 c = np.sqrt(A**2 + B**2 - 2.0*A*B*np.cos(theta/180.0*np.pi)) print(c) if __name__ == '__main__': m...
[ "call.remove", "call.arguments.change" ]
399,744
399,745
u894265012
python
p02677
import math a,b,h,m=map(int,input().split()) s=math.radians((60*h+m)/2) l=math.radians(6*m) d2=(a*math.sin(s)-b*math.sin(l))**2+(a*math.cos(s)-b*math.cos(l))**2 print(d2) d=math.sqrt(d2) print(d)
import math a,b,h,m=map(int,input().split()) s=math.radians((60*h+m)/2) l=math.radians(6*m) d2=(a*math.sin(s)-b*math.sin(l))**2+(a*math.cos(s)-b*math.cos(l))**2 d=math.sqrt(d2) print(d)
[ "call.remove" ]
399,751
399,752
u919235786
python
p02677
from math import radians, cos A, B, H, M = map(int, input().split()) angle_h = (H + M/60) * 30 angle_m = M * 60 theta = min(abs(angle_h-angle_m), 360 - abs(angle_h-angle_m)) r2 = A**2 + B**2 - 2*A*B*cos(radians(theta)) print(r2**(1/2))
from math import radians, cos A, B, H, M = map(int, input().split()) angle_h = (H + M/60) * 30 angle_m = M * 6 theta = min(abs(angle_h-angle_m), 360 - abs(angle_h-angle_m)) r2 = A**2 + B**2 - 2*A*B*cos(radians(theta)) print(r2**(1/2))
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
399,753
399,754
u224346910
python
p02677
# C a, b, h, m = map(int, input().split()) import math short = 30 * h long = 6 * m short = 30 * h + m*30/60 print(short, long) ans = (a**2 + b**2 - 2*a*b*math.cos(math.radians(abs(short-long))))**(1/2) print(ans)
# C a, b, h, m = map(int, input().split()) import math short = 30 * h long = 6 * m short = 30 * h + m*30/60 ans = (a**2 + b**2 - 2*a*b*math.cos(math.radians(abs(short-long))))**(1/2) print(ans)
[ "call.remove" ]
399,761
399,762
u721425712
python
p02677
A,B,H,M=map(int,input().split()) from math import cos p=3.14159265358979323846264338328 ho=H*p/6+M*p/360 mi=M*p/30 t=ho-mi print(ho,mi) x=(A*A+B*B-2*A*B*cos(t))**0.5 print(x)
A,B,H,M=map(int,input().split()) from math import cos p=3.14159265358979323846264338328 ho=H*p/6+M*p/360 mi=M*p/30 t=ho-mi x=(A*A+B*B-2*A*B*cos(t))**0.5 print(x)
[ "call.remove" ]
399,763
399,764
u798675549
python
p02677
import math A,B,H,M = map(int,input().split()) theta_h=2*math.pi*H/12 theta_m=2*math.pi*M/60 vh=[A*math.cos(theta_h), A*math.sin(theta_h)] vm=[B*math.cos(theta_m), B*math.sin(theta_m)] print(math.sqrt((vh[0]-vm[0])**2+(vh[1]-vm[1])**2))
import math A,B,H,M = map(int,input().split()) theta_h=2*math.pi*(H+M/60)/12 theta_m=2*math.pi*M/60 vh=[A*math.cos(theta_h), A*math.sin(theta_h)] vm=[B*math.cos(theta_m), B*math.sin(theta_m)] print(math.sqrt((vh[0]-vm[0])**2+(vh[1]-vm[1])**2))
[]
399,776
399,777
u117541450
python
p02677
# -*- coding:utf-8 -*- def solve(): import sys import math A, B, H, M = list(map(int, sys.stdin.readline().split())) h_speed = 360 / (12*60) m_speed = 360 / 60 m = H*60 + M h_angle = h_speed * m m_angle = m_speed * m % 360 angle = abs(h_angle - m_angle) if abs(h_angle-m_angle) <...
# -*- coding:utf-8 -*- def solve(): import sys import math A, B, H, M = list(map(int, sys.stdin.readline().split())) h_speed = 360 / (12*60) m_speed = 360 / 60 m = H*60 + M h_angle = h_speed * m m_angle = m_speed * m % 360 angle = abs(h_angle - m_angle) if abs(h_angle-m_angle) <...
[ "expression.operation.binary.remove" ]
399,780
399,781
u687044304
python
p02677
import math a,b,h,m = map(int,input().split()) u = 360 * h / 12 + 30 * m / 60 v = 360 * m / 60 z = abs(u - v) if z > 180: z = z - 180 c = a**2 + b**2 - 2*a*b*math.cos(math.radians(z)) print(math.sqrt(c))
import math a,b,h,m = map(int,input().split()) u = 360 * h / 12 + 30 * m / 60 v = 360 * m / 60 z = abs(u - v) if z > 180: z = 360 - z c = a**2 + b**2 - 2*a*b*math.cos(math.radians(z)) print(math.sqrt(c))
[ "expression.operation.binary.remove" ]
399,787
399,788
u788703383
python
p02677
import math a, b, h, m = map(int, input().split()) c = math.pi*(h+m/60)/6 d = math.pi*m/30 e = min(abs(c-d), math.pi-abs(c-d)) print(math.sqrt(a**2+b**2-2*a*b*math.cos(e)))
import math a, b, h, m = map(int, input().split()) c = math.pi*(h+m/60)/6 d = math.pi*m/30 e = min(abs(c-d), 2*math.pi-abs(c-d)) print(math.sqrt(a**2+b**2-2*a*b*math.cos(e)))
[ "assignment.change" ]
399,789
399,790
u785573018
python
p02677
import bisect import copy import heapq import sys import itertools import math import queue input = sys.stdin.readline sys.setrecursionlimit(1000000) # mod = 10 ** 9 + 7 def read_values(): return map(int, input().split()) def read_index(): return map(lambda x: int(x) - 1, input().split()) def read_list(): return list(...
import bisect import copy import heapq import sys import itertools import math import queue input = sys.stdin.readline sys.setrecursionlimit(1000000) # mod = 10 ** 9 + 7 def read_values(): return map(int, input().split()) def read_index(): return map(lambda x: int(x) - 1, input().split()) def read_list(): return list(...
[ "expression.operation.binary.remove" ]
399,791
399,792
u067983636
python
p02677
import math a,b,h,m=map(int,input().split()) mangle=m*6 hangle=30*h+0.5*m angle=min(abs(hangle-mangle), 360-abs(hangle-mangle)) print(angle) length=math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(angle))) print(length)
import math a,b,h,m=map(int,input().split()) mangle=m*6 hangle=30*h+0.5*m angle=min(abs(hangle-mangle), 360-abs(hangle-mangle)) length=math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(angle))) print(length)
[ "call.remove" ]
399,793
399,794
u383450070
python
p02677
a,b,h,m = map(int,input().split()) long = m * 60 small = h * 30 + m * 0.5 kakudo = min(abs(long - small), 360-abs(small-long)) import math ans = (a ** 2 + b ** 2 - 2 * a * b * math.cos(math.radians(kakudo))) ** (1/2) print(ans)
a,b,h,m = map(int,input().split()) long = m * 6 small = h * 30 + m * 0.5 kakudo = min(abs(long - small), 360-abs(small-long)) import math ans = (a ** 2 + b ** 2 - 2 * a * b * math.cos(math.radians(kakudo))) ** (1/2) print(ans)
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
399,799
399,800
u683134447
python
p02677
from math import * A,B,h,m = map(int,input().split()) if h>11:h-=12 s=l=.0 l=m*6 s=30*(h+(m/60)) if l<s:l,s=s,l if l-s>180:d=360-l+s else:d=l-s c = cos(radians(d)) ans = sqrt(A**2+B**2-2*c) print(ans)
from math import * A,B,h,m = map(int,input().split()) if h>11:h-=12 s=l=.0 l=m*6 s=30*(h+(m/60)) if l<s:l,s=s,l if l-s>180:d=360-l+s else:d=l-s c = cos(radians(d)) ans = sqrt(A**2+B**2-2*A*B*c) print(ans)
[ "assignment.change" ]
399,811
399,812
u442877951
python
p02677
import math a,b,h,m = list(map(int,input().split())) h = h % 12 theta = m*6 - h*30 arc = a** 2 + b**2 - 2*a*b*math.cos(math.radians(theta)) print(arc**0.5)
import math a,b,h,m = list(map(int,input().split())) h = h % 12 theta = m*5.5 - h*30 arc = a** 2 + b**2 - 2*a*b*math.cos(math.radians(theta)) print(arc**0.5)
[ "assignment.value.change", "expression.operation.binary.change" ]
399,830
399,831
u078181689
python
p02677
import math A,B,H,M = map(int,input().split()) print(math.sqrt(A**2 + B**2 - 2*A*B*abs(math.cos((H/12.+M/720.)*2*math.pi - M/60.*2*math.pi))))
import math A,B,H,M = map(int,input().split()) print(math.sqrt(A**2 + B**2 - 2*A*B*math.cos(abs((H/12.+M/720.)*2*math.pi - M/60.*2*math.pi))))
[ "call.remove", "call.arguments.add" ]
399,832
399,833
u763968347
python
p02677
A, B, H, M = map(int,input().split()) theta_M = M*6 theta_H = H*30 + M*0.5 theta = abs(theta_M - theta_H) if theta > 180: theta = 360 - theta import math x = A**2 + B**2 - 2 * 3 * 4 * math.cos(math.radians(theta)) x = math.sqrt(x) print(x)
A, B, H, M = map(int,input().split()) theta_M = M*6 theta_H = H*30 + M*0.5 theta = abs(theta_M - theta_H) if theta > 180: theta = 360 - theta import math x = A**2 + B**2 - 2 * A * B * math.cos(math.radians(theta)) x = math.sqrt(x) print(x)
[ "assignment.value.change", "identifier.replace.add", "literal.replace.remove", "expression.operation.binary.change" ]
399,836
399,837
u100277898
python
p02677
#!/usr/bin/env python3 import sys input = sys.stdin.readline import math a, b, h, m = map(int, input().split()) deg_h = (h * 120 + m * 2) % 1440 deg_m = (m * 240) % 1440 diff = (deg_h - deg_m) % 1440 if deg_h >= deg_m: diff = deg_h - deg_m else: diff = deg_m - deg_h if 1440 - diff < diff: diff = 1440 - dif...
#!/usr/bin/env python3 import sys input = sys.stdin.readline import math a, b, h, m = map(int, input().split()) deg_h = (h * 120 + m * 2) % 1440 deg_m = (m * 24) % 1440 diff = (deg_h - deg_m) % 1440 if deg_h >= deg_m: diff = deg_h - deg_m else: diff = deg_m - deg_h if 1440 - diff < diff: diff = 1440 - diff...
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
399,838
399,839
u052499405
python
p02677
import math a,b,h,m=map(int,input().split()) t1=math.radians(30*h+0.5*m) t2=math.radians(60*m) x1,y1=a*math.cos(t1),a*math.sin(t1) x2,y2=b*math.cos(t2),b*math.sin(t2) ans=math.sqrt((x2-x1)**2+(y2-y1)**2) print(ans)
import math a,b,h,m=map(int,input().split()) t1=math.radians(30*h+0.5*m) t2=math.radians(6*m) x1,y1=a*math.cos(t1),a*math.sin(t1) x2,y2=b*math.cos(t2),b*math.sin(t2) ans=math.sqrt((x2-x1)**2+(y2-y1)**2) print(ans)
[ "literal.number.integer.change", "assignment.value.change", "call.arguments.change", "expression.operation.binary.change" ]
399,840
399,841
u217627525
python
p02677
import math import numpy as np A,B,H,M = (int(x) for x in input().split()) minit = M + H * 60 long_r = 360*minit/(60*24) short_r = 6*M Ax = A*math.cos(math.radians(long_r)) Ay = A*math.sin(math.radians(long_r)) Bx = B*math.cos(math.radians(short_r)) By = B*math.sin(math.radians(short_r)) d = np.sqrt((Ax-Bx)**2+(Ay-...
import math import numpy as np A,B,H,M = (int(x) for x in input().split()) minit = M + H * 60 long_r = 360*minit/(60*12) short_r = 6*M Ax = A*math.cos(math.radians(long_r)) Ay = A*math.sin(math.radians(long_r)) Bx = B*math.cos(math.radians(short_r)) By = B*math.sin(math.radians(short_r)) d = np.sqrt((Ax-Bx)**2+(Ay-...
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
399,852
399,853
u295585689
python
p02677
import collections from collections import defaultdict import math import numpy as np import re import itertools import bisect a,b,h,m=map(int, input().split()) l = 6*m s = 0.5*m+30*h kakudo = min(abs(l-s),360-abs(l-s)) print(kakudo) print(math.sqrt(a*a+b*b-2*b*a*math.cos(math.radians(kakudo))))
import collections from collections import defaultdict import math import numpy as np import re import itertools import bisect a,b,h,m=map(int, input().split()) l = 6*m s = 0.5*m+30*h kakudo = min(abs(l-s),360-abs(l-s)) print(math.sqrt(a*a+b*b-2*b*a*math.cos(math.radians(kakudo))))
[ "call.remove" ]
399,854
399,855
u300579805
python
p02677
from math import pi, cos, sqrt a, b, h, m = map(int, input().split()) short = pi * (h * 60 + m) / 360 long = pi * m / 60 print(sqrt(a*a + b*b - 2*a*b*cos(short - long)))
from math import pi, cos, sqrt a, b, h, m = map(int, input().split()) short = pi * (h * 60 + m) / 360 long = pi * m / 30 print(sqrt(a*a + b*b - 2*a*b*cos(short - long)))
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
399,860
399,861
u686230543
python
p02677
a,b,h,m = map(int,input().split()) h_angle= h*30+m*0.5 m_angle= m*60 from math import * print(sqrt(a*a+b*b-2*a*b*cos(radians(abs(h_angle-m_angle)))))
a,b,h,m = map(int,input().split()) h_angle= h*30+m*0.5 m_angle= m*6 from math import * print(sqrt(a*a+b*b-2*a*b*cos(radians(abs(h_angle-m_angle)))))
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
399,862
399,863
u400221789
python
p02677
A,B,H,M=map(int, input().split()) import math m=M/60*math.pi*2 h=H/12*math.pi*2+m/12 print(h,m) if m>=h: alpha=m-h else: alpha=h-m ans=pow(B,2)+pow(A,2)-2*B*A*math.cos(alpha) print(math.sqrt(ans))
A,B,H,M=map(int, input().split()) import math m=M/60*math.pi*2 h=H/12*math.pi*2+m/12 if m>=h: alpha=m-h else: alpha=h-m ans=pow(B,2)+pow(A,2)-2*B*A*math.cos(alpha) print(math.sqrt(ans))
[ "call.remove" ]
399,864
399,865
u841599623
python
p02677
import bisect,collections,copy,heapq,itertools,math,numpy,string import sys def S(): return sys.stdin.readline().rstrip() def I(): return int(sys.stdin.readline().rstrip()) def SS(): return map(str,sys.stdin.readline().rstrip().split()) def II(): return map(int,sys.stdin.readline().rstrip().split()) def LI(): return li...
import bisect,collections,copy,heapq,itertools,math,numpy,string import sys def S(): return sys.stdin.readline().rstrip() def I(): return int(sys.stdin.readline().rstrip()) def SS(): return map(str,sys.stdin.readline().rstrip().split()) def II(): return map(int,sys.stdin.readline().rstrip().split()) def LI(): return li...
[ "call.remove" ]
399,868
399,869
u555688810
python
p02677
import math A, B, H, M = map(int,input().split()) longdeg = (2 * math.pi) / 12 * (H + M/60) shortdeg = (2 * math.pi) * M / 60 deg = abs(longdeg - shortdeg) if deg > math.pi: deg -= math.pi print(math.sqrt(A**2 + B**2 - 2*A*B*math.cos(deg)))
import math A, B, H, M = map(int,input().split()) longdeg = (2 * math.pi) / 12 * (H + M/60) shortdeg = (2 * math.pi) * M / 60 deg = abs(longdeg - shortdeg) if deg > math.pi: deg = 2 * math.pi - deg print(math.sqrt(A**2 + B**2 - 2*A*B*math.cos(deg)))
[ "assignment.value.change" ]
399,870
399,871
u057942294
python
p02677
import math A, B, H, M = map(int, input().split()) a = math.pi*2/(12*60) m = math.pi*2/360 angle_M = M * m angle_H = (H * 60 + M) * a angle = math.fabs(angle_M - angle_H) length = math.sqrt(A*A + B * B - 2 * A * B * math.cos(angle)) print(length)
import math A, B, H, M = map(int, input().split()) h = math.pi*2/(12*60) m = math.pi*2/60 angle_M = M * m angle_H = (H * 60 + M) * h angle = math.fabs(angle_M - angle_H) length = math.sqrt(A * A + B * B - 2 * A * B * math.cos(angle)) print(length)
[ "assignment.variable.change", "identifier.change", "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
399,872
399,873
u870576013
python
p02677
import math # K = int(input()) A, B, H, M = [int(_) for _ in input().split()] a_rad = ((H * 60 + M) / 720) * 2 * math.pi b_rad = (M / 360) * 2 * math.pi a_x = A * math.cos(a_rad) a_y = A * math.sin(a_rad) b_x = B * math.cos(b_rad) b_y = B * math.sin(b_rad) print(math.sqrt((a_x-b_x)**2 + (a_y - b_y)**2))
import math # K = int(input()) A, B, H, M = [int(_) for _ in input().split()] a_rad = ((H * 60 + M) / 720) * 2 * math.pi b_rad = (M / 60) * 2 * math.pi a_x = A * math.cos(a_rad) a_y = A * math.sin(a_rad) b_x = B * math.cos(b_rad) b_y = B * math.sin(b_rad) print(math.sqrt((a_x-b_x)**2 + (a_y - b_y)**2))
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
399,881
399,882
u504562455
python
p02677
import math A,B,H,M = map(float,input().split()) X = sqrt(A**2+B**2-2*A*B*math.cos(math.radians(5.5*M-30*H))) print(X)
import math A,B,H,M = map(float,input().split()) X = math.sqrt(A**2+B**2-2*A*B*math.cos(math.radians(5.5*M-30*H))) print(X)
[]
399,883
399,884
u042113240
python
p02677
import math a, b, h, m = map(int, input().split()) l = 60*m s = 30*h + m/2 cos = math.cos(math.radians(l-s)) ans = a**2 + b**2 - 2*a*b*cos print(ans**(1/2))
import math a, b, h, m = map(int, input().split()) l = 6*m s = 30*h + m/2 cos = math.cos(math.radians(l-s)) ans = a**2 + b**2 - 2*a*b*cos print(ans**(1/2))
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
399,887
399,888
u289547799
python
p02677
import math def distance(x1, y1, x2, y2): dx = x1 - x2 dy = y1 - y2 return (dx**2 + dy**2)**0.5 lh, lm, h, m = map(int, input().split()) PI = math.pi hx = math.cos(PI * 2 * (60 * h + m) / 1440) * lh hy = math.sin(PI * 2 * (60 * h + m) / 1440) * lh mx = math.cos(PI * 2 * m / 60) * lm my = math.sin(PI * 2...
import math def distance(x1, y1, x2, y2): dx = x1 - x2 dy = y1 - y2 return (dx**2 + dy**2)**0.5 lh, lm, h, m = map(int, input().split()) PI = math.pi hx = math.cos(PI * 2 * (60 * h + m) / 720) * lh hy = math.sin(PI * 2 * (60 * h + m) / 720) * lh mx = math.cos(PI * 2 * m / 60) * lm my = math.sin(PI * 2 *...
[ "literal.number.integer.change", "assignment.value.change", "call.arguments.change", "expression.operation.binary.change" ]
399,895
399,896
u299869545
python
p02677
import math def distance(x1, y1, x2, y2): dx = x1 - x2 dy = y1 - y2 return (dx**2 + dy**2)**0.5 lh, lm, h, m = map(int, input().split()) PI = 3.1415926536897932384626433 hx = math.cos(PI * 2 * (60 * h + m) / 1440) * lh hy = math.sin(PI * 2 * (60 * h + m) / 1440) * lh mx = math.cos(PI * 2 * m / 60) * lm ...
import math def distance(x1, y1, x2, y2): dx = x1 - x2 dy = y1 - y2 return (dx**2 + dy**2)**0.5 lh, lm, h, m = map(int, input().split()) PI = math.pi hx = math.cos(PI * 2 * (60 * h + m) / 720) * lh hy = math.sin(PI * 2 * (60 * h + m) / 720) * lh mx = math.cos(PI * 2 * m / 60) * lm my = math.sin(PI * 2 *...
[ "assignment.value.change", "identifier.replace.add", "literal.replace.remove", "literal.number.integer.change", "call.arguments.change", "expression.operation.binary.change" ]
399,897
399,896
u299869545
python
p02677
#! env/bin/local python3 # -*- coding:utf-8 -*- # -- submit ---- import numpy as np a, b, h, m = map(float, input().split()) theta = np.abs(h * 30. + 0.5 * m - m * 6.) / 180 * np.pi print(theta) print(np.sqrt(a ** 2. + b ** 2. - 2 * a * b * np.cos(theta)))
#! env/bin/local python3 # -*- coding:utf-8 -*- # -- submit ---- import numpy as np a, b, h, m = map(float, input().split()) theta = np.abs(h * 30. + 0.5 * m - m * 6.) / 180 * np.pi print(np.sqrt(a ** 2. + b ** 2. - 2 * a * b * np.cos(theta)))
[ "call.remove" ]
399,898
399,899
u018771977
python
p02677
import math A,B,H,M = map(int,input().split()) H = ((H%12 + M/60)/12- M/60 ) * 2 * math.pi ans = math.sqrt(A**2 + B**2 - 2*A*B*math.cos(H)) print(H) print(ans)
import math A,B,H,M = map(int,input().split()) H = ((H%12 + M/60)/12- M/60 ) * 2 * math.pi ans = math.sqrt(A**2 + B**2 - 2*A*B*math.cos(H)) print(ans)
[ "call.remove" ]
399,905
399,906
u203382704
python
p02677
a,b,h,m = map(int, input().split()) import math x=2*math.pi * m / 60 y=(2*math.pi * h / 12) + (x/12) csq = a**2 + b**2 - 2*a*b*abs(math.cos(x-y)) print(math.sqrt(csq))
a,b,h,m = map(int, input().split()) import math x=2*math.pi * m / 60 y=(2*math.pi * h / 12) + (x/12) csq = a**2 + b**2 - 2*a*b*math.cos(abs(x-y)) print(math.sqrt(csq))
[ "call.remove", "call.arguments.add" ]
399,907
399,908
u358254559
python
p02677
def abc168_c(): A, B, H, M = map(int, input().split()) # 時針の位相 h_angle = 30 * H + 0.5 * M # 分針の位相 m_angle = 6 * M # x方向 x_dist = A * math.cos(math.radians(h_angle)) - B * math.cos(math.radians(m_angle)) # y方向 y_dist = A * math.sin(math.radians(h_angle)) - B * math.sin(math.radians(m_...
import math def abc168_c(): A, B, H, M = map(int, input().split()) # 時針の位相 h_angle = 30 * H + 0.5 * M # 分針の位相 m_angle = 6 * M # x方向 x_dist = A * math.cos(math.radians(h_angle)) - B * math.cos(math.radians(m_angle)) # y方向 y_dist = A * math.sin(math.radians(h_angle)) - B * math.sin(ma...
[]
399,915
399,916
u426764965
python
p02677
def resolve(): import math a, b, h, m = map(int, input().split()) ms = m*6 hs = h*30+m*0.5 theta = abs(hs-ms) if theta >= 180: theta -= 180 ans = a**2 + b**2 - 2*a*b*math.cos(math.radians(theta)) ans = ans** 0.5 print(ans) resolve()
def resolve(): import math a, b, h, m = map(int, input().split()) ms = m*6 hs = h*30+m*0.5 theta = abs(hs-ms) if theta >= 180: theta = 360-theta ans = a**2 + b**2 - 2*a*b*math.cos(math.radians(theta)) ans = ans** 0.5 print(ans) resolve()
[ "assignment.add" ]
399,917
399,918
u793868662
python
p02677
import sys sys.setrecursionlimit(10 ** 7) input = sys.stdin.readline import numpy as np a,b,h,m = map(int, input().split()) mrad = 2*np.pi/60*m hrad = 2*np.pi/12*h + 2*np.pi/12/60*m drad = min(abs(hrad - mrad), np.pi-abs(hrad-mrad) ) tmp = a**2+b**2 - 2*a*b*np.cos(drad) ans = np.sqrt(tmp) print(ans)
import sys sys.setrecursionlimit(10 ** 7) input = sys.stdin.readline import numpy as np a,b,h,m = map(int, input().split()) mrad = 2*np.pi/60*m hrad = 2*np.pi/12*h + 2*np.pi/12/60*m drad = min(abs(hrad - mrad), 2*np.pi-abs(hrad-mrad) ) tmp = a**2+b**2 - 2*a*b*np.cos(drad) ans = np.sqrt(tmp) print(ans)
[ "assignment.change" ]
399,919
399,920
u952467214
python
p02677
import sys import math sys.setrecursionlimit(500005) stdin = sys.stdin ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) ns = lambda: stdin.readline().rstrip() # ignore trailing spaces a, b, h, m = na() hh = math.pi*2*(h/12+m/60/12) mm = math.pi*2*m/60 print(a, b) ax = math.cos(hh)*a ay =...
import sys import math sys.setrecursionlimit(500005) stdin = sys.stdin ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) ns = lambda: stdin.readline().rstrip() # ignore trailing spaces a, b, h, m = na() hh = math.pi*2*(h/12+m/60/12) mm = math.pi*2*m/60 # print(a, b) ax = math.cos(hh)*a ay...
[ "call.remove" ]
399,929
399,930
u119714109
python
p02677
import cmath a,b,h,m=map(int, input().split(" ")) print(abs(a*cmath.exp(j*(h+m/60)*cmath.pi/6)-b*cmath.exp(j*m*2*cmath.pi/60)))
import cmath a,b,h,m=map(int, input().split(" ")) print(abs(a*cmath.exp(1j*(h+m/60)*cmath.pi/6)-b*cmath.exp(1j*m*2*cmath.pi/60)))
[ "call.arguments.change" ]
399,931
399,932
u847923740
python
p02677
import sys import math input = sys.stdin.readline def readstr(): return input().strip() def readint(): return int(input()) def readnums(): return map(int, input().split()) def readstrs(): return input().split() def main(): A, B, H, M = readnums() d = min(0.5 * (H * 60 + M) - 6 * M, 360...
import sys import math input = sys.stdin.readline def readstr(): return input().strip() def readint(): return int(input()) def readnums(): return map(int, input().split()) def readstrs(): return input().split() def main(): A, B, H, M = readnums() d = min(0.5 * (H * 60 + M) - 6 * M, 360...
[ "call.remove" ]
399,933
399,934
u371385198
python
p02677
import math a,b,h,m=map(int,input().split()) x=(60*h+m)/720 y=m/60 rad=360*abs(x-y) rad=min(180-rad,rad) print((a**2+b**2-2*a*b*math.cos(math.radians(rad)))**0.5)
import math a,b,h,m=map(int,input().split()) x=(60*h+m)/720 y=m/60 rad=360*abs(x-y) rad=min(360-rad,rad) print((a**2+b**2-2*a*b*math.cos(math.radians(rad)))**0.5)
[ "literal.number.integer.change", "assignment.value.change", "call.arguments.change", "expression.operation.binary.change" ]
399,935
399,936
u116233709
python
p02677
from math import pi, cos, sqrt A, B, H, M = map(int, input().split()) t = H * 60 + M deg = abs(t / 2 - (t % 60) * 6) if deg > 180: deg -= 180 deg = deg * pi / 180 print(sqrt(A*A + B*B - 2*A*B*cos(deg)))
from math import pi, cos, sqrt A, B, H, M = map(int, input().split()) t = H * 60 + M deg = abs(t / 2 - (t % 60) * 6) if deg > 180: deg = 360 - deg deg = deg * pi / 180 print(sqrt(A*A + B*B - 2*A*B*cos(deg)))
[ "assignment.add" ]
399,937
399,938
u763252210
python
p02677
from math import pi, cos, sqrt A, B, H, M = map(int, input().split()) t = H * 60 + M deg = abs(t / 2 - (t % 60) * 6) if deg >= 180: deg -= 180 deg = deg * pi / 180 print(sqrt(A*A + B*B - 2*A*B*cos(deg)))
from math import pi, cos, sqrt A, B, H, M = map(int, input().split()) t = H * 60 + M deg = abs(t / 2 - (t % 60) * 6) if deg > 180: deg = 360 - deg deg = deg * pi / 180 print(sqrt(A*A + B*B - 2*A*B*cos(deg)))
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
399,939
399,938
u763252210
python
p02677
from math import pi, sqrt, cos a, b, h, m = map(int, input().split()) minutes = h * 60 + m short_angle = pi * minutes / 360 long_angle = pi * m / 30 angle = abs(short_angle - long_angle) if angle > pi: angle -= pi print(sqrt(a ** 2 + b ** 2 - 2 * a * b * cos(angle)))
from math import pi, sqrt, cos a, b, h, m = map(int, input().split()) minutes = h * 60 + m short_angle = pi * minutes / 360 long_angle = pi * m / 30 angle = abs(short_angle - long_angle) if angle > pi: angle = 2 * pi - angle print(sqrt(a ** 2 + b ** 2 - 2 * a * b * cos(angle)))
[ "assignment.add" ]
399,950
399,951
u340781749
python
p02677
import math a,b,h,m=map(int,input()) dg = (60*h+m)/2.0 - 6*m x2 = a**2+b**2-2*a*b*math.cos(math.radians(dg)) print(math.sqrt(x2))
import math a,b,h,m=map(int,input().split()) dg = (60*h+m)/2.0 - 6*m x2 = a**2+b**2-2*a*b*math.cos(math.radians(dg)) print(math.sqrt(x2))
[ "call.add" ]
399,952
399,953
u095094246
python
p02677
import math j,f,h,m=map(int,input().split()) df=6*m dh=m/2+30*h d=0 if df>dh: d=df-dh else: d=dh-df l=(j**2+f**2-2*j*f*math.cos(math.radians(d))) print(l)
import math j,f,h,m=map(int,input().split()) df=6*m dh=m/2+30*h d=0 if df>dh: d=df-dh else: d=dh-df l=(j**2+f**2-2*j*f*math.cos(math.radians(d)))**0.5 print(l)
[ "assignment.change" ]
399,954
399,955
u291988695
python
p02677
import math a,b,h,m=map(int,input().split()) angle=abs(m*6-(h*30+m/60*30)) print(math.sqrt(a*a+b*b-2*a*b*math.cos(angle/180*pi)))
import math a,b,h,m=map(int,input().split()) angle=abs(m*6-(h*30+m/60*30)) print(math.sqrt(a*a+b*b-2*a*b*math.cos(angle/180*math.pi)))
[]
399,958
399,959
u438621426
python
p02677
import math a,b,h,m=map(int,input().split()) angle=abs(m*6-(h*30+m/60*30)) print(math.sqrt(a*a+b*b-2*a*b*math.cos(angle/180*3.14159265)))
import math a,b,h,m=map(int,input().split()) angle=abs(m*6-(h*30+m/60*30)) print(math.sqrt(a*a+b*b-2*a*b*math.cos(angle/180*math.pi)))
[ "identifier.replace.add", "literal.replace.remove", "call.arguments.change", "expression.operation.binary.change" ]
399,960
399,959
u438621426
python
p02677
A, B, H, M =map(int, input().split()) Min = 60*H + M long_v = 0.5 short_v = 6 diff = 5.5*Min%360 print((A**2 + B**2 - 2*A*B*math.cos(math.radians(diff)))**0.5)
import math A, B, H, M =map(int, input().split()) Min = 60*H + M long_v = 0.5 short_v = 6 diff = 5.5*Min%360 print((A**2 + B**2 - 2*A*B*math.cos(math.radians(diff)))**0.5)
[]
399,965
399,966
u711245972
python
p02677
a, b, h, m = map(int, input().split()) import math vx = 2*math.pi/(12*60) vy = 2*math.pi/60 x = vx*(60*h+m) y = vy*m d = abs(x-y) z = a**2+b**2-2*a*b*math.cos(d) z = math.sqrt(z) print(zf)
a, b, h, m = map(int, input().split()) import math vx = 2*math.pi/(12*60) vy = 2*math.pi/60 x = vx*(60*h+m) y = vy*m d = abs(x-y) z = a**2+b**2-2*a*b*math.cos(d) z = math.sqrt(z) print(z)
[ "identifier.change", "call.arguments.change", "io.output.change" ]
399,971
399,972
u186838327
python
p02678
N,M = map(int,input().split()) A = [0]*M B = [0]*M for i in range(M): A[i],B[i] = map(int,input().split()) from collections import deque links = [[] for _ in range(N+1)] for i in range(M): links[A[i]].append(B[i]) links[B[i]].append(A[i]) print(links) result = [-1]*(N+1) q = deque([1]) while q: i...
N,M = map(int,input().split()) A = [0]*M B = [0]*M for i in range(M): A[i],B[i] = map(int,input().split()) from collections import deque links = [[] for _ in range(N+1)] for i in range(M): links[A[i]].append(B[i]) links[B[i]].append(A[i]) result = [-1]*(N+1) q = deque([1]) while q: i = q.popleft() ...
[ "call.remove" ]
400,124
400,125
u004312392
python
p02678
from collections import deque n, m = map(int, input().split()) graph = [[] for _ in range(n)] for _ in range(m): a, b = map(int, input().split()) graph[a - 1].append(b - 1) graph[b - 1].append(a - 1) print(graph) ans = [-1] * (n - 1) used = [0]*n used[0] = 1 que = deque([0]) while que: posi = que.popl...
from collections import deque n, m = map(int, input().split()) graph = [[] for _ in range(n)] for _ in range(m): a, b = map(int, input().split()) graph[a - 1].append(b - 1) graph[b - 1].append(a - 1) ans = [-1] * (n - 1) used = [0]*n used[0] = 1 que = deque([0]) while que: posi = que.popleft() for...
[ "call.remove" ]
400,132
400,133
u185325486
python
p02678
from collections import deque n, m = map(int, input().split()) graph = [[] for _ in range(m)] for _ in range(m): a, b = map(int, input().split()) graph[a - 1].append(b - 1) graph[b - 1].append(a - 1) ans = [-1] * (n - 1) q = deque() q.append(0) used = {0} while q: node = q.popleft() for next_node in g...
from collections import deque n, m = map(int, input().split()) graph = [[] for _ in range(n)] for _ in range(m): a, b = map(int, input().split()) graph[a - 1].append(b - 1) graph[b - 1].append(a - 1) ans = [-1] * (n - 1) q = deque() q.append(0) used = {0} while q: node = q.popleft() for next_node in graph...
[ "assignment.value.change", "identifier.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
400,137
400,138
u170183831
python
p02678
from collections import deque INF = 1_000_000_000 def main(): n, m = map(int, input().split(" ")) to = [[] for _ in range(n)] for _ in range(m): a, b = map(lambda i:int(i)-1, input().split(" ")) to[a].append(b) to[b].append(a) print(to) que = deque() d = {i:INF for i in r...
from collections import deque INF = 1_000_000_000 def main(): n, m = map(int, input().split(" ")) to = [[] for _ in range(n)] for _ in range(m): a, b = map(lambda i:int(i)-1, input().split(" ")) to[a].append(b) to[b].append(a) que = deque() d = {i:INF for i in range(n)} p...
[ "call.remove" ]
400,139
400,140
u872271866
python
p02678
from collections import deque n, m = map(int, input().split()) adj_list = [[] for i in range(n)] for i in range(m): _, __ = map(int, input().split()) _ -= 1 __ -= 1 adj_list[_].append(__) adj_list[__].append(_) distance = [None for i in range(n)] updated_from = [None for i in range(n)] newly_visited = d...
from collections import deque n, m = map(int, input().split()) adj_list = [[] for i in range(n)] for i in range(m): _, __ = map(int, input().split()) _ -= 1 __ -= 1 adj_list[_].append(__) adj_list[__].append(_) distance = [None for i in range(n)] updated_from = [None for i in range(n)] newly_visited = d...
[ "call.arguments.add" ]
400,145
400,146
u628262476
python
p02678
from collections import deque N, M = map(int, input().split()) net = [[] for _ in range(N+1)] vect = [0]*(N+1) for _ in range(M): A, B = map(int, input().split()) net[A].append(B) net[B].append(A) q = deque() q.append(1) while len(q)>0: t = q.popleft() for i in net[t]: if t != i and vect[i] == 0: vect[i] ...
from collections import deque print("Yes") N, M = map(int, input().split()) net = [[] for _ in range(N+1)] vect = [0]*(N+1) for _ in range(M): A, B = map(int, input().split()) net[A].append(B) net[B].append(A) q = deque() q.append(1) while len(q)>0: t = q.popleft() for i in net[t]: if t != i and vect[i] == ...
[ "call.add" ]
400,153
400,154
u573272932
python
p02678
from collections import deque n, m = map(int, input().split()) graph = [[] for _ in range(n)] for i in range(m): a, b = map(int, input().split()) a -= 1 b -= 1 graph[a].append(b) graph[b].append(a) que = deque() que.append(0) visited = [0 for _ in range(n)] visited[0] = 1 ans = [None for _ in r...
from collections import deque n, m = map(int, input().split()) graph = [[] for _ in range(n)] for i in range(m): a, b = map(int, input().split()) a -= 1 b -= 1 graph[a].append(b) graph[b].append(a) que = deque() que.append(0) visited = [0 for _ in range(n)] visited[0] = 1 ans = [None for _ in r...
[ "call.add" ]
400,157
400,158
u764399371
python
p02678
from collections import deque N, M = map(int, input().split()) routes = [[] for _ in range(N+1)] for _ in range(M): a, b = map(int, input().split()) routes[a].append(b) routes[b].append(a) checked = [0 for _ in range(N+1)] route = deque(routes[1]) for r in routes[1]: checked[r] = 1 while(len(route) > 0): r =...
from collections import deque N, M = map(int, input().split()) routes = [[] for _ in range(N+1)] for _ in range(M): a, b = map(int, input().split()) routes[a].append(b) routes[b].append(a) checked = [0 for _ in range(N+1)] route = deque(routes[1]) for r in routes[1]: checked[r] = 1 while(len(route) > 0): r =...
[ "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.lower.change" ]
400,161
400,162
u626337957
python
p02678
from collections import deque def solve(): N, M = map(int, input().split()) to = [[] for _ in range(N)] for _ in range(M): a, b = map(int, input().split()) a, b = a - 1, b - 1 to[a].append(b) to[b].append(a) que = deque() hint = [0] * N seen = [False] * N ...
from collections import deque def solve(): N, M = map(int, input().split()) to = [[] for _ in range(N)] for _ in range(M): a, b = map(int, input().split()) a, b = a - 1, b - 1 to[a].append(b) to[b].append(a) que = deque() hint = [0] * N seen = [False] * N ...
[ "identifier.change" ]
400,163
400,164
u926412290
python
p02678
import queue import sys imput = sys.stdin.readline n,m = map(int,input().split()) conne = [[] for _ in range(n+1)] dist = [99999]*(n+1) par = [0] * (n+1) for i in range(m): a,b = map(int,input().split()) conne[a].append(b) conne[b].append(a) q=queue.Queue() dist[1] = 0 q.put((1,0)) while not q.em...
import queue import sys imput = sys.stdin.readline n,m = map(int,input().split()) conne = [[] for _ in range(n+1)] dist = [999999]*(n+1) par = [0] * (n+1) for i in range(m): a,b = map(int,input().split()) conne[a].append(b) conne[b].append(a) q=queue.Queue() dist[1] = 0 q.put((1,0)) while not q.e...
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change", "control_flow.loop.for.condition.change", "expression.operation.binary.remove", "control_flow.branch.if.condition.change" ]
400,169
400,168
u474202990
python
p02678
import queue import sys imput = sys.stdin.readline n,m = map(int,input().split()) conne = [[] for _ in range(n)] dist = [99999]*(n) par = [0] * (n) for i in range(m): a,b = map(int,input().split()) conne[a-1].append(b-1) conne[b-1].append(a-1) q=queue.Queue() dist[0] = 0 q.put((0,0)) while not q....
import queue import sys imput = sys.stdin.readline n,m = map(int,input().split()) conne = [[] for _ in range(n)] dist = [99999]*(n) par = [0] * (n) for i in range(m): a,b = map(int,input().split()) conne[a-1].append(b-1) conne[b-1].append(a-1) q=queue.Queue() dist[0] = 0 q.put((0,0)) while not q....
[ "expression.operation.binary.add" ]
400,171
400,172
u474202990
python
p02678
from collections import deque N,M=map(int,input().split()) haba=[[] for i in range(N+1)] for i in range(M): A,B=map(int,input().split()) haba[A].append(B) haba[B].append(A) kyori=[-1]*(N+1) kyori[0]=0 kyori[1]=0 que=deque() que.append(1) while que: kari=que.popleft() for i in haba[kari]: i...
from collections import deque N,M=map(int,input().split()) haba=[[] for i in range(N+1)] for i in range(M): A,B=map(int,input().split()) haba[A].append(B) haba[B].append(A) kyori=[-1]*(N+1) kyori[0]=0 kyori[1]=0 que=deque() que.append(1) while que: kari=que.popleft() for i in haba[kari]: i...
[ "expression.operation.binary.remove", "literal.number.integer.change", "assignment.value.change", "variable_access.subscript.index.change" ]
400,175
400,176
u671211357
python
p02678
from collections import deque N,M=map(int,input().split()) haba=[[] for i in range(N+1)] for i in range(M): A,B=map(int,input().split()) haba[A].append(B) haba[B].append(A) kyori=[-1]*(N+1) kyori[0]=0 kyori[1]=0 que=deque() que.append(1) while que: kari=que.popleft() for i in haba[kari]: i...
from collections import deque N,M=map(int,input().split()) haba=[[] for i in range(N+1)] for i in range(M): A,B=map(int,input().split()) haba[A].append(B) haba[B].append(A) kyori=[-1]*(N+1) kyori[0]=0 kyori[1]=0 que=deque() que.append(1) while que: kari=que.popleft() for i in haba[kari]: i...
[ "expression.operation.binary.remove" ]
400,177
400,176
u671211357
python
p02678
from collections import deque def bfs2(g,n,m): pre=[0 for _ in range(n+1)] pre[1]=1 q=deque([1]) while q: x=q.popleft() for i in range(len(g[x])): if pre[g[x][i]]==0: q.append(g[x][i]) pre[g[x][i]]=x return pre def main2(): #normal in...
from collections import deque def bfs2(g,n,m): pre=[0 for _ in range(n+1)] pre[1]=1 q=deque([1]) while q: x=q.popleft() for i in range(len(g[x])): if pre[g[x][i]]==0: q.append(g[x][i]) pre[g[x][i]]=x return pre def main2(): #normal in...
[ "literal.string.change", "literal.string.case.change", "call.arguments.change", "io.output.change" ]
400,178
400,179
u613920660
python
p02678
from collections import deque N, M = map(int, input().split()) roads = [] for _ in range(N): roads.append([]) for _ in range(M): a, b = map(int, input().split()) roads[a - 1].append(b - 1) roads[b - 1].append(a - 1) visited = [float('inf')] * N q = deque() q.append(0) visited[0] = 0 pre = [-1] * N while...
from collections import deque N, M = map(int, input().split()) roads = [] for _ in range(N): roads.append([]) for _ in range(M): a, b = map(int, input().split()) roads[a - 1].append(b - 1) roads[b - 1].append(a - 1) visited = [float('inf')] * N q = deque() q.append(0) visited[0] = 0 pre = [-1] * N while...
[ "assignment.value.change", "identifier.change" ]
400,189
400,190
u981931040
python
p02678
from collections import deque import sys def bfs(graph, N, start): visited = [0] * N visited[start] = 1 que = deque([start]) while que: node = que.popleft() for n in graph[node]: if not visited[n]: visited[n] = node + 1 que.append(n) return...
from collections import deque import sys def bfs(graph, N, start): visited = [0] * N visited[start] = 1 que = deque([start]) while que: node = que.popleft() for n in graph[node]: if not visited[n]: visited[n] = node + 1 que.append(n) return...
[ "assignment.value.change", "identifier.change", "call.arguments.change", "call.arguments.keyword_argument.change" ]
400,191
400,192
u095756391
python
p02678
from collections import deque n, m = map(int, input().split()) graph = [[] for _ in range(n + 1)] for i in range(m): a, b = map(int, input().split()) graph[a].append(b) graph[b].append(a) # print(graph) mark = [-1]*(n+1) mark[0] = 0 mark[1] = 0 d = deque() d.append(1) while d: v = d.popleft() ...
from collections import deque n, m = map(int, input().split()) graph = [[] for _ in range(n + 1)] for i in range(m): a, b = map(int, input().split()) graph[a].append(b) graph[b].append(a) # print(graph) mark = [-1]*(n+1) mark[0] = 0 mark[1] = 0 d = deque() d.append(1) while d: v = d.popleft() ...
[ "literal.number.integer.change", "assignment.value.change", "variable_access.subscript.index.change" ]
400,193
400,194
u350491208
python
p02678
# 幅優先探索, BFS from collections import deque n, m = list(map(int, input().split())) edges = [list(map(int, input().split())) for _ in range(m)] neighbor = [[] for _ in range(m)] for edge in edges: neighbor[edge[0]-1].append(edge[1]-1) # 1- → 0-index neighbor[edge[1]-1].append(edge[0]-1) queue = deque() queue...
# 幅優先探索, BFS from collections import deque n, m = list(map(int, input().split())) edges = [list(map(int, input().split())) for _ in range(m)] neighbor = [[] for _ in range(n)] for edge in edges: neighbor[edge[0]-1].append(edge[1]-1) # 1- → 0-index neighbor[edge[1]-1].append(edge[0]-1) queue = deque() queue...
[ "assignment.value.change", "identifier.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
400,199
400,200
u162612857
python
p02678
from collections import deque [N,M] = list(map(int,input().split())) AB = [] for i in range(M): AB.append(list(map(int,input().split()))) #そこから直で行けるところをまとめる ikeru = [[] for i in range(N)] for i in range(M): ikeru[AB[i][0]-1].append(AB[i][1]-1) ikeru[AB[i][1]-1].append(AB[i][0]-1) # print('ikeru:',ikeru) ...
from collections import deque [N,M] = list(map(int,input().split())) AB = [] for i in range(M): AB.append(list(map(int,input().split()))) #そこから直で行けるところをまとめる ikeru = [[] for i in range(N)] for i in range(M): ikeru[AB[i][0]-1].append(AB[i][1]-1) ikeru[AB[i][1]-1].append(AB[i][0]-1) # print('ikeru:',ikeru) ...
[]
400,208
400,209
u017603316
python
p02678
# coding: utf-8 # Your code here! from collections import deque N,M=map(int,input().split()) way=[[] for i in range(N)] for _ in range(M): A,B=map(int,input().split()) way[A-1].append(B-1) way[B-1].append(A-1) visited=[-1 for i in range(N)] visited[0]=0 dq=deque([0]) #loc,value while dq: temp=dq.po...
# coding: utf-8 # Your code here! from collections import deque N,M=map(int,input().split()) way=[[] for i in range(N)] for _ in range(M): A,B=map(int,input().split()) way[A-1].append(B-1) way[B-1].append(A-1) visited=[-1 for i in range(N)] visited[0]=0 dq=deque([0]) #loc,value while dq: temp=dq.po...
[ "identifier.change" ]
400,215
400,216
u798818115
python
p02678
n,m=list(map(int,input().split())) road=[[] for i in range(m)] #隣接行列表現だとo(n^2)で間に合わないので隣接リスト表現でいく for i in range(m): a,b=list(map(int,input().split())) road[a-1].append(b) road[b-1].append(a) from collections import deque q=deque([1]) check=[0 for i in range(n)] check[0]=1 ans=[0 for i in range(n)] while len(q)>0...
n,m=list(map(int,input().split())) road=[[] for i in range(n)] #隣接行列表現だとo(n^2)で間に合わないので隣接リスト表現でいく for i in range(m): a,b=list(map(int,input().split())) road[a-1].append(b) road[b-1].append(a) from collections import deque q=deque([1]) check=[0 for i in range(n)] check[0]=1 ans=[0 for i in range(n)] while len(q)>0...
[ "assignment.value.change", "identifier.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
400,219
400,220
u437351386
python
p02678
n,m=list(map(int,input().split())) road_input=[] for i in range(m): road_input.append(list(map(int,input().split()))) #隣接リスト road=[[] for i in range(n+1)] for i in range(m): road[road_input[i][0]].append(road_input[i][1]) road[road_input[i][1]].append(road_input[i][0]) from collections import deque q=dequ...
n,m=list(map(int,input().split())) road_input=[] for i in range(m): road_input.append(list(map(int,input().split()))) #隣接リスト road=[[] for i in range(n+1)] for i in range(m): road[road_input[i][0]].append(road_input[i][1]) road[road_input[i][1]].append(road_input[i][0]) from collections import deque q=dequ...
[ "call.remove" ]
400,221
400,222
u437351386
python
p02678
from collections import deque N, M = map(int, input().split()) road = [[] for _ in range(M+1)] ans = [-1]*(N+1) d = deque() for i in range(M): A, B = map(int, input().split()) road[A].append(B) road[B].append(A) d.append(1) while len(d) != 0: look = d.popleft() for i in road[look]: if ans[i]...
from collections import deque N, M = map(int, input().split()) road = [[] for _ in range(N+1)] ans = [-1]*(N+1) d = deque() for i in range(M): A, B = map(int, input().split()) road[A].append(B) road[B].append(A) d.append(1) while len(d) != 0: look = d.popleft() for i in road[look]: if ans[i]...
[ "assignment.value.change", "identifier.change", "call.arguments.change", "expression.operation.binary.change", "control_flow.loop.range.bounds.upper.change" ]
400,234
400,235
u815763296
python
p02678
from collections import deque n,m = map(int, input().split()) g = [[] for _ in range(n)] for _ in range(m): a,b = map(int,input().split()) a,b = a-1,b-1 g[a].append(b) g[b].append(a) stack = deque([0]) dist = [-1] * n dist[0] = 0 while stack: v = stack.popleft() for nv in g[v]: if dis...
from collections import deque n,m = map(int, input().split()) g = [[] for _ in range(n)] for _ in range(m): a,b = map(int, input().split()) a,b = a-1, b-1 g[a].append(b) g[b].append(a) stack = deque([0]) dist = [-1]*n dist[0] = 0 while stack: v = stack.popleft() for nv in g[v]: if dist[nv] == -1: ...
[ "literal.string.change", "literal.string.case.change", "call.arguments.change", "io.output.change" ]
400,236
400,237
u241159583
python
p02678
import queue n, m = map(int, input().split()) maze = [[] for _ in range(m)] for i in range(m): a, b = map(int, input().split()) maze[a-1].append(b-1) maze[b-1].append(a-1) ans = [-1 for _ in range(n)] ans[0] = 0 q = queue.Queue() q.put(0) while not q.empty(): start = q.get() for end in maze[start]...
import queue n, m = map(int, input().split()) maze = [[] for _ in range(n)] for i in range(m): a, b = map(int, input().split()) maze[a-1].append(b-1) maze[b-1].append(a-1) ans = [-1 for _ in range(n)] ans[0] = 0 q = queue.Queue() q.put(0) while not q.empty(): start = q.get() for end in maze[start]...
[ "assignment.value.change", "identifier.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
400,242
400,243
u940831163
python
p02678
from collections import deque n, m = map(int, input().split()) a = [0] * (m + 1) b = [0] * (m + 1) road = [[] for _ in range(m + 1)] for i in range(m): a[i], b[i] = map(int, input().split()) road[a[i]].append(b[i]) road[b[i]].append(a[i]) ans = [-1] * (n + 1) ans[0] = 0 ans[1] = 0 q = deque() q.appendle...
from collections import deque n, m = map(int, input().split()) a = [0] * (m + 1) b = [0] * (m + 1) road = [[] for _ in range(n + 1)] for i in range(m): a[i], b[i] = map(int, input().split()) road[a[i]].append(b[i]) road[b[i]].append(a[i]) ans = [-1] * (n + 1) ans[0] = 0 ans[1] = 0 q = deque() q.appendle...
[ "assignment.value.change", "identifier.change", "call.arguments.change", "expression.operation.binary.change", "control_flow.loop.range.bounds.upper.change" ]
400,245
400,246
u158995862
python
p02678
from collections import deque n,m = map(int,input().split()) ab=[[] for _ in range(n+1)] for _ in range(m): a,b=map(int,input().split()) ab[a].append(b) ab[b].append(a) ans=[0]*(n+1) ans[1]=1 que=deque() que.append(1) while que: x=que.popleft() for i in ab[x]: if ans[i]==0: ans[...
from collections import deque n,m = map(int,input().split()) ab=[[] for _ in range(n+1)] for _ in range(m): a,b=map(int,input().split()) ab[a].append(b) ab[b].append(a) ans=[0]*(n+1) ans[1]=1 que=deque() que.append(1) while que: x=que.popleft() for i in ab[x]: if ans[i]==0: ans[...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
400,247
400,248
u944325914
python
p02678
import queue n,m = map(int,input().split()) hen = [[] for i in range(m)] ans = [0 for i in range(n)] a,b = 0,0 for i in range(m): a,b = map(int,input().split()) hen[a-1].append(b) hen[b-1].append(a) q = queue.Queue() q.put(1) while q.empty() == False: head = q.get() for h in hen[head-1]: ...
import queue n,m = map(int,input().split()) hen = [[] for i in range(n)] ans = [0 for i in range(n)] a,b = 0,0 for i in range(m): a,b = map(int,input().split()) hen[a-1].append(b) hen[b-1].append(a) q = queue.Queue() q.put(1) while q.empty() == False: head = q.get() for h in hen[head-1]: ...
[ "assignment.value.change", "identifier.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
400,253
400,254
u436982376
python
p02678
import queue n,m = map(int,input().split()) hen = [[] for i in range(m)] ans = [0 for i in range(n)] a,b = 0,0 max = 0 for i in range(m): a,b = map(int,input().split()) hen[a-1].append(b) hen[b-1].append(a) q = queue.Queue() q.put(1) while q.empty() == False: head = q.get() for h in hen[head-1]:...
import queue n,m = map(int,input().split()) hen = [[] for i in range(n)] ans = [0 for i in range(n)] a,b = 0,0 for i in range(m): a,b = map(int,input().split()) hen[a-1].append(b) hen[b-1].append(a) q = queue.Queue() q.put(1) while q.empty() == False: head = q.get() for h in hen[head-1]: ...
[ "assignment.value.change", "identifier.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change", "expression.operation.binary.change" ]
400,255
400,254
u436982376
python
p02678
from collections import deque mod = 10**9+7 def I(): return int(input()) def LI(): return list(map(int,input().split())) def MI(): return map(int,input().split()) def LLI(n): return [list(map(int, input().split())) for _ in range(n)] N,M = MI() links = [[] for _ in range(N)] for _ in range(M): a, b = MI() a ...
from collections import deque mod = 10**9+7 def I(): return int(input()) def LI(): return list(map(int,input().split())) def MI(): return map(int,input().split()) def LLI(n): return [list(map(int, input().split())) for _ in range(n)] N,M = MI() links = [[] for _ in range(N)] for _ in range(M): a, b = MI() a ...
[]
400,266
400,267
u927373043
python
p02678
from sys import stdin import sys import math from functools import reduce import functools import itertools from collections import deque n,m = [int(x) for x in stdin.readline().rstrip().split()] d = {} for i in range(n): a,b = [int(x) for x in stdin.readline().rstrip().split()] if a not in d: d[a] =...
from sys import stdin import sys import math from functools import reduce import functools import itertools from collections import deque n,m = [int(x) for x in stdin.readline().rstrip().split()] d = {} for i in range(m): a,b = [int(x) for x in stdin.readline().rstrip().split()] if a not in d: d[a] =...
[ "identifier.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
400,274
400,275
u788260274
python
p02678
from collections import deque N, M = map(int, input().split()) G = [[] for i in range(N)] for i in range(M): a, b = map(int, input().split()) G[a-1].append(b-1) G[b-1].append(a-1) ls = deque([0]) ans = [-1] * N ans[0] = 0 while len(ls) > 0: v = ls.pop() for next_v in G[v]: if ans[next_v]...
from collections import deque N, M = map(int, input().split()) G = [[] for i in range(N)] for i in range(M): a, b = map(int, input().split()) G[a-1].append(b-1) G[b-1].append(a-1) ls = deque([0]) ans = [-1] * N ans[0] = 0 while len(ls) > 0: v = ls.popleft() for next_v in G[v]: if ans[nex...
[ "assignment.value.change", "identifier.change" ]
400,276
400,277
u884323674
python
p02678
#!/usr/bin/env python3 from collections import deque import sys input = sys.std.readline n, m = map(int, input().split()) edges = [[] for _ in range(n)] for _ in range(m): a, b = map(int, input().split()) edges[a - 1].append(b - 1) edges[b - 1].append(a - 1) que = deque() dist = [float('inf')] * n prev = ...
#!/usr/bin/env python3 from collections import deque import sys input = sys.stdin.readline n, m = map(int, input().split()) edges = [[] for _ in range(n)] for _ in range(m): a, b = map(int, input().split()) edges[a - 1].append(b - 1) edges[b - 1].append(a - 1) que = deque() dist = [float('inf')] * n prev ...
[ "assignment.value.change", "identifier.change" ]
400,280
400,281
u285022453
python
p02678
#!/usr/bin/env python3 from collections import deque n, m = map(int, input().split()) edges = [[] for _ in range(n)] for _ in range(m): a, b = map(int, input().split()) edges[a - 1].append(b - 1) edges[b - 1].append(a - 1) que = deque() dist = [float('inf')] * n prev = [-1] * n dist[0] = 0 que.append(0) w...
#!/usr/bin/env python3 from collections import deque # import sys # input = sys.std.readline n, m = map(int, input().split()) edges = [[] for _ in range(n)] for _ in range(m): a, b = map(int, input().split()) edges[a - 1].append(b - 1) edges[b - 1].append(a - 1) que = deque() dist = [float('inf')] * n pre...
[ "assignment.value.change", "identifier.change" ]
400,282
400,283
u285022453
python
p02678
import sys, bisect, math, itertools, string, queue, copy # import numpy as np import scipy from collections import Counter,defaultdict,deque from itertools import permutations, combinations from heapq import heappop, heappush from fractions import gcd input = sys.stdin.readline sys.setrecursionlimit(10**8) mod = 10**9+...
import sys, bisect, math, itertools, string, queue, copy # import numpy as np # import scipy from collections import Counter,defaultdict,deque from itertools import permutations, combinations from heapq import heappop, heappush from math import gcd input = sys.stdin.readline sys.setrecursionlimit(10**8) mod = 10**9+7 d...
[]
400,288
400,287
u653041271
python
p02678
from collections import deque n,m=map(int,input().split()) node=[[] for _ in range(n)] for i in range(m): a,b=map(int,input().split()) node[b-1].append(a-1) node[a-1].append(b-1) distance=[-1]*n distance[0]=0 d=deque() d.append(0) while d: v=d.popleft() for i in node[v]: if distance[i]!=-1:...
from collections import deque n,m=map(int,input().split()) node=[[] for _ in range(n)] for i in range(m): a,b=map(int,input().split()) node[b-1].append(a-1) node[a-1].append(b-1) distance=[-1]*n distance[0]=0 d=deque() d.append(0) while d: v=d.popleft() for i in node[v]: if distance[i]!=-1:...
[]
400,292
400,293
u371409687
python
p02678
from collections import deque N, M = map(int, input().split()) ARR = [] for i in range(N): ARR.append(list(map(int, input().split()))) def prepare(n, m, arr): nodes = [[] for i in range(n)] nodeStatus = [False for i in range(n)] for i in range(n): startNode = arr[i][0] - 1 endNode = ...
from collections import deque N, M = map(int, input().split()) ARR = [] for i in range(M): ARR.append(list(map(int, input().split()))) def prepare(n, m, arr): nodes = [[] for i in range(n)] nodeStatus = [False for i in range(n)] for i in range(m): startNode = arr[i][0] - 1 endNode = ...
[ "identifier.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
400,294
400,295
u788068140
python
p02678
from collections import deque N, M = map(int, input().split()) ARR = [] for i in range(N): ARR.append(list(map(int, input().split()))) def prepare(n, m, arr): nodes = [[] for i in range(n)] nodeStatus = [False for i in range(n)] for i in range(n): startNode = arr[i][0] - 1 endNode = ...
from collections import deque N, M = map(int, input().split()) ARR = [] for i in range(M): ARR.append(list(map(int, input().split()))) def prepare(n, m, arr): nodes = [[] for i in range(n)] nodeStatus = [False for i in range(n)] for i in range(m): startNode = arr[i][0] - 1 endNode = ...
[ "identifier.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
400,296
400,297
u788068140
python
p02678
N, M = 6, 9 ARR = [ [3, 4], [6, 1], [2, 4], [5, 3], [4, 6], [1, 5], [6, 2], [4, 5], [5, 6], ] N,M = 4, 4 ARR = [ [1, 2], [2, 3], [3, 4], [4, 2], ] N, M = map(int, input().split()) ARR = [] for i in range(M): ARR.append(list(map(int, input().split()))) from c...
N, M = 6, 9 ARR = [ [3, 4], [6, 1], [2, 4], [5, 3], [4, 6], [1, 5], [6, 2], [4, 5], [5, 6], ] N, M = 4, 4 ARR = [ [1, 2], [2, 3], [3, 4], [4, 2], ] N, M = map(int, input().split()) ARR = [] for i in range(M): ARR.append(list(map(int, input().split()))) from co...
[ "call.add" ]
400,298
400,299
u788068140
python
p02678
#import time from itertools import dropwhile, takewhile def main(): N, M = list(map(int, input().split())) lis = [list(map(int, input().split())) for _ in range(M)] #print(lis) edge = [[] for _ in range(N+1)] #print(edge) for a,b in lis: edge[a].append(b) edge[b].append(a) ...
#import time from itertools import dropwhile, takewhile def main(): N, M = list(map(int, input().split())) lis = [list(map(int, input().split())) for _ in range(M)] #print(lis) edge = [[] for _ in range(N+1)] #print(edge) for a,b in lis: edge[a].append(b) edge[b].append(a) ...
[ "call.remove", "call.arguments.change" ]
400,302
400,303
u756607246
python
p02678
from collections import deque n,m=map(int,input().split()) adj=[[] for _ in range(n)] for _ in range(m): a,b =map(int,input().split()) a-=1 b-=1 adj[a].append(b) adj[b].append(a) ans=[0]*n que=deque([]) que.append(0) while que: e=que.popleft for i in adj[e]: if ans[i]!=0: continue ans[i]=e+1...
from collections import deque n,m=map(int,input().split()) adj=[[] for _ in range(n)] for _ in range(m): a,b =map(int,input().split()) a-=1 b-=1 adj[a].append(b) adj[b].append(a) ans=[0]*n que=deque([]) que.append(0) while que: e=que.popleft() for i in adj[e]: if ans[i]!=0: continue ans[i]=e...
[ "call.add" ]
400,304
400,305
u344065503
python
p02678
N, M = map(int, input().split()) nextroom = [[] for _ in range(N)] for _ in range(M): A, B = map(int, input().split()) nextroom[A-1].append(B-1) nextroom[B-1].append(A-1) sgn = [-1 for _ in range(N)] sgn[0] = 0 depth = [float('inf') for _ in range(N)] depth[0] = 0 now = [0] nextvisit = [] for j in range(1, M):...
N, M = map(int, input().split()) nextroom = [[] for _ in range(N)] for _ in range(M): A, B = map(int, input().split()) nextroom[A-1].append(B-1) nextroom[B-1].append(A-1) sgn = [-1 for _ in range(N)] sgn[0] = 0 depth = [float('inf') for _ in range(N)] depth[0] = 0 now = [0] nextvisit = [] for j in range(1, M+1...
[ "control_flow.loop.range.bounds.upper.change", "expression.operation.binary.add" ]
400,306
400,307
u627600101
python
p02678
Copy Copy n, m = map(int, input().split()) ab = [list(map(int, input().split())) for _i in range(m)] visit = [-1 for _ in range(n)] visit[0] = 0 tree = [[] for _ in range(n)] for a, b in ab: tree[a-1].append(b-1) tree[b-1].append(a-1) from collections import deque q = deque([0]) while q: p = q.popleft(...
n, m = map(int, input().split()) ab = [list(map(int, input().split())) for _i in range(m)] visit = [-1 for _ in range(n)] visit[0] = 0 tree = [[] for _ in range(n)] for a, b in ab: tree[a-1].append(b-1) tree[b-1].append(a-1) from collections import deque q = deque([0]) while q: p = q.popleft() for i...
[]
400,322
400,323
u175590965
python
p02678
# -*- codinf: utf-8 -*- from collections import deque N, M = map(int, input().split()) route = [[] for _ in range(N + 1)] for _ in range(M): a, b = map(int, input().split()) route[a].append(b) route[b].append(a) q = deque([1]) # 頂点を設定して初期化 pre = [None] * (N+1) # 頂点までの最短に進む時の次の頂点のリスト pre[1] = 0 # 頂点は0 depth =...
# -*- codinf: utf-8 -*- from collections import deque N, M = map(int, input().split()) route = [[] for _ in range(N + 1)] for _ in range(M): a, b = map(int, input().split()) route[a].append(b) route[b].append(a) q = deque([1]) # 頂点を設定して初期化 pre = [None] * (N+1) # 頂点までの最短に進む時の次の頂点のリスト pre[1] = 0 # 頂点は0 depth =...
[ "literal.string.change", "literal.string.case.change", "call.arguments.change", "io.output.change" ]
400,330
400,331
u531391334
python