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 9
values |
|---|---|---|---|---|---|---|---|
p02641 | x,n = gets.split.map(&:to_i)
return puts x if n == 0
p = gets.split.map(&:to_i)
a = [*1..100].map {|n| n unless p.include? n }.compact!
p a.min_by{|n| (n-x).abs} | x,n = gets.split.map(&:to_i)
return puts x if n == 0
p = gets.split.map(&:to_i)
a = [*-1..101].map {|n| n unless p.include? n }.compact!
p a.min_by{|n| (n-x).abs} | [
"expression.operation.unary.add",
"literal.number.integer.change",
"assignment.value.change"
] | 357,625 | 357,626 | u523351024 | ruby |
p02641 | x, n = gets.split.map(&:to_i)
if n == 0
puts x
exit
end
p = gets.split.map(&:to_i)
list = (1..100).to_a - p # 候補のリスト
if list == []
if x <= 50
puts 0
else
puts 101
end
exit
end
diff_list = list.map { |a| (a - x).abs } # 差分のリスト
index = diff_list.find_index(diff_list.min)
puts list[index]
| x, n = gets.split.map(&:to_i)
if n == 0
puts x
exit
end
p = gets.split.map(&:to_i)
list = (0..101).to_a - p # 候補のリスト
if list == []
if x <= 50
puts 0
else
puts 101
end
exit
end
diff_list = list.map { |a| (a - x).abs } # 差分のリスト
index = diff_list.find_index(diff_list.min)
puts list[index]
| [
"literal.number.integer.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 357,884 | 357,885 | u315859894 | ruby |
p02641 | x, n = gets.chomp.split(' ').map(&:to_i)
if n == 0
puts x
return
end
ps = gets.chomp.split(' ').map(&:to_i)
values = (1..100).to_a.delete_if { |v| ps.include?(v) }
abs_values =
values.each_with_object([]) do |value, objects|
abs = (x.abs - value.abs).abs
objects << abs
end
min_abs = abs_values.min
puts values[abs_values.find_index(min_abs)] | x, n = gets.chomp.split(' ').map(&:to_i)
if n == 0
puts x
exit
end
ps = gets.chomp.split(' ').map(&:to_i)
values = (0..101).to_a.delete_if { |v| ps.include?(v) }
abs_values =
values.each_with_object([]) do |value, objects|
abs = (x - value.abs).abs
objects << abs
end
min_abs = abs_values.min
puts values[abs_values.find_index(min_abs)] | [
"control_flow.return.remove",
"control_flow.exit.add",
"literal.number.integer.change",
"assignment.value.change",
"call.remove"
] | 357,965 | 357,966 | u265810213 | ruby |
p02641 | x, n = gets.chomp.split(' ').map(&:to_i)
if n == 0
puts x
return
end
ps = gets.chomp.split(' ').map(&:to_i)
values = (-100..100).to_a.delete_if { |v| ps.include?(v) }
abs_values =
values.each_with_object([]) do |value, objects|
abs = (x - value.abs).abs
objects << abs
end
min_abs = abs_values.min
puts values[abs_values.find_index(min_abs)] | x, n = gets.chomp.split(' ').map(&:to_i)
if n == 0
puts x
exit
end
ps = gets.chomp.split(' ').map(&:to_i)
values = (0..101).to_a.delete_if { |v| ps.include?(v) }
abs_values =
values.each_with_object([]) do |value, objects|
abs = (x - value.abs).abs
objects << abs
end
min_abs = abs_values.min
puts values[abs_values.find_index(min_abs)] | [
"control_flow.return.remove",
"control_flow.exit.add",
"assignment.value.change",
"expression.operation.unary.remove",
"literal.number.integer.change"
] | 357,967 | 357,966 | u265810213 | ruby |
p02641 | x, n = gets.chomp.split(' ').map(&:to_i)
if n == 0
puts x
return
end
ps = gets.chomp.split(' ').map(&:to_i)
values = (1..100).to_a.delete_if { |v| ps.include?(v) }
abs_values =
values.each_with_object([]) do |value, objects|
abs = (x - value.abs).abs
objects << abs
end
min_abs = abs_values.min
puts values[abs_values.find_index(min_abs)] | x, n = gets.chomp.split(' ').map(&:to_i)
if n == 0
puts x
exit
end
ps = gets.chomp.split(' ').map(&:to_i)
values = (0..101).to_a.delete_if { |v| ps.include?(v) }
abs_values =
values.each_with_object([]) do |value, objects|
abs = (x - value.abs).abs
objects << abs
end
min_abs = abs_values.min
puts values[abs_values.find_index(min_abs)] | [
"control_flow.return.remove",
"control_flow.exit.add",
"literal.number.integer.change",
"assignment.value.change"
] | 357,968 | 357,966 | u265810213 | ruby |
p02641 | lines = []
while line = gets
lines << line.chomp.split(' ').map(&:to_i)
end
a = lines[0]
b = lines[1]
if a[1] == 0
puts a[0]
exit
end
arr = (1..100).to_a - b
arrr = arr.map {|x| a[0] - x}
puts arrr
abs_arr = arrr.map(&:abs)
min_i = abs_arr.min
min_n = abs_arr.index(min_i)
puts arr[min_n] | lines = []
while line = gets
lines << line.chomp.split(' ').map(&:to_i)
end
a = lines[0]
b = lines[1]
if a[1] == 0
puts a[0]
exit
end
arr = (0..101).to_a - b
arrr = arr.map {|x| a[0] - x}
abs_arr = arrr.map(&:abs)
min_i = abs_arr.min
min_n = abs_arr.index(min_i)
puts arr[min_n] | [
"literal.number.integer.change",
"assignment.value.change",
"expression.operation.binary.change",
"call.remove"
] | 359,348 | 359,347 | u860113380 | ruby |
p02641 | lines = []
while line = gets
lines << line.chomp.split(' ').map(&:to_i)
end
a = lines[0]
b = lines[1]
if a[1] == 0
puts 0
exit
end
arr = (1..100).to_a - b
arrr = arr.map {|x| a[0] - x}
abs_arr = arrr.map(&:abs)
min_i = abs_arr.min
min_n = abs_arr.index(min_i)
puts arr[min_n]
| lines = []
while line = gets
lines << line.chomp.split(' ').map(&:to_i)
end
a = lines[0]
b = lines[1]
if a[1] == 0
puts a[0]
exit
end
arr = (0..101).to_a - b
arrr = arr.map {|x| a[0] - x}
abs_arr = arrr.map(&:abs)
min_i = abs_arr.min
min_n = abs_arr.index(min_i)
puts arr[min_n] | [
"call.arguments.change",
"literal.number.integer.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 359,349 | 359,347 | u860113380 | ruby |
p02641 | x, n = gets.split.map(&:to_i)
if n == 0
puts x
exit 0
end
array = gets.split.map(&:to_i)
min = 100
ans = 0
1.step(101) do |i|
next if array.include?(i)
if (x - i).abs < min
min = (x - i).abs
ans = i
end
end
puts ans
| x, n = gets.split.map(&:to_i)
if n == 0
puts x
exit 0
end
array = gets.split.map(&:to_i)
min = 100
ans = 0
-1.step(101) do |i|
next if array.include?(i)
if (x - i).abs < min
min = (x - i).abs
ans = i
end
end
puts ans
| [
"expression.operation.unary.add"
] | 359,785 | 359,786 | u854388580 | ruby |
p02641 | X, N = gets.split.map(&:to_i)
result = []
if N == 0
print X
else
n_ary = gets.split.map(&:to_i)
ary = []
(1..100).each do |i|
ary.push i
end
n_ary.each do |j|
ary.delete(j)
end
result.push ary.min_by{|x| (x-X).abs}
puts result.min
end | X, N = gets.split.map(&:to_i)
result = []
if N == 0
print X
else
n_ary = gets.split.map(&:to_i)
ary = []
(-100..300).each do |i|
ary.push i
end
n_ary.each do |j|
ary.delete(j)
end
result.push ary.min_by{|x| (x-X).abs}
puts result.min
end | [
"expression.operation.unary.add",
"literal.number.integer.change"
] | 360,448 | 360,447 | u011809316 | ruby |
p02641 | x, n = gets.split.map(&:to_i)
if n == 0
puts x
exit
end
p = gets.split.map(&:to_i)
h = Hash.new(0)
p.each do |v|
h[v] += 1
end
min = Float::INFINITY
-100.upto(100) do |i|
next if h[i] > 0
min = (x - i).abs if min > (x - i).abs
end
if h[x - min] == 0
puts x - min
else
puts x + min
end | x, n = gets.split.map(&:to_i)
if n == 0
puts x
exit
end
p = gets.split.map(&:to_i)
h = Hash.new(0)
p.each do |v|
h[v] += 1
end
min = Float::INFINITY
-1.upto(101) do |i|
next if h[i] > 0
min = (x - i).abs if min > (x - i).abs
end
if h[x - min] == 0
puts x - min
else
puts x + min
end | [
"literal.number.integer.change",
"call.arguments.change"
] | 360,646 | 360,647 | u979552932 | ruby |
p02641 | x, n = gets.chomp.split(" ").map {|c| c.to_i}
if n == 0
puts x
exit
end
pl = gets.chomp.split(" ").map {|c| c.to_i}
min_num = 0
min_abs = 1000
pl.sort!
(0..101).each do |pi|
p pi
if pl.include?(pi)
next
end
if min_abs > (x - pi).abs
min_abs = (x - pi).abs
min_num = pi
end
end
puts min_num | x, n = gets.chomp.split(" ").map {|c| c.to_i}
if n == 0
puts x
exit
end
pl = gets.chomp.split(" ").map {|c| c.to_i}
min_num = 0
min_abs = 1000
pl.sort!
(0..101).each do |pi|
if pl.include?(pi)
next
end
if min_abs > (x - pi).abs
min_abs = (x - pi).abs
min_num = pi
end
end
puts min_num | [
"call.remove"
] | 360,667 | 360,668 | u644533034 | ruby |
p02641 | x, n = gets.chomp.split(" ").map {|c| c.to_i}
if n == 0
puts x
exit
end
pl = gets.chomp.split(" ").map {|c| c.to_i}
min_num = 0
min_abs = 1000
pl.sort!
(1..200).each do |pi|
if pl.include?(pi)
next
end
if min_abs > (x - pi).abs
min_abs = (x - pi).abs
min_num = pi
end
end
puts min_num | x, n = gets.chomp.split(" ").map {|c| c.to_i}
if n == 0
puts x
exit
end
pl = gets.chomp.split(" ").map {|c| c.to_i}
min_num = 0
min_abs = 1000
pl.sort!
(0..101).each do |pi|
if pl.include?(pi)
next
end
if min_abs > (x - pi).abs
min_abs = (x - pi).abs
min_num = pi
end
end
puts min_num | [
"literal.number.integer.change"
] | 360,669 | 360,668 | u644533034 | ruby |
p02641 | x, n = gets.chomp.split(" ").map {|c| c.to_i}
if n == 0
puts x
exit
end
pl = gets.chomp.split(" ").map {|c| c.to_i}
min_num = 0
min_abs = 1000
pl.sort!
(1..100).each do |pi|
if pl.include?(pi)
next
end
if min_abs > (x - pi).abs
min_abs = (x - pi).abs
min_num = pi
end
end
puts min_num | x, n = gets.chomp.split(" ").map {|c| c.to_i}
if n == 0
puts x
exit
end
pl = gets.chomp.split(" ").map {|c| c.to_i}
min_num = 0
min_abs = 1000
pl.sort!
(0..101).each do |pi|
if pl.include?(pi)
next
end
if min_abs > (x - pi).abs
min_abs = (x - pi).abs
min_num = pi
end
end
puts min_num | [
"literal.number.integer.change"
] | 360,670 | 360,668 | u644533034 | ruby |
p02641 | x, n = gets.split.map(&:to_i)
if n == 0
p x
exit
end
ps = gets.split.map(&:to_i)
qs = [*1..100] - ps
mn = -1
mv = 1000000000
qs.each do |q|
if (q - x).abs < mv
mn = q
mv = (q - x).abs
end
end
p mn
| x, n = gets.split.map(&:to_i)
if n == 0
p x
exit
end
ps = gets.split.map(&:to_i)
qs = [*(-200)..200] - ps
mn = -1
mv = 1000000000
qs.each do |q|
if (q - x).abs < mv
mn = q
mv = (q - x).abs
end
end
p mn
| [
"assignment.value.change",
"expression.operation.binary.change",
"literal.number.integer.change"
] | 361,457 | 361,458 | u084335038 | ruby |
p02641 | x, n = gets.split.map(&:to_i)
if n == 0
p = gets
puts x
exit
end
p = gets.split.map(&:to_i)
min = 100
cand = 100
0.upto(100) do |pp|
next if p.include?(pp)
diff = (x - pp).abs
if diff < min
min = diff
cand = pp
end
end
puts cand | x, n = gets.split.map(&:to_i)
if n == 0
p = gets
puts x
exit
end
p = gets.split.map(&:to_i)
min = 100
cand = 100
0.upto(200) do |pp|
next if p.include?(pp)
diff = (x - pp).abs
if diff < min
min = diff
cand = pp
end
end
puts cand | [
"literal.number.integer.change",
"call.arguments.change"
] | 361,560 | 361,561 | u374765295 | ruby |
p02642 | n = gets.to_i
arr = gets.to_s.split.map(&:to_i)
max = arr.max
hash = {}
arr.each do |num|
hash[num] = hash[num].nil? ? true : false
(2..max).each do |i|
if num * i > max
p [num, i]
break
end
hash[num * i] = false
end
end
count = 0
hash.each do |_num, bool|
count += 1 if bool
end
puts count | n = gets.to_i
arr = gets.to_s.split.map(&:to_i)
max = arr.max
hash = {}
arr.each do |num|
hash[num] = hash[num].nil? ? true : false
(2..max).each do |i|
if num * i > max
break
end
hash[num * i] = false
end
end
count = 0
hash.each do |_num, bool|
count += 1 if bool
end
puts count | [
"call.remove"
] | 362,229 | 362,230 | u771770008 | ruby |
p02642 | N = gets.to_i
array = gets.split.map(&:to_i)
result = Array.new(10**6, 0)
array.each do |num|
i = 1
if result[i * num] == 0
while 10 ** 6 >= i * num
result[i * num] += 1
i += 1
end
else
result[i * num] = 2
end
end
count = 0
array.each do |num|
count += 1 if result[num] == 1
end
puts count
| N = gets.to_i
array = gets.split.map(&:to_i)
result = Array.new(10**6+5, 0)
array.each do |num|
i = 1
if result[i * num] == 0
while 10 ** 6 >= i * num
result[i * num] += 1
i += 1
end
else
result[i * num] = 2
end
end
count = 0
array.each do |num|
count += 1 if result[num] == 1
end
puts count
| [
"assignment.change"
] | 362,944 | 362,945 | u966810027 | ruby |
p02642 | N = gets.to_i
a = gets.split(" ").map(&:to_i).sort
b = Array.new(a[-1] + 1, true)
ans = 0
(N - 1).times do |i|
next if b[i] == false
v = a[i] * 2
while v <= a[-1] do
b[v] = false
v += a[i]
end
b[a[i]] = false if a[i] == a[i + 1]
end
a.each do |x|
ans += 1 if b[x] ==true
end
puts ans | N = gets.to_i
a = gets.split(" ").map(&:to_i).sort
b = Array.new(a[-1] + 1, true)
ans = 0
(N - 1).times do |i|
next if b[a[i]] == false
v = a[i] * 2
while v <= a[-1] do
b[v] = false
v += a[i]
end
b[a[i]] = false if a[i] == a[i + 1]
end
a.each do |x|
ans += 1 if b[x] == true
end
puts ans | [
"control_flow.branch.if.condition.change"
] | 363,313 | 363,314 | u729911058 | ruby |
p02642 | n = gets.to_i
a = gets.chomp.split(" ").map(&:to_i).sort
INF = (10 ** 6)
arr = Array.new(INF+1,0)
a.each do |i|
next if arr[i] == 2
i.step(INF, i) do |j|
arr[i] += 1
end
end
count = 0
a.each do |i|
count += 1 if arr[i] == 1
end
puts count | n = gets.to_i
a = gets.chomp.split(" ").map(&:to_i).sort
INF = (10 ** 6)
arr = Array.new(INF+1,0)
a.each do |i|
next if arr[i] == 2
i.step(INF, i) do |j|
arr[j] += 1
end
end
count = 0
a.each do |i|
count += 1 if arr[i] == 1
end
puts count | [
"identifier.change",
"variable_access.subscript.index.change"
] | 363,427 | 363,428 | u412789323 | ruby |
p02642 | N = gets.to_i
A = gets.split.map(&:to_i)
b = Array.new((10 ** 6) + 1, 0)
A.each do |a|
if b[a] == 2
next
end
a.step(10 ** 6, a) do |i|
b[i] += 1
end
end
puts A.select {|a| b[a] == 1 }.size | N = gets.to_i
A = gets.split.map(&:to_i).sort
b = Array.new((10 ** 6) + 1, 0)
A.each do |a|
if b[a] == 2
next
end
a.step(10 ** 6, a) do |i|
b[i] += 1
end
end
puts A.select {|a| b[a] == 1 }.size | [
"call.add"
] | 363,479 | 363,480 | u039293076 | ruby |
p02642 | N = gets.to_i
A = gets.split.map(&:to_i)
b = Array.new((10 ** 6) + 1, 0)
A.each do |a|
if b[a] == 2
next
end
a.step(10 ** 6, a) do |i|
p i
b[i] += 1
end
end
puts A.select {|a| b[a] == 1 }.size | N = gets.to_i
A = gets.split.map(&:to_i).sort
b = Array.new((10 ** 6) + 1, 0)
A.each do |a|
if b[a] == 2
next
end
a.step(10 ** 6, a) do |i|
b[i] += 1
end
end
puts A.select {|a| b[a] == 1 }.size | [
"call.add",
"call.remove"
] | 363,482 | 363,480 | u039293076 | ruby |
p02642 | N = gets.to_i
ary = gets.split.map(&:to_i).sort.uniq
nums = Hash.new(0)
ans = Array.new(ary.last + 1, 0)
result = 0
ary.each do |i|
nums[i] += 1
ans[i] = 1
end
ary.each do |k|
next if ans[k] == 0
result += 1 if nums[k] == 1
k.step(ary.last, k) do |l|
ans[l] = 0
end
end
puts result | N = gets.to_i
ary = gets.split.map(&:to_i).sort
nums = Hash.new(0)
ans = Array.new(ary.last + 1, 0)
result = 0
ary.each do |i|
nums[i] += 1
ans[i] = 1
end
ary.each do |k|
next if ans[k] == 0
result += 1 if nums[k] == 1
k.step(ary.last, k) do |l|
ans[l] = 0
end
end
puts result | [
"call.remove"
] | 363,603 | 363,604 | u011809316 | ruby |
p02642 | N = gets.to_i
ary = gets.split.map(&:to_i).sort.uniq
nums = Hash.new(0)
ans = Array.new(ary.max + 1, 0)
result = 0
ary.each do |i|
nums[i] += 1
ans[i] = 1
end
ary.each do |k|
next if ans[k] == 0
result += 1 if nums[k] == 1
k.step(ary.max, k) do |l|
ans[l] = 0
end
end
puts result | N = gets.to_i
ary = gets.split.map(&:to_i).sort
nums = Hash.new(0)
ans = Array.new(ary.last + 1, 0)
result = 0
ary.each do |i|
nums[i] += 1
ans[i] = 1
end
ary.each do |k|
next if ans[k] == 0
result += 1 if nums[k] == 1
k.step(ary.last, k) do |l|
ans[l] = 0
end
end
puts result | [
"call.remove",
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 363,605 | 363,604 | u011809316 | ruby |
p02642 | require "prime"
n = gets.chomp.to_i
arr = gets.chomp.split.map(&:to_i)
#ダブってるか
hash = {}
arr.each do |a|
hash[a] = hash.has_key?(a) ? false : true
end
arr = arr.uniq.sort
pri = Array.new(arr[arr.length-1]+1, true)
p arr
cnt = 0
arr.each do |a|
#a = arr[i]
aa = a
cnt += 1 if pri[a] && hash[a]
# puts "-----a=#{a} ok------" if pri[a] && hash[a]
# print "#{i} "
# ma = []
# pri.each_with_index{|a, i| ma << i if a}
# p ma
next if !pri[a]
while aa < pri.length
pri[aa] = false
aa += a
end
end
puts cnt | require "prime"
n = gets.chomp.to_i
arr = gets.chomp.split.map(&:to_i)
#ダブってるか
hash = {}
arr.each do |a|
hash[a] = hash.has_key?(a) ? false : true
end
arr = arr.uniq.sort
pri = Array.new(arr[arr.length-1]+1, true)
#p arr
cnt = 0
arr.each do |a|
#a = arr[i]
aa = a
cnt += 1 if pri[a] && hash[a]
# puts "-----a=#{a} ok------" if pri[a] && hash[a]
# print "#{i} "
# ma = []
# pri.each_with_index{|a, i| ma << i if a}
# p ma
next if !pri[a]
while aa < pri.length
pri[aa] = false
aa += a
end
end
puts cnt | [
"call.remove"
] | 363,623 | 363,624 | u409390792 | ruby |
p02642 | require "prime"
lines = []
while line = gets
lines << line.chomp.split(' ').map(&:to_i)
end
N = lines[0][0]
Max = 10 ** 6
a = []
for i in 1..Max do
a[i-1] = 0
end
lines[1].each do |i|
a[i-1] = 1
end
for i in 1..Max do
if a[i-1] == 1 then
j = 2
while i * j <= Max do
a[i*j-1] = 0
j += 1
end
end
end
ans = 0
for i in 1..Max do
if a[i-1] == 1 then
ans += 1
end
end
print ans | lines = []
while line = gets
lines << line.chomp.split(' ').map(&:to_i)
end
N = lines[0][0]
Max = 10 ** 6
a = []
for i in 1..Max do
a[i-1] = 0
end
lines[1].each do |i|
a[i-1] += 1
end
for i in 1..Max do
if a[i-1] >= 1 then
j = 2
while i * j <= Max do
a[i*j-1] = 0
j += 1
end
end
end
ans = 0
for i in 1..Max do
if a[i-1] == 1 then
ans += 1
end
end
print ans | [
"call.remove",
"assignment.value.change",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 364,372 | 364,373 | u569559028 | ruby |
p02646 | a,v = gets.chomp.split(' ').map(&:to_i)
b,w = gets.chomp.split(' ').map(&:to_i)
t = gets.to_i
if (v - w) * t >= (a - b).abs
puts "Yes"
else
puts "No"
end |
a,v = gets.chomp.split(' ').map(&:to_i)
b,w = gets.chomp.split(' ').map(&:to_i)
t = gets.to_i
if (v - w) * t >= (a - b).abs
puts "YES"
else
puts "NO"
end | [
"literal.string.change",
"literal.string.case.change",
"call.arguments.change"
] | 365,161 | 365,162 | u059126963 | ruby |
p02646 | a,v=gets.chomp.split(" ").map(&:to_i);
b,w=gets.chomp.split(" ").map(&:to_i);
t=gets.chomp.to_i
kyo = (a-b).to_f
if (v-w)*t >= kyo
puts "YES"
else
puts "NO"
end
| a,v=gets.chomp.split(" ").map(&:to_i);
b,w=gets.chomp.split(" ").map(&:to_i);
t=gets.chomp.to_i
kyo = (a-b).abs
if (v-w)*t >= kyo
puts "YES"
else
puts "NO"
end
| [
"assignment.value.change",
"identifier.change"
] | 365,614 | 365,615 | u688809543 | ruby |
p02646 | require 'bigdecimal'
require 'bigdecimal/util'
A, V = gets.chomp.split(" ").map(&:to_d)
B, W = gets.chomp.split(" ").map(&:to_d)
T = gets.chomp.to_d
d = abs(A-B)
v = (V-W)*T
if (v >= d)
print "YES"
else
print "NO"
end
| require 'bigdecimal'
require 'bigdecimal/util'
A, V = gets.chomp.split(" ").map(&:to_d)
B, W = gets.chomp.split(" ").map(&:to_d)
T = gets.chomp.to_d
d = (A-B).abs
v = (V-W)*T
if (v >= d)
print "YES"
else
print "NO"
end
| [
"call.add"
] | 366,020 | 366,021 | u731036814 | ruby |
p02646 | a, v = gets.split.map(&:to_i)
b, w = gets.split.map(&:to_i)
t = gets.to_i
if v <= w
puts "NO"
exit
end
puts ((a-b).abs <= (v+w)*t) ? "YES" : "NO"
| a, v = gets.split.map(&:to_i)
b, w = gets.split.map(&:to_i)
t = gets.to_i
if v <= w
puts "NO"
exit
end
puts ((a-b).abs <= (v-w)*t) ? "YES" : "NO"
| [
"misc.opposites",
"expression.operator.arithmetic.change",
"control_flow.branch.if.condition.change"
] | 366,261 | 366,262 | u679291177 | ruby |
p02646 | A, V = gets.split.map(&:to_i)
B, W = gets.split.map(&:to_i)
T = gets.to_i
if V <= W
puts 'No'
exit
end
if (A - B).abs <= (V - W) * T
puts 'Yes'
else
puts 'No'
end | A, V = gets.split.map(&:to_i)
B, W = gets.split.map(&:to_i)
T = gets.to_i
if V <= W
puts 'NO'
exit
end
if (A - B).abs <= (V - W) * T
puts 'YES'
else
puts 'NO'
end | [
"literal.string.change",
"literal.string.case.change",
"call.arguments.change"
] | 366,801 | 366,802 | u039293076 | ruby |
p02646 | eval"A,V,B,W,T="+`dd`.split*?,
puts (A-B).abs <= (V-W)*T ? :Yes : :No | eval"A,V,B,W,T="+`dd`.split*?,
puts (A-B).abs <= (V-W)*T ? :YES : :NO
| [
"call.arguments.change"
] | 366,825 | 366,826 | u032223772 | ruby |
p02646 | a,v=gets.split.map(&:to_i)
b,w=gets.split.map(&:to_i)
t=gets.to_i
x=b-a
x=x.abs
at=v*t
bt=w*t
result=(at-bt)
if result >x
puts "YES"
else
puts "NO"
end | a,v=gets.split.map(&:to_i)
b,w=gets.split.map(&:to_i)
t=gets.to_i
x=b-a
x=x.abs
at=v*t
bt=w*t
result=(at-bt)
if result >=x
puts "YES"
else
puts "NO"
end
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 366,849 | 366,850 | u590472228 | ruby |
p02646 | a,v=gets.split.map(&:to_i)
b,w=gets.split.map(&:to_i)
t=gets.to_i
x=b-a
x=x.abs
at=v*t
bt=w*t
result=(at-bt).abs
if result >x
puts "YES"
else
puts "NO"
end | a,v=gets.split.map(&:to_i)
b,w=gets.split.map(&:to_i)
t=gets.to_i
x=b-a
x=x.abs
at=v*t
bt=w*t
result=(at-bt)
if result >=x
puts "YES"
else
puts "NO"
end
| [
"call.remove",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 366,851 | 366,850 | u590472228 | ruby |
p02646 | (a,v)=gets.split.map(&:to_i)
(b,w)=gets.split.map(&:to_i)
t=gets.to_i
d=(a-b).abs
dx=(v-w).abs
if d <= dx*t
print 'YES'
else
print 'NO'
end
| (a,v)=gets.split.map(&:to_i)
(b,w)=gets.split.map(&:to_i)
t=gets.to_i
d=(a-b).abs
dx=(v-w)
if d <= dx*t
print 'YES'
else
print 'NO'
end
| [
"call.remove"
] | 366,956 | 366,957 | u702482655 | ruby |
p02646 | a, v = gets.split(" ").map(&:to_i)
b, w = gets.split(" ").map(&:to_i)
t = gets.to_i
dist = (a-b).abs
sp = v - w
puts (dist <= sp * t) ? "Yes" : "No" | a, v = gets.split(" ").map(&:to_i)
b, w = gets.split(" ").map(&:to_i)
t = gets.to_i
dist = (a-b).abs
sp = v - w
puts (dist <= sp * t) ? "YES" : "NO" | [
"literal.string.change",
"literal.string.case.change",
"call.arguments.change"
] | 367,587 | 367,588 | u016444909 | ruby |
p02646 | a,v = gets.chomp.split.map(&:to_i)
b,w = gets.chomp.split.map(&:to_i)
t = gets.chomp.to_i
if w >= v
puts 'NO'
exit
end
l = (a-b).abs
oi = l/(v-w)
if oi <= t
puts 'YES'
else
puts 'NO'
end
| a,v = gets.chomp.split.map(&:to_i)
b,w = gets.chomp.split.map(&:to_i)
t = gets.chomp.to_i
if w >= v
puts 'NO'
exit
end
l = (a-b).abs
oi = l.to_f/(v-w)
if oi <= t
puts 'YES'
else
puts 'NO'
end
| [
"call.add"
] | 367,733 | 367,734 | u195257137 | ruby |
p02646 | def lscan; gets.split.map(&:to_i); end
a,v = lscan
b,w = lscan
t = gets.to_i
if v <= w
puts 'NO'
else
d = (b-a).abs
u = v - w
if (d/u).to_r <= t
puts 'YES'
else
puts 'NO'
end
end | def lscan; gets.split.map(&:to_i); end
a,v = lscan
b,w = lscan
t = gets.to_i
if v <= w
puts 'NO'
else
d = (b-a).abs
u = v - w
if (d.to_r/u) <= t
puts 'YES'
else
puts 'NO'
end
end | [
"control_flow.branch.if.condition.change",
"call.add",
"call.remove"
] | 368,047 | 368,048 | u079330987 | ruby |
p02646 | def lscan; gets.split.map(&:to_i); end
a,v = lscan
b,w = lscan
t = gets.to_i
if v <= w
puts 'NO'
else
d = (b-a).abs
u = v - w
if (d/u) <= t
puts 'YES'
else
puts 'NO'
end
end | def lscan; gets.split.map(&:to_i); end
a,v = lscan
b,w = lscan
t = gets.to_i
if v <= w
puts 'NO'
else
d = (b-a).abs
u = v - w
if (d.to_r/u) <= t
puts 'YES'
else
puts 'NO'
end
end | [
"control_flow.branch.if.condition.change",
"call.add"
] | 368,049 | 368,048 | u079330987 | ruby |
p02646 | #exec({'RUBY_THREAD_VM_STACK_SIZE'=>'100000000'},'/usr/bin/ruby', $0) if !ENV['RUBY_THREAD_VM_STACK_SIZE']
require 'prime'
def inpf() a=gets.chomp.split(" ").map(&:to_f)end
def inps() a=gets.chomp.split(" ")end
def copy(a) Marshal.load(Marshal.dump(a)) end
def kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end
def na(n,d=0) Array.new(n,d)end
def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end
def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end
def inp() a=gets.chomp.split(" ").map(&:to_i)end
def r_up(a, b) (a+b-1)/b end
def sum(a) a.inject(:+) end
def big(a,b) return (a>b)? a:b end
def small(a,b) return (a<b)? a:b end
a,v = inp
b,w = inp
sa = (a-b).abs
t = inp[0]
puts ((v-w).abs*t >= sa)? "YES" : "NO"
| #exec({'RUBY_THREAD_VM_STACK_SIZE'=>'100000000'},'/usr/bin/ruby', $0) if !ENV['RUBY_THREAD_VM_STACK_SIZE']
require 'prime'
def inpf() a=gets.chomp.split(" ").map(&:to_f)end
def inps() a=gets.chomp.split(" ")end
def copy(a) Marshal.load(Marshal.dump(a)) end
def kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end
def na(n,d=0) Array.new(n,d)end
def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end
def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end
def inp() a=gets.chomp.split(" ").map(&:to_i)end
def r_up(a, b) (a+b-1)/b end
def sum(a) a.inject(:+) end
def big(a,b) return (a>b)? a:b end
def small(a,b) return (a<b)? a:b end
a,v = inp
b,w = inp
sa = (a-b).abs
t = inp[0]
puts ((v-w)*t >= sa)? "YES" : "NO"
| [
"call.remove"
] | 369,641 | 369,642 | u145123922 | ruby |
p02657 | A,B = gets.strip.split(nil).map(&:to_i)
s = A*B
put s | A,B = gets.strip.split(nil).map(&:to_i)
s = A*B
puts s | [
"misc.typo",
"identifier.change"
] | 370,528 | 370,529 | u313103408 | ruby |
p02657 | x,y = gets.map(&:to_i)
puts x*y | x,y = gets.split.map(&:to_i)
puts x*y | [
"call.add"
] | 370,554 | 370,555 | u529683866 | ruby |
p02657 | x,y = gets.to_i
puts x*y | x,y = gets.split.map(&:to_i)
puts x*y | [
"assignment.value.change",
"identifier.change",
"call.add"
] | 370,556 | 370,555 | u529683866 | ruby |
p02657 | a, b = gets.split(" ").map &:tp_i
puts a * b | a, b = gets.split(" ").map &:to_i
puts a * b | [
"assignment.value.change",
"call.arguments.change"
] | 370,645 | 370,646 | u341702138 | ruby |
p02657 | puts gets.split("\s").map(&:to_i).sum | p gets.split("\s").map(&:to_i).inject(:*) | [
"identifier.change",
"call.arguments.change",
"io.output.change",
"call.arguments.add"
] | 370,663 | 370,664 | u458429268 | ruby |
p02657 | a,b = gets.to_i
puts(a*b)
| a, b = gets.split.map(&:to_i)
puts(a*b)
| [
"assignment.value.change",
"identifier.change",
"call.add"
] | 370,796 | 370,797 | u246530341 | ruby |
p02657 | a,b = gets.to_i
puts (a*b)
| a, b = gets.split.map(&:to_i)
puts(a*b)
| [
"assignment.value.change",
"identifier.change",
"call.add"
] | 370,798 | 370,797 | u246530341 | ruby |
p02657 | numbers = input.gets.split(' ').map(&:to_i)
puts numbers[0] * numbers[1] | numbers = STDIN.gets.split(' ').map(&:to_i)
puts numbers[0] * numbers[1] | [
"assignment.value.change"
] | 370,809 | 370,810 | u748082312 | ruby |
p02657 | def main
content = gets.chomp
content.split.map(&:to_i)[0] * content.split.map(&:to_i)[1]
end
main | def main
content = gets.chomp
sum = content.split.map(&:to_i)[0] * content.split.map(&:to_i)[1]
puts sum
end
main | [
"call.add"
] | 370,832 | 370,833 | u849199882 | ruby |
p02657 | a,b = gets.split(' ').map.to_i
puts a*b | a, b = gets.chomp.split(' ').map(&:to_i)
puts a*b | [
"call.add",
"call.arguments.add"
] | 370,845 | 370,846 | u850924666 | ruby |
p02657 | a, b = $<.map &:to_i
p a * b | a, b = gets.split.map &:to_i
p a * b | [
"call.add"
] | 370,931 | 370,932 | u347948131 | ruby |
p02657 | a, b = gets.split.map(&to_i)
puts a * b | a, b = gets.split.map(&:to_i)
puts a * b
| [
"assignment.value.change",
"call.arguments.change"
] | 371,159 | 371,160 | u413815532 | ruby |
p02657 | a, b =gets.split.map(&:to_i)
puts a*5 | a, b =gets.split.map(&:to_i)
puts a*b | [
"identifier.replace.add",
"literal.replace.remove",
"call.arguments.change",
"io.output.change"
] | 371,261 | 371,262 | u684458716 | ruby |
p02658 | n = gets.to_i
a = gets.split.map(&:to_i)
ans = 1
MAX = 10 ** 18
a.each do |ai|
ans *= ai
if ans > MAX
puts -1
exit
end
end
puts ans
| n = gets.to_i
a = gets.split.map(&:to_i).sort
ans = a.shift
MAX = 10 ** 18
a.each do |ai|
ans *= ai
if ans > MAX
puts -1
exit
end
end
puts ans
| [
"call.add",
"assignment.value.change",
"identifier.replace.add",
"literal.replace.remove"
] | 371,886 | 371,887 | u503270460 | ruby |
p02658 | input = readlines()
total = input.shift().chomp.to_i
list = input.shift().chomp.split("\s").map{|x| x.to_i}
res = nil
list.each do |l|
if res.nil?
res = l
next
end
res *= l
if res > 10**18
puts '-1'
exit()
end
end
puts res | input = readlines()
total = input.shift().chomp.to_i
list = input.shift().chomp.split("\s").map{|x| x.to_i}
res = nil
list.sort().each do |l|
if res.nil?
res = l
next
end
res *= l
if res > 10**18
puts '-1'
exit()
end
end
puts res | [
"call.add"
] | 371,897 | 371,898 | u810199299 | ruby |
p02658 | n = gets.chomp.to_i
ai = gets.chomp.split.map(&:to_i)
INF = 10**18
ans = 1
ai.each do |a|
ans *= a
if ans>INF
ans = -1
break
end
end
p ans | n = gets.chomp.to_i
ai = gets.chomp.split.map(&:to_i).sort
INF = 10**18
ans = 1
ai.each do |a|
ans *= a
if ans>INF
ans = -1
break
end
end
p ans | [
"call.add"
] | 371,912 | 371,913 | u358554431 | ruby |
p02658 | #input of int(split by space)
def get_i()
return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
return bool ? y : n
end
#create of array
def array(size1,init=nil,size2=-1)
if size2==-1
return Array.new(size1){init}
else
return Array.new(size2){Array.new(size1){init}}
end
end
def max(a,b)
return a>b ? a : b
end
def min(a,b)
return a>b ? b : a
end
INF=Float::INFINITY
N=gets.to_i
A=get_i
ans=1
if A.include?(0)
puts 0
exit
end
A.each do|a|
ans*=a
if ans>=10**18
puts "-1"
exit
end
end
puts ans | #input of int(split by space)
def get_i()
return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
return bool ? y : n
end
#create of array
def array(size1,init=nil,size2=-1)
if size2==-1
return Array.new(size1){init}
else
return Array.new(size2){Array.new(size1){init}}
end
end
def max(a,b)
return a>b ? a : b
end
def min(a,b)
return a>b ? b : a
end
INF=Float::INFINITY
N=gets.to_i
A=get_i
ans=1
if A.include?(0)
puts 0
exit
end
A.each do|a|
ans*=a
if ans>10**18
puts "-1"
exit
end
end
puts ans | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 371,939 | 371,940 | u415400221 | ruby |
p02658 | ans_max = 10**18
N = gets.to_i
A = gets.chomp.split(' ').map(&:to_i)
if A.include?(0)
puts -1
exit
end
ans = 1
A.each do |a|
ans *= a
if ans > ans_max
puts -1
exit
end
end
puts ans
| ans_max = 10**18
N = gets.to_i
A = gets.chomp.split(' ').map(&:to_i)
if A.include?(0)
puts 0
exit
end
ans = 1
A.each do |a|
ans *= a
if ans > ans_max
puts -1
exit
end
end
puts ans
| [
"call.arguments.change",
"expression.operation.unary.remove"
] | 372,001 | 372,002 | u423966555 | ruby |
p02658 | gets
arr = gets.split.map(&:to_i)
multiplication = 1
if arr.include?(0)
p 0
else
arr.each do |a|
multiplication *= a
if multiplication > 10**18
p -1
return
end
end
end
| gets
arr = gets.split.map(&:to_i)
multiplication = 1
if arr.include?(0)
p 0
else
arr.each do |a|
multiplication *= a
if multiplication > 10**18
p -1
return
end
end
p multiplication
end
| [
"call.add"
] | 372,656 | 372,657 | u456038357 | ruby |
p02658 | n = gets.chomp.to_i
array = gets.split(' ')
if array.include?("0")
puts 0
exit
end
num = 10 ** 18
answer = 1
n.times do |i|
answer = answer * array[i].to_i
if num <= answer
puts "-1"
exit
end
end
puts answer | n = gets.chomp.to_i
array = gets.split(' ')
if array.include?("0")
puts 0
exit
end
num = 10 ** 18
answer = 1
n.times do |i|
answer = answer * array[i].to_i
if num < answer
puts "-1"
exit
end
end
puts answer | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 372,744 | 372,745 | u376596771 | ruby |
p02658 | N = gets.to_i
INF = 10**18
ans = 1
a = gets.split.map(&:to_i)
if a.include? 0 then
p 0
exit
end
a do |i|
ans *= i
if ans > INF then
ans = -1
break
end
end
p ans | N = gets.to_i
INF = 10**18
ans = 1
a = gets.split.map(&:to_i)
if a.include? 0 then
p 0
exit
end
a.each do |i|
ans *= i
if ans > INF then
ans = -1
break
end
end
p ans | [
"call.add"
] | 372,759 | 372,760 | u009976559 | ruby |
p02658 | gets.to_i
array = gets.chomp.split.map(&:to_i)
ans = 1
if array.include(0)
puts "0"
else
array.each do |i|
ans *= i
if ans > 10 ** 18
puts "-1"
return
end
end
puts ans
end
| gets.to_i
array = gets.chomp.split.map(&:to_i)
ans = 1
if array.include?(0)
puts 0
else
array.each do |i|
ans *= i
if ans > 10 ** 18
puts "-1"
return
end
end
puts ans
end
| [
"call.suffix.change",
"call.arguments.change"
] | 372,847 | 372,848 | u641383521 | ruby |
p02658 | gets.to_i
array = gets.chomp.split.map(&:to_i)
ans = 1
if array.include(0)
puts "0"
else
array.each do |i|
ans *= i
if ans > 10 ** 18
puts "-1"
return
else
next
end
end
puts ans
end
| gets.to_i
array = gets.chomp.split.map(&:to_i)
ans = 1
if array.include?(0)
puts 0
else
array.each do |i|
ans *= i
if ans > 10 ** 18
puts "-1"
return
end
end
puts ans
end
| [
"call.suffix.change",
"call.arguments.change"
] | 372,849 | 372,848 | u641383521 | ruby |
p02658 | gets.to_i
array = gets.chomp.split.map(&:to_i)
ans = 1
if array.include(0)
puts "0"
else
array.each do |i|
ans *= i
if ans > 10 ** 18
puts "-1"
return
end
end
puts ans
end
| gets.to_i
array = gets.chomp.split.map(&:to_i)
ans = 1
if array.include?(0)
puts "0"
else
array.each do |i|
ans *= i
if ans > 10 ** 18
puts "-1"
return
end
end
puts ans
end
| [
"call.suffix.change"
] | 372,847 | 372,851 | u641383521 | ruby |
p02658 | gets.to_i
array = gets.chomp.split.map(&:to_i)
ans = 1
if array.include(0)
puts "0"
else
array.each do |i|
ans *= i
if ans > 10 ** 18
puts "-1"
return
else
next
end
end
puts ans
end
| gets.to_i
array = gets.chomp.split.map(&:to_i)
ans = 1
if array.include?(0)
puts "0"
else
array.each do |i|
ans *= i
if ans > 10 ** 18
puts "-1"
return
end
end
puts ans
end
| [
"call.suffix.change"
] | 372,849 | 372,851 | u641383521 | ruby |
p02658 | a = gets.chomp.to_i
ary = gets.chomp.split(" ").map(&:to_i).sort
p ary
if ary.first == 0
puts 0
else
t = 1
ary.each do |v|
t *= v
if t > (10 ** 18)
t = -1
break
end
end
puts t
end | a = gets.chomp.to_i
ary = gets.chomp.split(" ").map(&:to_i).sort
if ary.first == 0
puts 0
else
t = 1
ary.each do |v|
t *= v
if t > (10 ** 18)
t = -1
break
end
end
puts t
end | [
"call.remove"
] | 372,871 | 372,872 | u126541218 | ruby |
p02658 | a = gets.chomp.to_i
ary = gets.chomp.split(" ").map(&:to_i)
t = 0
if ary.first == 0
puts 0
else
t = 1
ary.each do |v|
t *= v
if t > 10 ** 18
t = -1
break
end
end
puts t
end
| a = gets.chomp.to_i
ary = gets.chomp.split(" ").map(&:to_i).sort
if ary.first == 0
puts 0
else
t = 1
ary.each do |v|
t *= v
if t > (10 ** 18)
t = -1
break
end
end
puts t
end | [
"control_flow.branch.if.condition.change"
] | 372,873 | 372,872 | u126541218 | ruby |
p02658 | gets;
nums = gets.split(" ").map(&:to_i);
prod = 1;
if nums.select {|n| n == 0} then
puts "0";
exit;
end
nums.each { |n|
prod = prod * n ;
if prod >= 10**2 then
puts "-1";
exit;
end
};
puts prod; | gets;
nums = gets.split(" ").map(&:to_i);
prod = 1;
if nums.find {|n| n === 0} then
puts "0";
exit;
end
nums.each { |n|
prod = prod * n ;
if prod > 10**18 then
puts "-1";
exit;
end
};
puts prod; | [
"identifier.change",
"control_flow.branch.if.condition.change",
"expression.operator.compare.change",
"literal.number.integer.change"
] | 372,937 | 372,938 | u624687014 | ruby |
p02658 | gets
A=gets.split.map(&:to_i)
if A.any? &:zero?
p 0
else
A.inject(1){|s,i|if 10**18<s*=i
p -1
exit(0)
else s end}
end | gets
A=gets.split.map(&:to_i)
if A.any? &:zero?
p 0
else
p A.inject(1){|s,i|if 10**18<s*=i
p -1
exit(0)
else s end}
end | [
"io.output.change",
"call.add"
] | 372,951 | 372,952 | u647875062 | ruby |
p02658 | n = gets.to_i
a = gets.split.map(&:to_i)
ans = 1
a.each do |x|
ans *= x
if ans > 10**18
puts -1
exit
end
end
puts ans | n = gets.to_i
a = gets.split.map(&:to_i)
ans = 1
a.sort.each do |x|
ans *= x
if ans > 10**18
puts -1
exit
end
end
puts ans | [
"call.add"
] | 373,437 | 373,438 | u392423112 | ruby |
p02658 | n = gets.to_i
a = gets.split.map(&:to_i)
ans = 1
a.each do |x|
ans *= x
if x > 10**18
puts -1
exit
end
end
puts ans | n = gets.to_i
a = gets.split.map(&:to_i)
ans = 1
a.sort.each do |x|
ans *= x
if ans > 10**18
puts -1
exit
end
end
puts ans | [
"call.add",
"identifier.change",
"control_flow.branch.if.condition.change"
] | 373,439 | 373,438 | u392423112 | ruby |
p02658 | n = gets.to_s.to_i
a = gets.to_s.split
if a.include?('0')
puts 0
exit
end
a = a.split.map{|e|e.to_i}
ans = 1
inf = 10 ** 18
a.each do |t|
ans *= t
if ans > inf
puts "-1"
exit
end
end
puts ans | n = gets.to_s.to_i
a = gets.to_s.split
if a.include?('0')
puts 0
exit
end
a.map!{|e|e.to_i}
ans = 1
inf = 10 ** 18
a.each do |t|
ans *= t
if ans > inf
puts "-1"
exit
end
end
puts ans | [
"identifier.change",
"call.remove"
] | 373,687 | 373,688 | u693378622 | ruby |
p02658 | N = gets.to_i
A = gets.split.map(&:to_i)
mul = 1
if A.index(0)
puts '0'
exit
end
N.times do |i|
if mul >= 10**18 / A[i]
puts '-1'
exit
end
mul *= A[i]
end
puts mul | N = gets.to_i
A = gets.split.map(&:to_i)
mul = 1
if A.index(0)
puts '0'
exit
end
N.times do |i|
if mul > 10**18 / A[i]
puts '-1'
exit
end
mul *= A[i]
end
puts mul | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 373,987 | 373,988 | u600938792 | ruby |
p02658 | gets.to_i
as=gets.split.map &:to_i
c=1
if as.include?(0)
p 0
else
as.each do |a|
c=a*c
if c>10**18
p -1
return
end
end
end
p c | gets.to_i
as=gets.split.map &:to_i
c=1
if as.include?(0)
p 0
else
as.each do |a|
c=a*c
if c>10**18
puts -1
return
end
end
puts c
end
| [
"call.function.change",
"io.output.change",
"call.remove"
] | 374,355 | 374,356 | u128694188 | ruby |
p02658 | n = gets.chomp.to_i
a = gets.chomp.split().map(&:to_i)
b = 1
i = 0
c = false
for i in 0..n-1
b = b * a[i]
if b > 1000000000000000000
c = true
print -1
break
end
end
if !c
print b
end
| n = gets.chomp.to_i
a = gets.chomp.split().map(&:to_i)
a.sort!
b = 1
i = 0
c = false
for i in 0..n-1
b = b * a[i]
if b > 1000000000000000000
c = true
print '-1'
break
end
end
if !c
print b
end
| [
"call.add",
"call.arguments.change"
] | 374,484 | 374,485 | u470192783 | ruby |
p02658 | n = gets.chomp.to_i
a = gets.chomp.split().map(&:to_i)
a.sort!
b = 1
i = 0
c = false
for i in 0..n-1
b = b * a[i]
if b > 1000000000000000000
c = true
print -1
end
end
if !c
print b
end | n = gets.chomp.to_i
a = gets.chomp.split().map(&:to_i)
a.sort!
b = 1
i = 0
c = false
for i in 0..n-1
b = b * a[i]
if b > 1000000000000000000
c = true
print '-1'
break
end
end
if !c
print b
end
| [
"call.arguments.change",
"control_flow.break.add"
] | 374,486 | 374,485 | u470192783 | ruby |
p02658 | N = gets.to_i
a = []
a = gets.split.map(&:to_i)
a = a.sort
if N==2
if a[0]*a[1] > 10**18
puts -1
else
puts a[0]*a[1]
end
exit
end
if N % 2 == 1
ans = a[N/2]
else
ans = 1
end
(N/2).times do |i|
ans = ans * (a[i] * a[N-1-i])
if ans == 0
puts 0
exit
end
if ans > 10**18
puts -1
exit
end
end | N = gets.to_i
a = []
a = gets.split.map(&:to_i)
a = a.sort
if N==2
if a[0]*a[1] > 10**18
puts -1
else
puts a[0]*a[1]
end
exit
end
if N % 2 == 1
ans = a[N/2]
else
ans = 1
end
(N/2).times do |i|
ans = ans * (a[i] * a[N-1-i])
if ans == 0
puts 0
exit
end
if ans > 10**18
puts -1
exit
end
end
puts ans
| [
"call.add"
] | 374,714 | 374,715 | u326288614 | ruby |
p02658 | # -*- coding: utf-8 -*-
n = gets.to_i
a = gets.chomp.split(" ")
ans = 1
for i in 0..n-1
x = a[i].to_i
ans *= x
if ans > 1000000000000000000
puts "-1"
exit
end
end
puts ans
| # -*- coding: utf-8 -*-
n = gets.to_i
a = gets.chomp.split(" ")
a = a.sort
ans = 1
for i in 0..n-1
x = a[i].to_i
ans *= x
if ans > 1000000000000000000
puts "-1"
exit
end
end
puts ans | [
"assignment.add"
] | 375,099 | 375,100 | u287015418 | ruby |
p02658 | n = gets.strip.to_i
nums = gets.strip.split(" ").map do |i|
i.to_i
end
ans = 1
flag = true
ans = 0 if nums.include(0)
n.times{|i|
ans *= nums[i] if flag
flag = false if ans!=-1 && ans > 10**18
ans = -1 unless flag
}
puts ans if flag
puts (-1) unless flag
| n = gets.strip.to_i
nums = gets.strip.split(" ").map do |i|
i.to_i
end
ans = 1
flag = true
ans = 0 if nums.include?(0)
n.times{|i|
ans *= nums[i] if flag
flag = false if ans!=-1 && ans > 10**18
ans = -1 unless flag
}
puts ans if flag
puts (-1) unless flag
| [
"call.suffix.change"
] | 375,116 | 375,117 | u262392777 | ruby |
p02658 | n = gets.to_i
arr = gets.split.map(&:to_i)
res = 1
p 0 if arr.include?(0)
arr.each do |i|
res *= i
p -1 and return if res > 1000000000000000000
end
p res | n = gets.to_i
arr = gets.split.map(&:to_i)
res = 1
p 0 and return if arr.include?(0)
arr.each do |i|
res *= i
p -1 and return if res > 1000000000000000000
end
p res | [
"expression.operation.binary.add"
] | 375,170 | 375,171 | u617691573 | ruby |
p02658 | # frozen_string_literal: true
_n = gets.chomp.to_i
a = gets.chomp.split(' ').map(&:to_i)
MAX = 10**18
if a.any?(&:zero?)
puts '-1'
exit
end
ans = a.reduce do |acm, ai|
new_acm = acm * ai
if new_acm > MAX
puts '-1'
exit
end
new_acm
end
puts ans
| # frozen_string_literal: true
_n = gets.chomp.to_i
a = gets.chomp.split(' ').map(&:to_i)
MAX = 10**18
if a.any?(&:zero?)
puts 0
exit
end
ans = a.reduce do |acm, ai|
new_acm = acm * ai
if new_acm > MAX
puts '-1'
exit
end
new_acm
end
puts ans
| [
"call.arguments.change"
] | 375,359 | 375,360 | u344542101 | ruby |
p02658 | n = readline.to_i
a = readline.split.map(&:to_i)
answer = a.reduce do |result, item|
result *= item
break -1 if result > 10 ** 18
result
end
print(answer)
| n = readline.to_i
a = readline.split.map(&:to_i).sort
answer = a.reduce do |result, item|
result *= item
break -1 if result > 10 ** 18
result
end
print(answer)
| [
"call.add"
] | 375,437 | 375,438 | u214887789 | ruby |
p02658 | M=10**18
n,*as=$<.read.split.map &:to_i
puts as.reduce(1){|s,e| s*=e; break -1 if s>M; s } | M=10**18
n,*as=$<.read.split.map &:to_i
puts as.sort.reduce(1){|s,e| s*=e; break -1 if s>M; s } | [
"call.add"
] | 375,949 | 375,950 | u567677663 | ruby |
p02658 | #exec({'RUBY_THREAD_VM_STACK_SIZE'=>'100000000'},'/usr/bin/ruby', $0) if !ENV['RUBY_THREAD_VM_STACK_SIZE']
require 'prime'
def inpf() a=gets.chomp.split(" ").map(&:to_f)end
def inps() a=gets.chomp.split(" ")end
def copy(a) Marshal.load(Marshal.dump(a)) end
def kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end
def na(n,d=0) Array.new(n,d)end
def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end
def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end
def inp() a=gets.chomp.split(" ").map(&:to_i)end
def r_up(a, b) (a+b-1)/b end
def sum(a) a.inject(:+) end
def big(a,b) return (a>b)? a:b end
def small(a,b) return (a<b)? a:b end
n = inp[0]
a = inp
ans = 1
a.each do |d|
ans *= d
if(ans > 10**18)
p -1
exit
end
end
p ans
| #exec({'RUBY_THREAD_VM_STACK_SIZE'=>'100000000'},'/usr/bin/ruby', $0) if !ENV['RUBY_THREAD_VM_STACK_SIZE']
require 'prime'
def inpf() a=gets.chomp.split(" ").map(&:to_f)end
def inps() a=gets.chomp.split(" ")end
def copy(a) Marshal.load(Marshal.dump(a)) end
def kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end
def na(n,d=0) Array.new(n,d)end
def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end
def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end
def inp() a=gets.chomp.split(" ").map(&:to_i)end
def r_up(a, b) (a+b-1)/b end
def sum(a) a.inject(:+) end
def big(a,b) return (a>b)? a:b end
def small(a,b) return (a<b)? a:b end
n = inp[0]
a = inp.sort
ans = 1
a.each do |d|
ans *= d
if(ans > 10**18)
p -1
exit
end
end
p ans
| [
"call.add"
] | 376,331 | 376,332 | u145123922 | ruby |
p02658 | _ = gets.to_i
a = gets.split.map(&:to_i)
if a.include?(0)
puts 0
exit
end
p = 1
a.each do |aa|
p *= aa
if p > 10*18
p = -1
break
end
end
puts p | _ = gets.to_i
a = gets.split.map(&:to_i)
if a.include?(0)
puts 0
exit
end
p = 1
a.each do |aa|
p *= aa
if p > 10**18
p = -1
break
end
end
puts p | [
"control_flow.branch.if.condition.change"
] | 376,379 | 376,380 | u374765295 | ruby |
p02659 | #input of int(split by space)
def get_i()
return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
return bool ? y : n
end
#create of array
def array(size1,init=nil,size2=-1)
if size2==-1
return Array.new(size1){init}
else
return Array.new(size2){Array.new(size1){init}}
end
end
def max(a,b)
return a>b ? a : b
end
def min(a,b)
return a>b ? b : a
end
INF=Float::INFINITY
a,b=get_f
a=a.to_i
b=(b*100).to_i
puts ((a*b)/100) | #input of int(split by space)
def get_i()
return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
return bool ? y : n
end
#create of array
def array(size1,init=nil,size2=-1)
if size2==-1
return Array.new(size1){init}
else
return Array.new(size2){Array.new(size1){init}}
end
end
def max(a,b)
return a>b ? a : b
end
def min(a,b)
return a>b ? b : a
end
INF=Float::INFINITY
a,b=get_f
a=a.to_i
b=(b*1000).to_i
puts ((a*b)/1000).floor | [
"literal.number.integer.change",
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.change",
"call.add"
] | 376,702 | 376,703 | u415400221 | ruby |
p02659 | a, b = gets.strip.split
a = a.to_i
b = b.delete('.').to_i
ans = (a * b * 0.01).floor
puts ans
| a, b = gets.strip.split
a = a.to_i
b = b.delete('.').to_i
ans = (a * b) / 100
puts ans
| [
"expression.operation.binary.remove"
] | 376,813 | 376,814 | u969729424 | ruby |
p02659 | a, b = gets.split.map(:to_r)
puts (a*b).to_i | a, b = gets.split.map(&:to_r)
puts (a*b).to_i | [
"call.arguments.change"
] | 376,869 | 376,870 | u358554431 | ruby |
p02659 | require 'bigdecimal'
a, b = gets.split.map(&:to_d)
puts (a * b).to_i
| require 'bigdecimal'
require 'bigdecimal/util'
a, b = gets.split.map(&:to_d)
puts (a * b).to_i
| [
"call.add"
] | 376,998 | 376,999 | u093372948 | ruby |
p02659 | a, b = gets.split
a = a.to_i
b = (b.to_f * 100).to_i
puts a * b / 100
| a, b = gets.split
a = a.to_i
b = (b.delete(".")).to_i
puts a * b / 100
| [
"call.arguments.add"
] | 377,139 | 377,140 | u503270460 | ruby |
p02659 | input = gets.chomp.split(' ').map(&:to_f)
answer = input[0]*input[1]
p answer.floor
| input = gets.chomp.split(' ').map(&:to_r)
answer = input[0]*input[1]
p answer.floor
| [
"assignment.value.change",
"call.arguments.change"
] | 377,521 | 377,522 | u793187611 | ruby |
p02659 | require 'bigdecimal'
a, b = gets.split
(BigDecimal((a).to_s) * BigDecimal(b)).floor | require 'bigdecimal'
a, b = gets.split
print (BigDecimal((a).to_s) * BigDecimal(b)).floor | [
"io.output.change",
"call.add"
] | 377,523 | 377,524 | u636724518 | ruby |
p02659 | a, b = gets.chomp.split.map(&:to_f)
print (a*b).to_i | a, b = gets.chomp.split.map(&:to_r)
mul = (a*b).to_i
print mul | [
"assignment.value.change",
"call.arguments.change",
"assignment.variable.change",
"call.add"
] | 377,547 | 377,548 | u896269838 | ruby |
p02659 | a,b = gets.split(' ').map(&:to_f)
puts (a*b.to_r).to_i | a,b = gets.split(' ').map(&:to_r)
puts (a*b).to_i | [
"assignment.value.change",
"call.arguments.change",
"call.remove"
] | 377,791 | 377,792 | u932417742 | ruby |
p02659 | a,b = gets.split(' ').map(&:to_f)
puts (a*b).floor | a,b = gets.split(' ').map(&:to_r)
puts (a*b).to_i | [
"assignment.value.change",
"call.arguments.change",
"identifier.change",
"io.output.change"
] | 377,793 | 377,792 | u932417742 | ruby |
p02659 | require 'bigdecimal'
A, B = gets.chomp.split
puts (A*BigDecimal(B)).to_i | require 'bigdecimal'
A, B = gets.chomp.split
puts (BigDecimal(A)*BigDecimal(B)).to_i
| [
"call.add",
"call.arguments.change"
] | 377,800 | 377,801 | u066172831 | ruby |
p02659 | a, b = gets.split.map(&:to_f)
puts (a * b + 0.001).floor
| a, b = gets.split.map(&:to_r)
puts (a * b).floor
| [
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.remove"
] | 377,881 | 377,882 | u889326464 | ruby |
p02659 | a, b = gets.split.map(&:to_f)
puts (a * b + 0.01).floor
| a, b = gets.split.map(&:to_r)
puts (a * b).floor
| [
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.remove"
] | 377,883 | 377,882 | u889326464 | ruby |
p02659 | a, b = gets.split.map(&:to_f)
puts (a * b).floor
| a, b = gets.split.map(&:to_r)
puts (a * b).floor
| [
"assignment.value.change",
"call.arguments.change"
] | 377,884 | 377,882 | u889326464 | ruby |
p02659 | a, b = gets.split
b = b.split(".").join("").to_i
puts (a.to_i * b).floor
| a, b = gets.split
b = b.split(".").join("").to_i
puts (a.to_i * b / 100).floor
| [
"expression.operation.binary.add"
] | 377,885 | 377,886 | u889326464 | ruby |
p02659 | nums = gets.split(" ");
puts (nums[0].to_i * nums[1].to_f).floor | nums = gets.split(" ");
puts (nums[0].to_i * nums[1].to_r).floor | [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 378,367 | 378,368 | u624687014 | ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.