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 |
|---|---|---|---|---|---|---|---|
p02731
|
p gets**3/27
|
p gets.to_f**3/27
|
[
"call.add"
] | 509,065
| 509,066
|
u641976689
|
ruby
|
p02731
|
l = gets.chomp.to_i
puts ((l / 3) ** 3)
|
l = gets.chomp.to_i
puts (l.fdiv(3) ** 3)
|
[
"call.arguments.change",
"expression.operation.binary.change",
"call.add"
] | 509,630
| 509,631
|
u895926909
|
ruby
|
p02731
|
l = gets.to_i
M = l / 3
ANS = M**3
puts ANS
|
l = gets.to_f
M = l / 3
ANS = M**3
puts ANS
|
[
"call.function.change",
"type_conversion.to_float.change",
"type_conversion.to_number.change"
] | 509,952
| 509,953
|
u949425889
|
ruby
|
p02731
|
l = gets.chomp.to_i
small = l / 3
large = l - 2 * small
puts small * small * large
|
l = gets.chomp.to_f
small = l / 3
large = l - 2 * small
puts small * small * large
|
[
"call.function.change",
"type_conversion.to_float.change",
"type_conversion.to_number.change"
] | 509,976
| 509,977
|
u757358412
|
ruby
|
p02731
|
l = gets.to_i
a = l / 3
b = a
c = a
a += l - (a + b + c)
puts a * b * c
|
l = gets.to_f
a = l / 3.0
b = a
c = a
a += l - (a + b + c)
puts a * b * c
|
[
"call.function.change",
"type_conversion.to_float.change",
"type_conversion.to_number.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 509,991
| 509,992
|
u315984289
|
ruby
|
p02731
|
L=gets.to_i
len = L / 3
puts len * len * len
|
L=gets.to_i
len = L / 3.0
puts len * len * len
|
[
"assignment.value.change",
"expression.operation.binary.change"
] | 510,018
| 510,019
|
u645787471
|
ruby
|
p02731
|
L = input.chomp.to_f
print (L / 3) ** 3
|
L = gets.chomp.to_f
print (L / 3) ** 3
|
[
"assignment.value.change",
"identifier.change"
] | 510,072
| 510,073
|
u208303341
|
ruby
|
p02731
|
L = gets.chomp.to_i
print (L / 3) ** 3
|
L = gets.chomp.to_f
print (L / 3) ** 3
|
[
"call.function.change",
"type_conversion.to_float.change",
"type_conversion.to_number.change"
] | 510,074
| 510,073
|
u208303341
|
ruby
|
p02732
|
n = gets.chomp.to_i
a = gets.chomp.split(" ").map(&:to_i)
hash = Hash.new(0)
a.each do |i|
hash[i] += 1
end
hash_2 = Hash.new(0)
arr = Array.new(n+1,0)
count = 0
hash.each do |i|
#p i
ans = (i[1] * (i[1] - 1)) / 2
hash_2[i[0]] = ans
#p ans
count += ans
end
p hash_2
a.each do |j|
point = hash_2[j]
# p point
# puts "UU"
# p j
sa_1 = (hash[j] * (hash[j] - 1)) / 2
#p sa_1
sa_2 = [((hash[j]-1) * (hash[j] - 2)) / 2,0].max
#p sa_2
count = count - sa_1 + sa_2
puts count
count = count + (sa_1 - sa_2)
#puts count
#puts "KKK"
end
|
n = gets.chomp.to_i
a = gets.chomp.split(" ").map(&:to_i)
hash = Hash.new(0)
a.each do |i|
hash[i] += 1
end
hash_2 = Hash.new(0)
arr = Array.new(n+1,0)
count = 0
hash.each do |i|
ans = (i[1] * (i[1] - 1)) / 2
hash_2[i[0]] = ans
count += ans
end
a.each do |j|
point = hash_2[j]
sa_1 = (hash[j] * (hash[j] - 1)) / 2
sa_2 = [((hash[j]-1) * (hash[j] - 2)) / 2,0].max
count = count - sa_1 + sa_2
puts count
count = count + (sa_1 - sa_2)
end
|
[
"call.remove"
] | 510,890
| 510,891
|
u412789323
|
ruby
|
p02732
|
n = gets.chomp.to_i
a = gets.chomp.split(" ").map(&:to_i)
hash = Hash.new(0)
a.each do |i|
hash[i] += 1
end
hash_2 = Hash.new(0)
arr = Array.new(n+1,0)
count = 0
hash.each do |i|
#p i
ans = (i[1] * (i[1] - 1)) / 2
hash_2[i[0]] = ans
#p ans
count += ans
end
p hash_2
a.each do |j|
point = hash_2[j]
# p point
# puts "UU"
# p j
sa_1 = (hash[j] * (hash[j] - 1)) / 2
#p sa_1
sa_2 = [((hash[j]-1) * (hash[j] - 2)) / 2,0].max
#p sa_2
count = count - sa_1 + sa_2
puts count
count = count + (sa_1 - sa_2)
#puts count
#puts "KKK"
end
|
n = gets.chomp.to_i
a = gets.chomp.split(" ").map(&:to_i)
hash = Hash.new(0)
a.each do |i|
hash[i] += 1
end
hash_2 = Hash.new(0)
arr = Array.new(n+1,0)
count = 0
hash.each do |i|
#p i
ans = (i[1] * (i[1] - 1)) / 2
hash_2[i[0]] = ans
#p ans
count += ans
end
#p hash_2
a.each do |j|
point = hash_2[j]
# p point
# puts "UU"
# p j
sa_1 = (hash[j] * (hash[j] - 1)) / 2
#p sa_1
sa_2 = [((hash[j]-1) * (hash[j] - 2)) / 2,0].max
#p sa_2
count = count - sa_1 + sa_2
puts count
count = count + (sa_1 - sa_2)
#puts count
#puts "KKK"
end
|
[
"call.remove"
] | 510,890
| 510,892
|
u412789323
|
ruby
|
p02732
|
n = gets.to_i
b = gets.split(' ').map(&:to_i)
a = b.sort
#puts a
carry1 = Array.new(n+1,0)
#line = gets.split(' ').map(&:to_i)
carry2 = Array.new(n+1,0)
ans = 0
count = 1
for i in 0..n-2
if a[i] == a[i+1]
count +=1
else
if count > 1
carry1[a[i]] = count * (count-1) /2
carry2[a[i]] = (count-1) * (count-2) /2
end
count = 1
end
end
if count > 1
carry1[a[i]] = count * (count-1) /2
carry2[a[i]] = (count-1) * (count-2) /2
end
ans = 0
for i in 0..n-1
ans += carry1[i]
end
for i in 0..n-1
puts ans - carry1[b[i]] + carry2[b[i]]
end
|
n = gets.to_i
b = gets.split(' ').map(&:to_i)
a = b.sort
#puts a
carry1 = Array.new(n+1,0)
#line = gets.split(' ').map(&:to_i)
carry2 = Array.new(n+1,0)
ans = 0
count = 1
count2 = 0
for i in 0..n-2
if a[i] == a[i+1]
count +=1
# count2 = count if i == n-2
else
if count > 1
carry1[a[i]] = count * (count-1) /2
carry2[a[i]] = (count-1) * (count-2) /2
end
count = 1
end
end
if count > 1
carry1[a[i]] = count * (count-1) /2
carry2[a[i]] = (count-1) * (count-2) /2
end
ans = 0
for i in 0..n
ans += carry1[i]
end
for i in 0..n-1
puts ans - carry1[b[i]] + carry2[b[i]]
end
|
[
"expression.operation.binary.remove"
] | 512,060
| 512,061
|
u387173453
|
ruby
|
p02732
|
def xc2(x)
return 0 if x <= 1
return x*(x-1)/2
end
n=gets.chomp.to_i
x=Array.new(n,0)
a=gets.chomp.split(" ").map{|i|i.to_i}
a.each{|i|x[i] += 1}
y=x.map{|i|xc2(i)}
sum=0
y.map{|i|sum += i}
0.upto(n-1) do |k|
puts sum - (1*y[a[k]] - xc2(x[a[k]]-1))
end
|
def xc2(x)
return 0 if x <= 1
return x*(x-1)/2
end
n=gets.chomp.to_i
x=Array.new(n+1,0)
a=gets.chomp.split(" ").map{|i|i.to_i}
a.each{|i|x[i] += 1}
y=x.map{|i|xc2(i)}
sum=0
y.map{|i|sum += i}
0.upto(n-1) do |k|
puts sum - (1*y[a[k]] - xc2(x[a[k]]-1))
end
|
[
"assignment.change"
] | 513,373
| 513,374
|
u742129941
|
ruby
|
p02732
|
def xc2(x)
return 0 if x <= 1
return x*(x-1)/2
end
n=gets.chomp.to_i
x=Array.new(n,0)
a=gets.chomp.split(" ").map{|i|i.to_i}
a.each{|i|x[i] += 1}
y=x.map{|i|xc2(i)}
sum=0
y.map{|i|sum += i}
0.upto(n-1) do |k|
puts sum - (1*y[a[k]] - xc2(x[a[k]]-1))
end
|
def xc2(x)
return 0 if x <= 1
return x*(x-1)/2
end
n=gets.chomp.to_i
x=Array.new(n+1,0)
a=gets.chomp.split(" ").map{|i|i.to_i}
a.each{|i|x[i] += 1}
y=x.map{|i|xc2(i)}
sum=0
y.map{|i|sum += i}
0.upto(n-1) do |k|
puts sum - (1*y[a[k]] - xc2(x[a[k]]-1))
end
|
[
"assignment.change"
] | 513,375
| 513,374
|
u742129941
|
ruby
|
p02720
|
n = gets.to_i
queue = Queue.new
queue << 1 << 2 << 3 << 4 << 5 << 6 << 7 << 8 << 9
for i in 1..n do
x = queue.pop
if x % 10 != 0
queue << 10 * x + x % 10 - 1
end
queue << 10 * x + x % 10
if
queue << 10 * x + x % 10 + 1
end
end
puts x
|
n = gets.to_i
queue = Queue.new
queue << 1 << 2 << 3 << 4 << 5 << 6 << 7 << 8 << 9
for i in 1..n do
x = queue.pop
if x % 10 != 0
queue << 10 * x + x % 10 - 1
end
queue << 10 * x + x % 10
if x % 10 != 9
queue << 10 * x + x % 10 + 1
end
end
puts x
|
[
"control_flow.branch.if.condition.change"
] | 515,448
| 515,449
|
u062655521
|
ruby
|
p02741
|
arr = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
n = gets.to_i
arr[n]
|
arr = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
n = gets.to_i
puts arr[n-1]
|
[
"io.output.change",
"call.add"
] | 517,429
| 517,430
|
u306465660
|
ruby
|
p02741
|
arr = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
n = gets.to_i
arr[n-1]
|
arr = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
n = gets.to_i
puts arr[n-1]
|
[
"io.output.change",
"call.add"
] | 517,431
| 517,430
|
u306465660
|
ruby
|
p02741
|
k = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
puts k[gets.to_i+1]
|
k = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
puts k[gets.to_i-1]
|
[
"misc.opposites",
"expression.operator.arithmetic.change",
"variable_access.subscript.index.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 517,648
| 517,649
|
u426607889
|
ruby
|
p02741
|
k = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
puts k[gets.to_i]
|
k = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
puts k[gets.to_i-1]
|
[
"expression.operation.binary.add"
] | 517,650
| 517,649
|
u426607889
|
ruby
|
p02741
|
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = gets.to_i
put a[k - 1]
|
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = gets.to_i
puts a[k - 1]
|
[
"misc.typo",
"identifier.change"
] | 517,815
| 517,816
|
u962609087
|
ruby
|
p02741
|
d = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = gets.to_i
puts d[k]
|
d = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = gets.to_i
puts d[k-1]
|
[
"expression.operation.binary.add"
] | 518,094
| 518,095
|
u753851577
|
ruby
|
p02742
|
h,w=gets.split.map(&:to_i)
if h==1 || w==1
puts 1
end
sum=0
if h%2==0
puts h/2*w
else
puts h/2*w+(w+2-1)/2
end
|
h,w=gets.split.map(&:to_i)
if h==1 || w==1
puts 1
return
end
sum=0
if h%2==0
puts h/2*w
else
puts h/2*w+(w+2-1)/2
end
|
[
"control_flow.return.add"
] | 518,586
| 518,587
|
u556046719
|
ruby
|
p02742
|
hw = gets.split(' ').map(&:to_i)
h = hw[0]
w = hw[1]
h_move = (w/2.0).ceil
h_move2 = ((w-1)/2.0).ceil
if h == 1 then
print "1"
elsif h % 2 == 0 then
total = (h_move+h_move2) * (h/2.0).floor
print total.to_s
else
total = (h_move+h_move2) * (h/2.0).floor
total += h_move
print total.to_s
end
|
hw = gets.split(' ').map(&:to_i)
h = hw[0]
w = hw[1]
h_move = (w/2.0).ceil
h_move2 = ((w-1)/2.0).ceil
if h == 1 || w == 1 then
print "1"
elsif h % 2 == 0 then
total = (h_move+h_move2) * (h/2.0).floor
print total.to_s
else
total = (h_move+h_move2) * (h/2.0).floor
total += h_move
print total.to_s
end
|
[
"control_flow.branch.if.condition.change"
] | 519,124
| 519,125
|
u014800961
|
ruby
|
p02742
|
h, w = gets.chomp.split.map(&:to_i)
puts (h == 1 || w == 1)? "0" : (h * w + 1) / 2
|
h, w = gets.chomp.split.map(&:to_i)
puts (h == 1 || w == 1)? "1" : (h * w + 1) / 2
|
[
"literal.string.change",
"call.arguments.change"
] | 519,208
| 519,209
|
u482840940
|
ruby
|
p02742
|
h, w = gets.split(" ").map(&:to_i)
if h == 1 || w == 1
puts 1
elsif (h * w) % 2 == 0
puts h * w / 2
elsif
puts ((h * w) - 1) / 2
end
|
h, w = gets.split(" ").map(&:to_i)
if h == 1 || w == 1
puts 1
elsif (h * w) % 2 == 0
puts h * w / 2
elsif
puts ((h * w) - 1) / 2 + 1
end
|
[
"control_flow.branch.if.condition.change"
] | 519,311
| 519,312
|
u748406041
|
ruby
|
p02742
|
h, w = gets.split(" ").map(&:to_i)
if h == 1 || w == 1
puts 0
elsif (h * w) % 2 == 0
puts h * w / 2
elsif
puts ((h * w) - 1) / 2
end
|
h, w = gets.split(" ").map(&:to_i)
if h == 1 || w == 1
puts 1
elsif (h * w) % 2 == 0
puts h * w / 2
elsif
puts ((h * w) - 1) / 2 + 1
end
|
[
"literal.number.integer.change",
"call.arguments.change",
"control_flow.branch.if.condition.change"
] | 519,313
| 519,312
|
u748406041
|
ruby
|
p02742
|
h,w=gets.split.map(&:to_i)
puts h==1 && w==1 ? 1 : (h*w+1)/2
|
h,w=gets.split.map(&:to_i)
puts h==1 || w==1 ? 1 : (h*w+1)/2
|
[
"misc.opposites",
"control_flow.branch.if.condition.change"
] | 520,189
| 520,190
|
u124214522
|
ruby
|
p02742
|
H, W = gets.chomp.split.map(&:to_i)
area = (H * W).to_i
area_half = (area / 2).to_i
if H == 1 || W == 1 || area == 2
puts 0
elsif area.even?
puts area_half
elsif !area.even?
puts (area_half) + 1
end
|
H, W = gets.chomp.split.map(&:to_i)
area = (H * W).to_i
area_half = (area / 2).to_i
if H == 1 || W == 1 || area == 2
puts 1
elsif area.even?
puts area_half
elsif !area.even?
puts (area_half) + 1
end
|
[
"literal.number.integer.change",
"call.arguments.change"
] | 520,203
| 520,204
|
u668278891
|
ruby
|
p02742
|
H, W = gets.chomp.split.map(&:to_i)
area = (H * W).to_i
area_half = (area / 2).to_i
if H == 1 || W == 1
puts 0
elsif area == 2 || 1
puts 0
elsif area.even?
puts area_half
elsif !area.even?
puts (area_half) + 1
end
|
H, W = gets.chomp.split.map(&:to_i)
area = (H * W).to_i
area_half = (area / 2).to_i
if H == 1 || W == 1 || area == 2
puts 1
elsif area.even?
puts area_half
elsif !area.even?
puts (area_half) + 1
end
|
[
"call.arguments.change",
"control_flow.branch.if.condition.change",
"call.remove"
] | 520,205
| 520,204
|
u668278891
|
ruby
|
p02742
|
a=gets.chomp.split.map(&:to_i)
b=0
if a[0]==1&&a[1]==1
puts 0
else
if a[0]%2==0&&a[1]%2==0
puts a[0]*a[1]/2
elsif a[0]%2==0&&a[1]%2!=0
puts (a[0]*(a[1]-1)/2)+(a[0]-a[0]/2)
elsif a[1]%2==0&&a[0]%2!=0
puts (a[1]*(a[0]-1)/2)+(a[1]-a[1]/2)
else puts (a[1]-1)*(a[0]-1)/2+(a[1]-a[1]/2)+(a[0]-a[0]/2)-1
end
end
|
a=gets.chomp.split.map(&:to_i)
b=0
if a[0]==1||a[1]==1
puts 1
else
if a[0]%2==0&&a[1]%2==0
puts a[0]*a[1]/2
elsif a[0]%2==0&&a[1]%2!=0
puts (a[0]*(a[1]-1)/2)+(a[0]-a[0]/2)
elsif a[1]%2==0&&a[0]%2!=0
puts (a[1]*(a[0]-1)/2)+(a[1]-a[1]/2)
else puts (a[1]-1)*(a[0]-1)/2+(a[1]-a[1]/2)+(a[0]-a[0]/2)-1
end
end
|
[
"misc.opposites",
"control_flow.branch.if.condition.change",
"literal.number.integer.change",
"call.arguments.change"
] | 520,263
| 520,264
|
u175113369
|
ruby
|
p02742
|
a=gets.chomp.split.map(&:to_i)
b=0
if a[0]==1&&a[1]==1
puts 1
else
if a[0]%2==0&&a[1]%2==0
puts a[0]*a[1]/2
elsif a[0]%2==0&&a[1]%2!=0
puts (a[0]*(a[1]-1)/2)+(a[0]-a[0]/2)
elsif a[1]%2==0&&a[0]%2!=0
puts (a[1]*(a[0]-1)/2)+(a[1]-a[1]/2)
else puts (a[1]-1)*(a[0]-1)/2+(a[1]-a[1]/2)+(a[0]-a[0]/2)-1
end
end
|
a=gets.chomp.split.map(&:to_i)
b=0
if a[0]==1||a[1]==1
puts 1
else
if a[0]%2==0&&a[1]%2==0
puts a[0]*a[1]/2
elsif a[0]%2==0&&a[1]%2!=0
puts (a[0]*(a[1]-1)/2)+(a[0]-a[0]/2)
elsif a[1]%2==0&&a[0]%2!=0
puts (a[1]*(a[0]-1)/2)+(a[1]-a[1]/2)
else puts (a[1]-1)*(a[0]-1)/2+(a[1]-a[1]/2)+(a[0]-a[0]/2)-1
end
end
|
[
"misc.opposites",
"control_flow.branch.if.condition.change"
] | 520,265
| 520,264
|
u175113369
|
ruby
|
p02742
|
H, W = gets.split.map(&:to_i)
if H == 1
puts 1
exit 0
end
if H.even? && W.even?
puts H * W / 2
exit 0
end
if H.even?
puts H * W / 2
else
puts ((H - 1) * W / 2) + (W + 1) / 2
end
|
H, W = gets.split.map(&:to_i)
if H == 1 || W == 1
puts 1
exit 0
end
if H.even? && W.even?
puts H * W / 2
exit 0
end
if H.even?
puts H * W / 2
else
puts ((H - 1) * W / 2) + (W + 1) / 2
end
|
[
"control_flow.branch.if.condition.change"
] | 520,404
| 520,405
|
u012133968
|
ruby
|
p02742
|
h, w = gets.split.map(&:to_i)
if h == 1 || w == 1
puts 0
else
puts (h * w + 1) / 2
end
|
h, w = gets.split.map(&:to_i)
if h == 1 || w == 1
puts 1
else
puts (h * w + 1) / 2
end
|
[
"literal.number.integer.change",
"call.arguments.change"
] | 520,638
| 520,639
|
u889326464
|
ruby
|
p02742
|
h,w = gets.chomp.split.map &:to_i
if(w == 1 or h == 1)
puts 1
exit
end
if(w.even?)
puts w*h/2
else
if(h.even?)
puts w*h/2
else
puts w*h/2 + (w+1)/2
end
end
|
# Your code here!
h,w = gets.chomp.split.map &:to_i
if(w == 1 or h == 1)
puts 1
exit
end
if(w.even?)
puts w*h/2
else
if(h.even?)
puts w*h/2
else
puts w*(h/2) + (w+1)/2
end
end
|
[
"call.arguments.change"
] | 520,760
| 520,761
|
u145123922
|
ruby
|
p02742
|
h,w = gets.split(' ').map(&:to_i)
res = h*w
if h == 1 || w == 1
puts 0
exit
end
puts res.even? ? res/2 : res/2+1
|
h,w = gets.split(' ').map(&:to_i)
res = h*w
if h == 1 || w == 1
puts 1
exit
end
puts res.even? ? res/2 : res/2+1
|
[
"literal.number.integer.change",
"call.arguments.change"
] | 521,160
| 521,161
|
u088221425
|
ruby
|
p02742
|
h, w = gets.split(" ").map(&:to_i)
if h == 1 || w == 1
puts 0
else
puts (h * w + 1) / 2
end
|
h, w = gets.split(" ").map(&:to_i)
if h == 1 || w == 1
puts 1
else
puts (h * w + 1) / 2
end
|
[
"literal.number.integer.change",
"call.arguments.change"
] | 521,342
| 521,343
|
u928941036
|
ruby
|
p02743
|
a,b,c=gets.split.map(&:to_i)
d=c-a-b
if 4*a*b<d && d>0
puts "Yes"
else
puts "No"
end
|
a,b,c=gets.split.map(&:to_i)
d=c-a-b
if 4*a*b<d**2 && d>0
puts "Yes"
else
puts "No"
end
|
[
"control_flow.branch.if.condition.change"
] | 522,228
| 522,229
|
u590472228
|
ruby
|
p02743
|
a,b,c=gets.split.map(&:to_i)
d=c-a-b
if 4*a*b<d &d>0
puts "Yes"
else
puts "No"
end
|
a,b,c=gets.split.map(&:to_i)
d=c-a-b
if 4*a*b<d**2 && d>0
puts "Yes"
else
puts "No"
end
|
[
"control_flow.branch.if.condition.change"
] | 522,230
| 522,229
|
u590472228
|
ruby
|
p02743
|
a,b,c = gets.chop.split("").map(&:to_i)
x = c - a - b
if x > 0
y = x*x - 4*a*b
if y > 0
puts "Yes"
else
puts "No"
end
else
puts "No"
end
|
a,b,c = gets.split(" ").map(&:to_i)
x = c - a - b
if x > 0
y = x*x - 4*a*b
if y > 0
puts "Yes"
else
puts "No"
end
else
puts "No"
end
|
[
"call.remove",
"literal.string.change",
"assignment.value.change",
"call.arguments.change"
] | 522,450
| 522,451
|
u265866551
|
ruby
|
p02743
|
a,b,c = gets.split.map(&:to_i)
puts (c - a - b < 0 || 4 * a * b < (c - a - b) ** 2) ? "Yes" : "No"
|
a,b,c = gets.split.map(&:to_i)
puts (c - a - b > 0 && 4 * a * b < (c - a - b) ** 2) ? "Yes" : "No"
|
[
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 522,839
| 522,840
|
u123276241
|
ruby
|
p02743
|
a, b, c = readline.split.map(&:to_i)
# /a + /b < /c
# (/a + /b) ^2 < /c ^2
# a + b + 2/ab < c
# a + b - c < - 2/ab
# a + b - c < 0 -> (a + b - c)^2 > 4ab
# a + b - c >= 0 -> False
if a + b - c <= 0 or (a + b - c) * (a + b - c) > 4 * a * b
puts "Yes"
else
puts "No"
end
|
a, b, c = readline.split.map(&:to_i)
# /a + /b < /c
# (/a + /b) ^2 < /c ^2
# a + b + 2/ab < c
# a + b - c < - 2/ab
# a + b - c < 0 -> (a + b - c)^2 > 4ab
# a + b - c >= 0 -> False
if a + b - c < 0 and (a + b - c) * (a + b - c) > 4 * a * b
puts "Yes"
else
puts "No"
end
|
[
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 522,993
| 522,994
|
u520404466
|
ruby
|
p02743
|
a, b, c = readline.split.map(&:to_i)
# /a + /b < /c
# (/a + /b) ^2 < /c ^2
# a + b + 2/ab < c
# a + b - c < - 2/ab
# a + b - c < 0 -> (a + b - c)^2 > 4ab
# a + b - c >= 0 -> False
if a + b - c < 0 or (a + b - c) * (a + b - c) > 4 * a * b
puts "Yes"
else
puts "No"
end
|
a, b, c = readline.split.map(&:to_i)
# /a + /b < /c
# (/a + /b) ^2 < /c ^2
# a + b + 2/ab < c
# a + b - c < - 2/ab
# a + b - c < 0 -> (a + b - c)^2 > 4ab
# a + b - c >= 0 -> False
if a + b - c < 0 and (a + b - c) * (a + b - c) > 4 * a * b
puts "Yes"
else
puts "No"
end
|
[
"control_flow.branch.if.condition.change"
] | 522,995
| 522,994
|
u520404466
|
ruby
|
p02743
|
a, b, c = readline.split.map(&:to_i)
# /a + /b < /c
# (/a + /b) ^2 < /c ^2
# a + b + 2/ab < c
# a + b - c < - 2/ab
# a + b - c < 0 -> (a + b - c)^2 < 4ab
# a + b - c >= 0 -> True
if a + b - c >= 0 or (a + b - c) * (a + b - c) > 4 * a * b
puts "Yes"
else
puts "No"
end
|
a, b, c = readline.split.map(&:to_i)
# /a + /b < /c
# (/a + /b) ^2 < /c ^2
# a + b + 2/ab < c
# a + b - c < - 2/ab
# a + b - c < 0 -> (a + b - c)^2 > 4ab
# a + b - c >= 0 -> False
if a + b - c < 0 and (a + b - c) * (a + b - c) > 4 * a * b
puts "Yes"
else
puts "No"
end
|
[
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 522,996
| 522,994
|
u520404466
|
ruby
|
p02743
|
a, b, c = readline.split.map(&:to_i)
# /a + /b < /c
# (/a + /b) ^2 < /c ^2
# a + b + 2/ab < c
# a + b - c < - 2/ab
# (a + b - c)^2 < 4ab
if a + b - c >= 0 or (a + b - c) * (a + b - c) < 4 * a * b
puts "Yes"
else
puts "No"
end
|
a, b, c = readline.split.map(&:to_i)
# /a + /b < /c
# (/a + /b) ^2 < /c ^2
# a + b + 2/ab < c
# a + b - c < - 2/ab
# a + b - c < 0 -> (a + b - c)^2 > 4ab
# a + b - c >= 0 -> False
if a + b - c < 0 and (a + b - c) * (a + b - c) > 4 * a * b
puts "Yes"
else
puts "No"
end
|
[
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"misc.opposites"
] | 522,997
| 522,994
|
u520404466
|
ruby
|
p02743
|
a, b, c = gets.chomp.split(' ').map(&:to_i)
d = c - a - b
if d > 0 && d ** d > 4 * a * b
puts 'Yes'
else
puts 'No'
end
|
a, b, c = gets.chomp.split(' ').map(&:to_i)
d = c - a - b
if d > 0 && d * d > 4 * a * b
puts 'Yes'
else
puts 'No'
end
|
[
"control_flow.branch.if.condition.change"
] | 523,146
| 523,147
|
u808711621
|
ruby
|
p02743
|
a,b,c = gets.split.map(&:to_i)
x=c-a-b
if d > 0 && d ** 2 > 4 * a * b
puts 'Yes'
else
puts 'No'
end
|
a,b,c = gets.split.map(&:to_i)
x=c-a-b
if x > 0 && x ** 2 > 4 * a * b
puts 'Yes'
else
puts 'No'
end
|
[
"identifier.change",
"control_flow.branch.if.condition.change"
] | 523,732
| 523,733
|
u173515518
|
ruby
|
p02743
|
# c
require 'pp'
a, b, c = gets.split.map(&:to_i)
if a + b - c > 0
puts 'No'
else
puts ((a + b - c)**2) < (4*a*b) ? 'No' : 'Yes'
end
|
# c
require 'pp'
a, b, c = gets.split.map(&:to_i)
if a + b - c >= 0
puts 'No'
else
puts ((a + b - c)**2) > (4*a*b) ? 'Yes' : 'No'
end
|
[
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"misc.opposites",
"literal.string.change",
"call.arguments.change"
] | 524,243
| 524,244
|
u315597999
|
ruby
|
p02743
|
a,b,c = gets.split.map(&:to_i)
puts (4 * a * b < (c-a-b)**2) ? "Yes" : "No"
|
a,b,c = gets.split.map(&:to_i)
puts (4 * a * b < (c-a-b)**2 && c > a + b) ? "Yes" : "No"
|
[
"control_flow.branch.if.condition.change"
] | 524,294
| 524,295
|
u056083754
|
ruby
|
p02743
|
a,b,c=gets.split.map(&:to_f)
r = c*c - a - b > 0
r &= 4*a*b < (c*c-a-b)**2
puts r ? "Yes" : "No"
|
a,b,c=gets.split.map(&:to_i)
r = c - a - b > 0
r &= 4*a*b < (c-a-b)**2
puts r ? "Yes" : "No"
|
[
"assignment.value.change",
"call.arguments.change",
"call.remove"
] | 524,362
| 524,361
|
u056944756
|
ruby
|
p02744
|
N = gets.to_i
strs = (0..N).map{ [] }
strs[0] = [""]
Chars = [""] + "abcdefghijklmn".split("")
N.times{
(0...N).reverse_each{ |i|
ss = strs[i]
strs[i] = (1..i).flat_map{ |j| ss.map{ |s| s + Chars[j] } }
strs[i+1] += ss.map{ |s| s + Chars[i+1] }
}
}
puts strs[1..-1]
|
N = gets.to_i
strs = (0..N).map{ [] }
strs[0] = [""]
Chars = [""] + "abcdefghijklmn".split("")
N.times{
(0...N).reverse_each{ |i|
ss = strs[i]
strs[i] = (1..i).flat_map{ |j| ss.map{ |s| s + Chars[j] } }
strs[i+1] += ss.map{ |s| s + Chars[i+1] }
}
}
puts strs[1..-1].flatten.sort!
|
[
"call.add"
] | 524,643
| 524,644
|
u670503797
|
ruby
|
p02744
|
def deep(d,i,s)
if d == $n
$ans.push(s.join)
return
end
(0..i).each do |j|
s.push($t[j])
deep(d+1,j+1,s)
s.pop
end
end
$ans = []
$t = "abcdefghijkllm".split("")
$n = gets.to_i
deep(0,0,[])
puts $ans.sort
|
def deep(d,i,s)
if d == $n
$ans.push(s.join)
return
end
(0..i).each do |j|
s.push($t[j])
deep(d+1,[i,j+1].max,s)
s.pop
end
end
$ans = []
$t = "abcdefghijkllm".split("")
$n = gets.to_i
deep(0,0,[])
puts $ans.sort
|
[
"literal.array.change",
"call.add"
] | 524,977
| 524,978
|
u145123922
|
ruby
|
p02744
|
n = gets.chomp.to_i
if n == 1
puts 'a'
exit
end
ans = []
alf = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
ans.push('a')
(n-1).times do
next_ans = []
ans.each do |a|
l = a.split('').last
ne = l.succ
alf.each do |al|
if ne >= al
next_ans.push(a + al)
end
end
end
ans = next_ans
end
ans.sort!
ans.each do |an|
puts an
end
|
n = gets.chomp.to_i
if n == 1
puts 'a'
exit
end
ans = []
alf = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
ans.push('a')
(n-1).times do
next_ans = []
ans.each do |a|
ne = a.split('').sort.last.succ
alf.each do |al|
if ne >= al
next_ans.push(a + al)
end
end
end
ans = next_ans
end
ans.sort!
ans.each do |an|
puts an
end
|
[
"assignment.variable.change",
"identifier.change",
"call.add"
] | 525,074
| 525,075
|
u195257137
|
ruby
|
p02744
|
$n = gets.to_i
$str = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
def go(strr, store)
if strr.size != $n then
store.each{ |s|
go(strr + s, store)
}
go(strr + $str[store.size], store + [$str[store.size]])
else
puts str
end
end
go('a', ['a'])
|
$n = gets.to_i
$str = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
def go(strr, store)
if strr.size != $n then
store.each{ |s|
go(strr + s, store)
}
go(strr + $str[store.size], store + [$str[store.size]])
else
puts strr
end
end
go('a', ['a'])
|
[
"identifier.change",
"call.arguments.change"
] | 525,196
| 525,197
|
u874414087
|
ruby
|
p02744
|
$n = gets.to_i
str = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
def go(strr, store)
if strr.size != $n then
store.each{ |s|
go(strr + s, store)
}
go(strr + str[store.size], store + [str[store.size]])
else
puts str
end
end
go('a', ['a'])
|
$n = gets.to_i
$str = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
def go(strr, store)
if strr.size != $n then
store.each{ |s|
go(strr + s, store)
}
go(strr + $str[store.size], store + [$str[store.size]])
else
puts strr
end
end
go('a', ['a'])
|
[
"call.arguments.change",
"identifier.change"
] | 525,198
| 525,197
|
u874414087
|
ruby
|
p02747
|
s = gets.chomp
x = s.length / 2
if s == 'hi' * x
puts 'Yes'
else
'No'
end
|
s = gets.chomp
x = s.length / 2
if s == 'hi' * x
puts 'Yes'
else
puts 'No'
end
|
[
"io.output.change",
"call.add"
] | 525,440
| 525,441
|
u392423112
|
ruby
|
p02747
|
S = gets.chomp
if S.length % 2 == 1 then
print "No"
else
ans = "Yes"
for i in 1..S.length / 2 do
if S[2i-2] != "h" or S[2i-1] != "i" then
ans = "No"
end
end
print ans
end
|
S = gets.chomp
if S.length % 2 == 1 then
print "No"
else
ans = "Yes"
for j in 1..S.length / 2 do
if S[2 * j-2] != "h" or S[2*j-1] != "i" then
ans = "No"
end
end
print ans
end
|
[
"identifier.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change"
] | 525,484
| 525,485
|
u569559028
|
ruby
|
p02747
|
require 'set'
def main
s = gets.chomp
(0..s.size/2-1).each do |i|
if s[i*2,2] != "hi"
puts "No"
return
end
end
puts "Yes"
end
main
## イディオムなど
# until s.empty? do
#
## 配列のインデックス
# s[0,6] # 0番目から6文字
# s[0..6] # 0番目から6番目まで
# s[5..-1] # 5番目から最後まで
#
## 全探索
# [0, 1].repeated_permutation(n) do |combination| # bit全探索
# array.combination(i) do |selected| # array から要素が i 個である部分列を全部抽出
#
## 無向グラフの幅優先探索(BFS)
# to = Array.new(n).map{Array.new()} # ある頂点と繋がる頂点のリスト
# m.times do
# a,b = gets.chomp.split(" ").map(&:to_i)
# to[a].push b
# to[b].push a
# end
# q = Queue.new # BFS は queue
# ds = Array.new(n, -1)
# pre = Array.new(n, -1)
#
## その他
# a1 = Marshal.load(Marshal.dump(a2)) # 深いコピー
# matrix = Array.new(n).map{Array.new()} # 二次元配列の初期化
#
|
require 'set'
def main
s = gets.chomp
(0..(s.size+1)/2-1).each do |i|
if s[i*2,2] != "hi"
puts "No"
return
end
end
puts "Yes"
end
main
## イディオムなど
# until s.empty? do
#
## 配列のインデックス
# s[0,6] # 0番目から6文字
# s[0..6] # 0番目から6番目まで
# s[5..-1] # 5番目から最後まで
#
## 全探索
# [0, 1].repeated_permutation(n) do |combination| # bit全探索
# array.combination(i) do |selected| # array から要素が i 個である部分列を全部抽出
#
## 無向グラフの幅優先探索(BFS)
# to = Array.new(n).map{Array.new()} # ある頂点と繋がる頂点のリスト
# m.times do
# a,b = gets.chomp.split(" ").map(&:to_i)
# to[a].push b
# to[b].push a
# end
# q = Queue.new # BFS は queue
# ds = Array.new(n, -1)
# pre = Array.new(n, -1)
#
## その他
# a1 = Marshal.load(Marshal.dump(a2)) # 深いコピー
# matrix = Array.new(n).map{Array.new()} # 二次元配列の初期化
#
|
[] | 525,520
| 525,521
|
u622870280
|
ruby
|
p02747
|
s = gets.chomp
puts ("hi" * s.size / 2 == s)? "Yes" : "No"
|
s = gets.chomp
puts ("hi" * (s.size / 2) == s)? "Yes" : "No"
|
[
"control_flow.branch.if.condition.change"
] | 525,567
| 525,568
|
u482840940
|
ruby
|
p02747
|
str = gets
len = str.length
ans = 0
key = 0
if len%2 == 1
ans = 1
else
len.times do |i|
if key == 0
if str[i] == "h"
key = 1
else
ans = 1
break
end
else
if str[i] == "i"
key = 0
else
ans = 1
break
end
end
end
end
if ans == 0
puts "Yes"
else
puts "No"
end
|
str = gets.chomp
len = str.length
ans = 0
key = 0
if len%2 == 1
ans = 1
else
len.times do |i|
if key == 0
if str[i] == "h"
key = 1
else
ans = 1
break
end
else
if str[i] == "i"
key = 0
else
ans = 1
break
end
end
end
end
if ans == 0
puts "Yes"
else
puts "No"
end
|
[
"call.add"
] | 525,569
| 525,570
|
u021866120
|
ruby
|
p02747
|
s = gets.chomp
puts s.match(/.[hi]/) ? 'Yes' : 'No'
|
s = gets.chomp
puts s.match(/^(hi)+$/) ? 'Yes' : 'No'
|
[
"literal.string.change",
"control_flow.branch.if.condition.change"
] | 525,574
| 525,575
|
u238956837
|
ruby
|
p02747
|
puts gets.gsub(/(hi)+/, "") == "" ? "Yes" : "No"
|
puts gets.chomp.gsub(/(hi)+/, "") == "" ? "Yes" : "No"
|
[
"control_flow.branch.if.condition.change",
"call.add"
] | 525,870
| 525,871
|
u596187181
|
ruby
|
p02747
|
require "pry-byebug"
S = gets.chomp.to_s.gsub!(/hi/, "")
if S == ""
puts "Yes"
else
puts "No"
end
|
S = gets.chomp.to_s.gsub!(/hi/, "")
if S == ""
puts "Yes"
else
puts "No"
end
|
[
"call.remove"
] | 526,137
| 526,138
|
u668278891
|
ruby
|
p02747
|
s = gets
if s.gsub!(/hi/, '')==''
puts 'Yes'
else
puts 'No'
end
|
s = gets
if s.chop.gsub!(/hi/, '')==''
puts 'Yes'
else
puts 'No'
end
|
[
"control_flow.branch.if.condition.change",
"call.add"
] | 526,168
| 526,169
|
u413815532
|
ruby
|
p02747
|
puts gets[/^(hi)+/] ? :Yes : :No
|
puts gets[/^(hi)+$/] ? :Yes : :No
|
[
"control_flow.branch.if.condition.change"
] | 526,201
| 526,202
|
u720281401
|
ruby
|
p02747
|
s = gets.chomp
puts s.gsub('hi', '').empty? ? 'YES' : 'NO'
|
s = gets.chomp
puts s.gsub('hi', '').empty? ? 'Yes' : 'No'
|
[
"literal.string.change",
"literal.string.case.change",
"call.arguments.change"
] | 526,283
| 526,284
|
u889326464
|
ruby
|
p02747
|
require 'pp'
s = gets.chomp!
if s == "hi" || s == "hihi" || s == "hi" * 3 || s == "hi" * 4 || s == "h1" * 5
puts "Yes"
else
puts "No"
end
|
require 'pp'
s = gets.chomp!
if s == "hi" || s == "hihi" || s == "hi" * 3 || s == "hi" * 4 || s == "hi" * 5
puts "Yes"
else
puts "No"
end
|
[
"literal.string.change",
"control_flow.branch.if.condition.change"
] | 526,360
| 526,361
|
u754375546
|
ruby
|
p02747
|
s = gets.chomp
if s =~ /(hi)+/
print("Yes")
else
print("No")
end
|
s = gets.chomp
if s =~ /^(hi)+$/
print("Yes")
else
print("No")
end
|
[
"control_flow.branch.if.condition.change"
] | 526,400
| 526,401
|
u590322956
|
ruby
|
p02747
|
S = gets.chomp
cnt = S.scan('hi').length
if S.size == 1
puts "No"
exit
end
if S.size / 2 == cnt
puts "Yes"
else
puts "No"
end
|
S = gets.chomp
cnt = S.scan('hi').length
if S.size % 2 != 0
puts "No"
exit
end
if S.size / 2 == cnt
puts "Yes"
else
puts "No"
end
|
[
"control_flow.branch.if.condition.change"
] | 526,446
| 526,447
|
u846185950
|
ruby
|
p02747
|
# a
require 'pp'
s = gets.chomp
puts (s.match(/hi/)) ? 'Yes' : 'No'
|
# a
require 'pp'
s = gets.chomp
puts (s.match(/^(hi)+$/)) ? 'Yes' : 'No'
|
[
"control_flow.branch.if.condition.change"
] | 526,498
| 526,499
|
u315597999
|
ruby
|
p02747
|
# a
require 'pp'
s = gets.chomp
puts (s.match?(/hi/)) ? 'Yes' : 'No'
|
# a
require 'pp'
s = gets.chomp
puts (s.match(/^(hi)+$/)) ? 'Yes' : 'No'
|
[
"identifier.change",
"control_flow.branch.if.condition.change"
] | 526,500
| 526,499
|
u315597999
|
ruby
|
p02747
|
puts gets.chomp.include?('hi') ? 'Yes' : 'No'
|
puts gets.chomp.split('hi') == [] ? 'Yes' : 'No'
|
[
"identifier.change",
"control_flow.branch.if.condition.change"
] | 526,557
| 526,558
|
u704658587
|
ruby
|
p02747
|
s = gets.chomp.split('')
check = 0
s.size.times do |i|
if i.even? || i == 0
check += 1 if s[i] == 'h'
else
check += 1 if s[i] == 'i'
end
end
if check == s.size && s.size >= 2
puts :Yes
else
puts :No
end
|
s = gets.chomp.split('')
check = 0
s.size.times do |i|
if i.even? || i == 0
check += 1 if s[i] == 'h'
else
check += 1 if s[i] == 'i'
end
end
if check == s.size && s.size.even?
puts :Yes
else
puts :No
end
|
[] | 526,575
| 526,576
|
u437368899
|
ruby
|
p02747
|
s = gets.chomp
n = s.size
ok = true
(n/2).times do |i|
ok = false if s[i*2,2] != "hi"
end
puts (ok ? "Yes" : "No")
|
s = gets.chomp
n = s.size
ok = true
(n/2).times do |i|
ok = false if s[i*2,2] != "hi"
end
puts (ok && n.even? ? "Yes" : "No")
|
[
"control_flow.branch.if.condition.change"
] | 526,695
| 526,696
|
u506255180
|
ruby
|
p02748
|
require 'pp'
$DEBUG ? define_method(:dpp){|e|pp e} : define_method(:dpp){|e|}
# 空白区切の入力値を数値の配列で返却する
def gets_i_list()
gets.chomp.split(" ").map(&:to_i)
end
# [a, b].min が遅いので
def min(a, b)
return a < b ? a : b
end
A, B, M = gets_i_list
a_list = gets_i_list
b_list = gets_i_list
total = a_list.min + b_list.min
M.times do
x, y, c = gets_i_list
total = min(a_list[x - 1] + b_list[x - 1] - c, total)
end
puts total
|
require 'pp'
$DEBUG ? define_method(:dpp){|e|pp e} : define_method(:dpp){|e|}
# 空白区切の入力値を数値の配列で返却する
def gets_i_list()
gets.chomp.split(" ").map(&:to_i)
end
# [a, b].min が遅いので
def min(a, b)
return a < b ? a : b
end
A, B, M = gets_i_list
a_list = gets_i_list
b_list = gets_i_list
total = a_list.min + b_list.min
M.times do
x, y, c = gets_i_list
total = min(a_list[x - 1] + b_list[y - 1] - c, total)
end
puts total
|
[
"assignment.value.change",
"identifier.change",
"variable_access.subscript.index.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 526,999
| 527,000
|
u370977023
|
ruby
|
p02748
|
G =-> {gets.split.map &:to_i}
*,M = G[]
A = G[]
B = G[]
v = A.min+B.min
M.times {
a,b,c = G[]
c = A[a-1]+B[b-1]+c
v = c if v > c
}
p v
|
G =-> {gets.split.map &:to_i}
*,M = G[]
A = G[]
B = G[]
v = A.min+B.min
M.times {
a,b,c = G[]
c = A[a-1]+B[b-1]-c
v = c if v > c
}
p v
|
[
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 527,168
| 527,169
|
u720281401
|
ruby
|
p02753
|
a=gets
if a=="AAA"
print "No"
elsif a=="BBB"
print "No"
else
print "Yes"
end
|
a=gets.chomp
if a=="AAA"
print "No"
elsif a=="BBB"
print "No"
else
print "Yes"
end
|
[
"call.add"
] | 528,344
| 528,345
|
u492991702
|
ruby
|
p02753
|
a=gets
if a=="AAA"
print"No"
elsif a=="BBB"
print"No"
else
print"Yes"
end
|
a=gets.chomp
if a=="AAA"
print "No"
elsif a=="BBB"
print "No"
else
print "Yes"
end
|
[
"call.add"
] | 528,346
| 528,345
|
u492991702
|
ruby
|
p02753
|
s = gets().chomp
puts s.split('').uniq == 1 ? 'No' : 'Yes'
|
s = gets().chomp
puts s.split('').uniq.length == 1 ? 'No' : 'Yes'
|
[
"control_flow.branch.if.condition.change",
"call.add"
] | 528,373
| 528,374
|
u810199299
|
ruby
|
p02753
|
S = gets
puts S == "AAA" || S == "BBB" ? "No" : "Yes"
|
S = gets.chomp
puts (S == "AAA" || S == "BBB") ? "No" : "Yes"
|
[
"call.add",
"control_flow.branch.if.condition.change"
] | 528,436
| 528,437
|
u244203620
|
ruby
|
p02753
|
S = gets.split("")
ans = S.chomp.uniq.length==1 ? "No" : "Yes"
puts ans
|
S = gets.split("")
ans = S.uniq.length==2 ? "No" : "Yes"
puts ans
|
[
"call.remove",
"literal.number.integer.change",
"assignment.value.change",
"control_flow.branch.if.condition.change"
] | 528,458
| 528,459
|
u133971301
|
ruby
|
p02753
|
S = gets.split("")
ans = S.uniq.length==1 ? "No" : "Yes"
puts ans
|
S = gets.split("")
ans = S.uniq.length==2 ? "No" : "Yes"
puts ans
|
[
"literal.number.integer.change",
"assignment.value.change",
"control_flow.branch.if.condition.change"
] | 528,460
| 528,459
|
u133971301
|
ruby
|
p02753
|
S = gets.split("")
ans = S.chomp.uniq.length==1 ? "No" : "Yes"
puts ans
|
S = gets.chomp.split("")
ans = S.uniq.length==1 ? "No" : "Yes"
puts ans
|
[
"call.add",
"call.remove"
] | 528,458
| 528,461
|
u133971301
|
ruby
|
p02753
|
S = gets.split("")
ans = S.uniq.length==1 ? "No" : "Yes"
puts ans
|
S = gets.chomp.split("")
ans = S.uniq.length==1 ? "No" : "Yes"
puts ans
|
[
"call.add"
] | 528,460
| 528,461
|
u133971301
|
ruby
|
p02753
|
puts gets.split("").uniq.length > 1 ? "Yes" : "No"
|
puts gets.chomp.split("").uniq.length > 1 ? "Yes" : "No"
|
[
"control_flow.branch.if.condition.change",
"call.add"
] | 528,488
| 528,489
|
u358554431
|
ruby
|
p02753
|
S = gets
if S == "AAA" or S == "BBB" then
puts "No"
else
puts "Yes"
end
|
S = gets.chomp
if S == "AAA" or S == "BBB" then
puts "No"
else
puts "Yes"
end
|
[
"call.add"
] | 528,519
| 528,520
|
u569559028
|
ruby
|
p02753
|
s = gets.chomp
if(s == "AAA" || s == "BBB")
puts "Yes"
else
puts "No"
end
|
s = gets.chomp
if(s == "AAA" || s == "BBB")
puts "No"
else
puts "Yes"
end
|
[
"call.remove",
"call.add"
] | 528,542
| 528,543
|
u614201073
|
ruby
|
p02753
|
s = gets.chomp.split('').map(&:to_s)
if(s[0] == s[1] && s[0] == s[2])
puts "Yes"
else
puts "No"
end
|
s = gets.chomp.split('').map(&:to_s)
if(s[0] == s[1] && s[0] == s[2])
puts "No"
else
puts "Yes"
end
|
[
"call.remove",
"call.add"
] | 528,544
| 528,545
|
u614201073
|
ruby
|
p02753
|
puts gets.split("").uniq.size == 1 ? :No : :Yes
|
puts gets.chomp.split("").uniq.size == 1 ? :No : :Yes
|
[
"control_flow.branch.if.condition.change",
"call.add"
] | 528,775
| 528,776
|
u091810847
|
ruby
|
p02753
|
s = gets.chomp
puts (s =="AAA") && (s == "BBB") ? "No": "Yes"
|
s = gets.chomp
puts (s =="AAA") || (s == "BBB") ? "No": "Yes"
|
[
"misc.opposites",
"control_flow.branch.if.condition.change"
] | 528,787
| 528,788
|
u684458716
|
ruby
|
p02753
|
attrs = Array.new
while line = $stdin.gets
attrs << line.chomp.split
end
S = attrs[0][0]
if S == 'AAA' || S == 'BBB' then
puts 'No'
else
puts 'Yse'
end
|
attrs = Array.new
while line = $stdin.gets
attrs << line.chomp.split
end
S = attrs[0][0]
if S == 'AAA' || S == 'BBB' then
puts 'No'
else
puts 'Yes'
end
|
[
"literal.string.change",
"call.arguments.change"
] | 528,817
| 528,818
|
u244257825
|
ruby
|
p02753
|
s = gets
puts s == "AAA" || s == "BBB" ? "No" : "Yes"
|
s = gets
puts s == "AAA\n" || s == "BBB\n" ? "No" : "Yes"
|
[
"literal.string.change",
"control_flow.branch.if.condition.change"
] | 528,881
| 528,882
|
u141968173
|
ruby
|
p02753
|
p gets.chomp.split('').uniq.size.eql?(2) ? 'Yes' : 'No'
|
puts gets.chomp.split('').uniq.size.eql?(2) ? 'Yes' : 'No'
|
[
"call.function.change",
"io.output.change"
] | 529,094
| 529,095
|
u673436081
|
ruby
|
p02753
|
S = ARGV[0]
if S.include?('A') && S.include?('B')
print('Yes')
else
print('No')
end
|
S = gets
if S.include?('A') && S.include?('B')
print('Yes')
else
print('No')
end
|
[
"assignment.value.change"
] | 529,195
| 529,196
|
u319422864
|
ruby
|
p02753
|
s = gets.chomp.to_s
if s == "AAA" or s == "BBB"
puts "NO"
else
puts "YES"
end
|
s = gets.chomp.to_s
if s == "AAA" or s == "BBB"
puts "No"
else
puts "Yes"
end
|
[
"literal.string.change",
"literal.string.case.change",
"call.arguments.change"
] | 529,796
| 529,797
|
u654647781
|
ruby
|
p02753
|
s = gets.chomp
if s.squeeze == 1
puts 'No'
else
puts 'Yes'
end
|
s = gets.chomp
if s.squeeze.length == 1
puts 'No'
else
puts 'Yes'
end
|
[
"control_flow.branch.if.condition.change",
"call.add"
] | 529,929
| 529,930
|
u808711621
|
ruby
|
p02753
|
def gls
gets.chomp.split
end
s = gls
if s.include?("A") and s include?("B")
puts "Yes"
else
puts "No"
end
|
def gls
gets.chomp
end
s = gls
if s.include?("A") and s.include?("B")
puts "Yes"
else
puts "No"
end
|
[
"call.remove",
"call.add",
"control_flow.branch.if.condition.change"
] | 530,158
| 530,159
|
u056083754
|
ruby
|
p02753
|
s = STDIN.gets.to_s
puts s.chomp.split("").compact.size == 1 ? "Yes" : "No"
|
s = STDIN.gets.to_s
puts s.chomp.split("").uniq.size == 1 ? "No" : "Yes"
|
[
"identifier.change",
"control_flow.branch.if.condition.change",
"literal.string.change",
"call.arguments.change"
] | 530,201
| 530,202
|
u390727364
|
ruby
|
p02753
|
s = gets
puts (s == "AAA" || s == "BBB") ? "No" : "Yes"
|
s = gets.chomp
puts (s == "AAA" || s == "BBB") ? "No" : "Yes"
|
[
"call.add"
] | 530,274
| 530,275
|
u443861975
|
ruby
|
p02753
|
puts gets.chomp.chars.uniq.size == 1 ? "Yes" : "No"
|
puts gets.chomp.chars.uniq.size == 1 ? "No" : "Yes"
|
[
"literal.string.change",
"call.arguments.change"
] | 530,300
| 530,301
|
u341279393
|
ruby
|
p02753
|
def station_bus?(str)
return false unless str.length == 3
valid = false
str.each_char.with_index do |s, i|
return false unless ['A', 'B'].include?(s)
next if i.zero?
valid = true if s != str[i-1]
end
valid
end
str = gets.chomp!
p station_bus?(str) ? 'Yes' : 'No'
|
def station_bus?(str)
return false unless str.length == 3
valid = false
str.each_char.with_index do |s, i|
return false unless ['A', 'B'].include?(s)
next if i.zero?
valid = true if s != str[i-1]
end
valid
end
str = gets.chomp!
puts station_bus?(str) ? 'Yes' : 'No'
|
[
"call.function.change",
"io.output.change"
] | 530,481
| 530,482
|
u987136947
|
ruby
|
p02753
|
n = gets
if n == "AAA" or n == "BBB" then
puts "No"
else
puts "Yes"
end
|
a = gets.chomp
if a == "AAA" or a == "BBB"
puts "No"
else
puts "Yes"
end
|
[
"assignment.variable.change",
"identifier.change",
"call.add",
"control_flow.branch.if.condition.change"
] | 530,608
| 530,609
|
u383303655
|
ruby
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.