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 |
|---|---|---|---|---|---|---|---|
p03614 | n = gets.to_i
a = gets.split.map(&:to_i)
count = 0
flag = false
n.times do |nn|
if flag
flag = false
next
elsif a[nn] == nn + 1 && a[nn + 1] == nn + 2
flag = true
count += 1
elsif a[nn] == nn + 1
count += 1
end
end | n = gets.to_i
a = gets.split.map(&:to_i)
count = 0
flag = false
n.times do |nn|
if flag
flag = false
next
elsif a[nn] == nn + 1 && a[nn + 1] == nn + 2
flag = true
count += 1
elsif a[nn] == nn + 1
count += 1
end
end
p count | [
"call.add"
] | 1,309,837 | 1,309,838 | u220997159 | ruby |
p03611 | io = STDIN
n=io.gets.to_i
a=io.gets.split.map(&:to_i)
hash={}
hash.default=0
a.each do |aa|
hash[aa]+=1
end
ans=0
(1..10**5).each_cons(3) do |x,y,z|
ans=[ans,hash[x]+hash[y]+hash[z]].max
end
puts ans
| io = STDIN
n=io.gets.to_i
a=io.gets.split.map(&:to_i)
hash={}
hash.default=0
a.each do |aa|
hash[aa]+=1
end
ans=0
(0..10**5).each_cons(3) do |x,y,z|
ans=[ans,hash[x]+hash[y]+hash[z]].max
end
puts ans
| [
"literal.number.integer.change"
] | 1,310,266 | 1,310,267 | u132360211 | ruby |
p03617 | a,b,c,d=gets.split.map(&:to_i)
n=gets.to_i
half=[a*2,b].min
one=[a*4,b*2,c].min
two=[a*8,b*4,c*2,d].min
result+=two*(n/2)
result+=one*(n%2)
p result | a,b,c,d=gets.split.map(&:to_i)
n=gets.to_i
result=0
half=[a*2,b].min
one=[a*4,b*2,c].min
two=[a*8,b*4,c*2,d].min
result+=two*(n/2)
result+=one*(n%2)
p result | [
"assignment.add"
] | 1,310,430 | 1,310,431 | u590472228 | ruby |
p03617 | q, h, s, d = gets.chomp.split(' ').map(&:to_i)
n = gets.chomp.to_i
min1 = [8 * q, 4 * h, 2 * s, d].min
min2 = [8 * q, 4 * h, 2 * s].min
if min1 == min2 || n % 2 == 0
puts n * (min1 / 2)
else
puts n / 2 * d + min2 / 2
end
| q, h, s, d = gets.chomp.split(' ').map(&:to_i)
n = gets.chomp.to_i
min1 = [8 * q, 4 * h, 2 * s, d].min
min2 = [8 * q, 4 * h, 2 * s].min
if min1 == min2 || n % 2 == 0
puts n * min1 / 2
else
puts n / 2 * d + min2 / 2
end
| [
"call.arguments.change"
] | 1,311,237 | 1,311,238 | u253759478 | ruby |
p03615 | # https://beta.atcoder.jp/contests/arc082/submissions/1566776
n = gets.chomp.to_i
x = []
y = []
n.times do
a, b = gets.chomp.split(" ").map(&:to_i)
x << a
y << b
end
md = 998244353
maxN = 201
pow2 = Array.new(maxN)
pow2[0] = 0
pow2[1] = 1
(2...maxN).each do |i|
pow2[i] = (pow2[i - 1] * 2 + 1) % md
end
def line?(ix, iy, jx, jy, kx, ky)
x1 = ix - jx
y1 = iy - jy
x2 = ix - kx
y2 = ix - ky
return (y1 * x2) == (y2 * x1)
end
ans = 0
(0...n).each do |i|
((i + 1)...n).each do |j|
cnt1 = 0
cnt2 = 0
((j + 1)...n).each do |k|
cnt1 += 1
if line?(x[i], y[i], x[j], y[j], x[k], y[k])
cnt2 += 1
end
end
ans += pow2[cnt1]
ans -= pow2[cnt2]
ans %= md
ans += md
ans %= md
end
end
puts ans
| # https://beta.atcoder.jp/contests/arc082/submissions/1566776
n = gets.chomp.to_i
x = []
y = []
n.times do
a, b = gets.chomp.split(" ").map(&:to_i)
x << a
y << b
end
md = 998244353
maxN = 201
pow2 = Array.new(maxN)
pow2[0] = 0
pow2[1] = 1
(2...maxN).each do |i|
pow2[i] = (pow2[i - 1] * 2 + 1) % md
end
def line?(ix, iy, jx, jy, kx, ky)
x1 = ix - jx
y1 = iy - jy
x2 = ix - kx
y2 = iy - ky
return (y1 * x2) == (y2 * x1)
end
ans = 0
(0...n).each do |i|
((i + 1)...n).each do |j|
cnt1 = 0
cnt2 = 0
((j + 1)...n).each do |k|
cnt1 += 1
if line?(x[i], y[i], x[j], y[j], x[k], y[k])
cnt2 += 1
end
end
ans += pow2[cnt1]
ans -= pow2[cnt2]
ans %= md
ans += md
ans %= md
end
end
puts ans
| [
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change"
] | 1,311,406 | 1,311,407 | u910756197 | ruby |
p03618 | def answer(a)
char_count = {}
a.each_with_index.inject(1) do |ans, (aa, i)|
char_count[aa] ||= 0
char_count[aa] += 1
ans + i - char_count[aa] + 1
end
ans
end
p answer(gets.chomp.split(//)) | def answer(a)
char_count = {}
a.each_with_index.inject(1) do |ans, (aa, i)|
char_count[aa] ||= 0
char_count[aa] += 1
ans + i - char_count[aa] + 1
end
end
p answer(gets.chomp.split(//)) | [] | 1,311,943 | 1,311,944 | u220997159 | ruby |
p03618 | A = gets.chomp
B = [0]*A.size
OccurrenceSum = [0]*('z'.ord-'a'.ord+1)
A.each_char.reverse_each.with_index{|c,i|
B[-i-1] = (OccurrenceSum[c.ord-'a'.ord] += 1) -1
}
p 1+B.map.with_index{|n,i| p(A.size-1-i-n) }.inject(:+)
| A = gets.chomp
B = [0]*A.size
OccurrenceSum = [0]*('z'.ord-'a'.ord+1)
A.each_char.reverse_each.with_index{|c,i|
B[-i-1] = (OccurrenceSum[c.ord-'a'.ord] += 1) -1
}
p 1+B.map.with_index{|n,i| A.size-1-i-n }.inject(:+)
| [
"call.remove",
"call.arguments.change"
] | 1,312,032 | 1,312,033 | u977697682 | ruby |
p03618 | s=gets;n=~-s.size;n=n*~-n/2+1;h=Hash.new -1;s.chars{|c|n-=h[c]+=1};p n | s=gets;n=s.size-1;n=n*~-n/2+1;h=Hash.new -1;s.chars{|c|n-=h[c]+=1};p n | [
"expression.operation.binary.remove"
] | 1,312,676 | 1,312,677 | u280667879 | ruby |
p03623 | x,a,b = gets.split(" ").map(&:to_i)
if (x-a).abs > (x-b).abs
puts "A"
else
puts "B"
end | x,a,b = gets.split(" ").map(&:to_i)
if (x-a).abs > (x-b).abs
puts "B"
else
puts "A"
end | [
"call.remove",
"call.add"
] | 1,313,387 | 1,313,388 | u944733909 | ruby |
p03623 | x,a,b=gets.split.map &:to_i
puts (x-a).abs<(x-b).abs ? "B" : "A" | x,a,b=gets.split.map &:to_i
puts (x-a).abs<(x-b).abs ? "A" : "B" | [
"literal.string.change",
"call.arguments.change"
] | 1,313,499 | 1,313,500 | u172873334 | ruby |
p03623 | s=gets
s=s.split
x=s[0].to_i
a=s[1].to_i
b=s[2].to_i
n_a =(x-a).abs
n_b =(x-b).abs
if n_a < n_b
puts "A"
elsif n_a < n_b
puts "B"
else
puts ""
end
| s=gets
s=s.split
x=s[0].to_i
a=s[1].to_i
b=s[2].to_i
n_a =(x-a).abs
n_b =(x-b).abs
if n_a < n_b
puts "A"
elsif n_a > n_b
puts "B"
else
puts ""
end
| [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 1,313,541 | 1,313,542 | u069859306 | ruby |
p03623 | a,b,c=gets.split.map(&:to_i);puts (a-b).abs>(a-c).abs ? 'A':'B'
| a,b,c=gets.split.map(&:to_i);puts (a-b).abs<(a-c).abs ? 'A':'B'
| [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 1,313,565 | 1,313,566 | u050914494 | ruby |
p03623 | a,b,c=gets.split.map(&:to_i);puts (a-b).abs>(a-c).abc ? 'A':'B' | a,b,c=gets.split.map(&:to_i);puts (a-b).abs<(a-c).abs ? 'A':'B'
| [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"identifier.change"
] | 1,313,567 | 1,313,566 | u050914494 | ruby |
p03623 | x,a,b = gets.split(" ").map(&:to_i)
A = (x - a).abs
B = (x - b).abs
if A > B
puts A
else
puts B
end | x,a,b = gets.split(" ").map(&:to_i)
A = (x - a).abs
B = (x - b).abs
if A < B
puts 'A'
else
puts 'B'
end | [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"call.arguments.change"
] | 1,313,756 | 1,313,757 | u135201316 | ruby |
p03623 | x, a, b = gets.chomp.split.map(&:to_i)
puts (x-a).abs > (x-b).abs ? "A" : "B" | x, a, b = gets.chomp.split.map(&:to_i)
puts (x-a).abs > (x-b).abs ? "B" : "A" | [
"literal.string.change",
"call.arguments.change"
] | 1,313,797 | 1,313,798 | u729246375 | ruby |
p03623 | line = gets.chomp.split(" ")
x = line[0].to_i
a = line[1].to_i
b = line[2].to_i
if (x - a) < (x - b)
puts "A"
elsif
puts "B"
end | line = gets.chomp.split(" ")
x = line[0].to_i
a = line[1].to_i
b = line[2].to_i
if (x - a).abs < (x - b).abs
puts "A"
elsif
puts "B"
end
| [
"control_flow.branch.if.condition.change",
"call.add"
] | 1,314,047 | 1,314,048 | u847478937 | ruby |
p03623 | x,a,b = gets.split(" ").map(&:to_i)
puts (x - a).abs > (x - b).abs ? "A" : "B" | x,a,b = gets.split(" ").map(&:to_i)
puts (x - a).abs < (x - b).abs ? "A" : "B" | [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 1,314,118 | 1,314,119 | u094826590 | ruby |
p03624 | s = gets.chomp.chars.sort
alph = ("a".."z")
ans="NONE"
alph.each do |i|
if !s.include?(i)
ans = i
break
end
end
puts ans
| s = gets.chomp.chars.sort
alph = ("a".."z")
ans="None"
alph.each do |i|
if !s.include?(i)
ans = i
break
end
end
puts ans
| [
"literal.string.change",
"literal.string.case.change",
"assignment.value.change"
] | 1,315,221 | 1,315,222 | u191196346 | ruby |
p03624 | s = gets.chomp.chars.sort
alph = ("a".."z")
ans=""
alph.each do |i|
if !s.include?(i)
ans = i
break
end
end
puts ans
| s = gets.chomp.chars.sort
alph = ("a".."z")
ans="None"
alph.each do |i|
if !s.include?(i)
ans = i
break
end
end
puts ans
| [
"literal.string.change",
"assignment.value.change"
] | 1,315,223 | 1,315,222 | u191196346 | ruby |
p03624 | line = STDIN.gets
alphabets = Array.new(26, 0)
line.each_char do |char|
alphabets[char.ord - 'a'.ord] = 1
end
answer = alphabets.find_index do |n|
n == 0
end
if answer
puts ('a'.ord + answer).chr
else
puts 'None'
end | line = STDIN.gets.strip
alphabets = Array.new(26, 0)
line.each_char do |char|
alphabets[char.ord - 'a'.ord] = 1
end
answer = alphabets.find_index do |n|
n == 0
end
if answer
puts ('a'.ord + answer).chr
else
puts 'None'
end | [
"call.add"
] | 1,315,299 | 1,315,300 | u237620737 | ruby |
p03624 | line = STDIN.gets
alphabets = Array.new(26, 0)
line.each_char do |c|
alphabets[c.ord - 'a'.ord] = 1
end
answer = alphabets.find_index do |n|
n == 0
end
if answer
puts ('a'.ord + answer).chr
else
puts 'None'
end | line = STDIN.gets.strip
alphabets = Array.new(26, 0)
line.each_char do |char|
alphabets[char.ord - 'a'.ord] = 1
end
answer = alphabets.find_index do |n|
n == 0
end
if answer
puts ('a'.ord + answer).chr
else
puts 'None'
end | [
"call.add",
"identifier.change",
"assignment.variable.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 1,315,301 | 1,315,300 | u237620737 | ruby |
p03624 | h = gets.chomp
ex = "abcdefghijklmnopqrstuvwxyz"
ans = "NONE"
ex.chars do | ex |
if h.include?(ex) == false
ans = ex
break
end
end
puts ans | h = gets.chomp
ex = "abcdefghijklmnopqrstuvwxyz"
ans = "None"
ex.chars do | ex |
if h.include?(ex) == false
ans = ex
break
end
end
puts ans | [
"literal.string.change",
"literal.string.case.change",
"assignment.value.change"
] | 1,315,321 | 1,315,322 | u677020059 | ruby |
p03624 | s = gets.chomp
d= "abcdefghijklmnopqrstuvxwyz".split("")
s.each_char { |z|
d -= [z]
}
if d.empty?
"None"
else
puts d[0]
end | s = gets.chomp
d= "abcdefghijklmnopqrstuvxwyz".split("")
s.each_char { |z|
d -= [z]
}
if d.empty?
puts "None"
else
puts d[0]
end | [
"io.output.change",
"call.add"
] | 1,315,401 | 1,315,402 | u270675722 | ruby |
p03624 | array=gets.split("")
a=('a'..'z').to_a
i=0
26.times{
if array.count(a[i])==0 then
p a[i]
break
else
array.delete(a[i])
end
i+=1
}
if i==26
print("None")
end
| array=gets.split("")
a=('a'..'z').to_a
i=0
26.times{
if array.count(a[i])==0 then
puts a[i]
break
else
array.delete(a[i])
end
i+=1
}
if i==26
puts ("None")
end
| [
"call.function.change",
"io.output.change",
"identifier.change"
] | 1,315,425 | 1,315,426 | u798818115 | ruby |
p03624 | h = Hash.new
for c in 'a'..'z' do
h[c] = 0
end
s = gets.chomp.split("")
s.each { |c| h[c] = 1}
for c in 'a'..'z' do
if h[c] == 0 then
puts c
exit
end
end | h = Hash.new
for c in 'a'..'z' do
h[c] = 0
end
s = gets.chomp.split("")
s.each { |c| h[c] = 1}
for c in 'a'..'z' do
if h[c] == 0 then
puts c
exit
end
end
puts 'None' | [
"call.add"
] | 1,315,573 | 1,315,574 | u868089307 | ruby |
p03624 | a=[*?a..?z]-gets.chars.to_a
puts a[0]?a*"": :None | a=[*?a..?z]-gets.chars.to_a
puts a[0]?a[0]: :None | [
"call.arguments.change"
] | 1,315,618 | 1,315,619 | u598016178 | ruby |
p03625 | N = gets.to_i
M = gets.split.map(&:to_i).group_by(&:itself)
.map{|k,v| [k,v.size]}
.select{|k,z| z >= 2 }
.max_by(2){|k,z| k }
if M.empty?
puts -1
elsif M.size == 1
if M[0][1] >= 4
puts M[0][0] ** 2
else
puts -1
end
else
if M[0][1] >= 4
puts M[0][0] ** 2
else
puts M[0][0] * M[1][0]
end
end
| N = gets.to_i
M = gets.split.map(&:to_i).group_by(&:itself)
.map{|k,v| [k,v.size]}
.select{|k,z| z >= 2 }
.max_by(2){|k,z| k }
if M.empty?
puts 0
elsif M.size == 1
if M[0][1] >= 4
puts M[0][0] ** 2
else
puts 0
end
else
if M[0][1] >= 4
puts M[0][0] ** 2
else
puts M[0][0] * M[1][0]
end
end
| [
"call.arguments.change",
"expression.operation.unary.remove"
] | 1,316,641 | 1,316,642 | u627981707 | ruby |
p03625 | i=gets.to_i
a=gets.split.map(&:to_i).sort
e=[]
a[i]==a[i-1]&&e<<a[i-=1]while(i-=1)>0
p e[2]?e[0]*e[1]:0 | i=gets.to_i
a=gets.split.map(&:to_i).sort
e=[]
a[i]==a[i-1]&&e<<a[i-=1]while(i-=1)>0
p e[1]?e[0]*e[1]:0 | [
"literal.number.integer.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change"
] | 1,317,467 | 1,317,468 | u656771711 | ruby |
p03625 | i=gets.to_i
a=gets.split.map(&:to_i).sort
e=[]
a[i]==a[i-1]&&e<<a[i-=1]while(i-=1)>1
p e[2]?e[0]*e[1]:0 | i=gets.to_i
a=gets.split.map(&:to_i).sort
e=[]
a[i]==a[i-1]&&e<<a[i-=1]while(i-=1)>0
p e[1]?e[0]*e[1]:0 | [
"literal.number.integer.change",
"expression.operation.binary.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change"
] | 1,317,469 | 1,317,468 | u656771711 | ruby |
p03625 | N = gets.to_i
a = gets.split.map(&:to_i)
a = a.sort
i = N-1
edge_1, edge_2 = 0
while i>0 do
if a[i]==a[i-1] then
if edge_1 == 0 then
edge_1 = a[i]
else
edge_2 = a[i]
break
end
i -= 2
else
i -= 1
end
end
p edge_1 * edge_2 | N = gets.to_i
a = gets.split.map(&:to_i)
a = a.sort
i = N-1
edge_1, edge_2 = 0, 0
while i>0 do
if a[i]==a[i-1] then
if edge_1==0 then
edge_1 = a[i]
else
edge_2 = a[i]
break
end
i -= 2
else
i -= 1
end
end
p edge_1 * edge_2 | [] | 1,317,470 | 1,317,471 | u656771711 | ruby |
p03625 | gets
h = Hash.new(0)
a = gets.chomp.split(" ").map(&:to_i)
a.each { |c| h[c] += 1}
x = Array.new
h.sort.reverse.each do | key, val|
if h[key] >= 4 then
x.push(key)
x.push(key)
elsif h[key] >= 2 then
x.push(key)
end
break if x.size == 2
end
if x.size == 2 then
puts x[0] * x[1]
else
puts 0
end | gets
h = Hash.new(0)
a = gets.chomp.split(" ").map(&:to_i)
a.each { |c| h[c] += 1}
x = Array.new
h.sort.reverse.each do | key, val|
if h[key] >= 4 then
x.push(key)
x.push(key)
elsif h[key] >= 2 then
x.push(key)
end
break if x.size == 2
end
if x.size >= 2 then
puts x[0] * x[1]
else
puts 0
end | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 1,317,563 | 1,317,564 | u868089307 | ruby |
p03625 | gets.to_i
as = gets.split(' ').map { |e| e.to_i }
m = Hash.new(0)
as.each { |e| m[e] += 1 }
res = m.select { |k,v| v > 1 }.sort { |a, b| b[0] <=> a[0] }
p res
if res.empty?
puts 0
elsif res[0][1] >= 4
puts res[0][0] * res[0][0]
elsif res.length > 1
puts res[0][0] * res[1][0]
else
puts 0
end
| gets.to_i
as = gets.split(' ').map { |e| e.to_i }
m = Hash.new(0)
as.each { |e| m[e] += 1 }
res = m.select { |k,v| v > 1 }.sort { |a, b| b[0] <=> a[0] }
if res.empty?
puts 0
elsif res[0][1] >= 4
puts res[0][0] * res[0][0]
elsif res.length > 1
puts res[0][0] * res[1][0]
else
puts 0
end
| [
"call.remove"
] | 1,318,197 | 1,318,198 | u340512149 | ruby |
p03625 | cnt = {0 => 5}
gets
gets.split.each do |x|
x = x.to_i
cnt[x] += 1 if cnt[x]
cnt[x] = 1 if !cnt[x]
end
cnt.delete_if{|k, v| v < 2}
ans = cnt.keys.sort
if ans[-1] > 3
p ans[-1]**2
exit(0)
end
p ans[-1] * ans[-2] | cnt = {0 => 5}
gets
gets.split.each do |x|
x = x.to_i
cnt[x] += 1 if cnt[x]
cnt[x] = 1 if !cnt[x]
end
cnt.delete_if{|k, v| v < 2}
ans = cnt.keys.sort
if cnt[ans[-1]] > 3
p ans[-1]**2
exit(0)
end
p ans[-1] * ans[-2] | [
"control_flow.branch.if.condition.change"
] | 1,318,246 | 1,318,247 | u381253095 | ruby |
p03625 | N = gets.chomp.to_i
A = gets.chomp.split(' ').map(&:to_i)
A.sort! {|a, b| b <=> a }
p A
temp = []
av = []
ans = 0
A.each do |a|
if temp.include?(a)
temp.delete(a)
l = av.length
if l == 0
av.push a
elsif l == 1
ans = av[0] * a
break
end
else
temp.push a
end
end
print ans | N = gets.chomp.to_i
A = gets.chomp.split(' ').map(&:to_i)
A.sort! {|a, b| b <=> a }
temp = []
av = []
ans = 0
A.each do |a|
if temp.include?(a)
temp.delete(a)
l = av.length
if l == 0
av.push a
elsif l == 1
ans = av[0] * a
break
end
else
temp.pop
temp.push a
end
end
print ans | [
"call.remove",
"call.add"
] | 1,318,275 | 1,318,274 | u065618194 | ruby |
p03625 | str = gets.chomp!
str = gets.chomp!
str = str.split(' ').map(&:to_i)
str.sort!
str = [0,0,0,0] + str
p str
i = -1
while str[i] != str[i-1]
i -= 1
end
j = i - 2
while str[j] != str[j-1]
j -= 1
end
puts str[i]*str[j] | str = gets.chomp!
str = gets.chomp!
str = str.split(' ').map(&:to_i)
str.sort!
str = [0,0,0,0] + str
i = -1
while str[i] != str[i-1]
i -= 1
end
j = i - 2
while str[j] != str[j-1]
j -= 1
end
puts str[i]*str[j] | [
"call.remove"
] | 1,318,298 | 1,318,299 | u131033623 | ruby |
p03625 |
n = gets.strip.to_i
a = gets.strip.split(' ').map(&:to_i)
sticks = {}
a.map do |stick|
if sticks[stick]
sticks[stick] += 1
else
sticks[stick] = 1
end
end
# puts sticks
# puts a.uniq.sort.reverse
found = 0
a.uniq.sort.reverse.each do |current|
count = sticks[current]
if count >= 4
# puts "current has more 4"
if found > 0
puts current ** found
else
puts current * current
end
exit 0
elsif count == 2 or count == 3
# puts "current has 2"
if found > 0
# puts "found * current: #{found} * #{current}"
puts found * current
exit 0
else
# puts "found will be #{current}"
found = current
end
end
end
puts 0
|
n = gets.strip.to_i
a = gets.strip.split(' ').map(&:to_i)
sticks = {}
a.map do |stick|
if sticks[stick]
sticks[stick] += 1
else
sticks[stick] = 1
end
end
# puts sticks
# puts a.uniq.sort.reverse
found = 0
a.uniq.sort.reverse.each do |current|
count = sticks[current]
if count >= 4
# puts "current has more 4"
if found > 0
puts current * found
else
puts current * current
end
exit 0
elsif count == 2 or count == 3
# puts "current has 2"
if found > 0
# puts "found * current: #{found} * #{current}"
puts found * current
exit 0
else
# puts "found will be #{current}"
found = current
end
end
end
puts 0
| [
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 1,318,333 | 1,318,334 | u302506528 | ruby |
p03629 | s=gets.chop.chars.reverse
dp=[[0]*26]
s.map{|c|
*x=dp[-1]
x[c.ord-97]=x.min+1
dp<<x
}
($><<i=(97+dp[-1].index(dp[-1].min)).chr;(s.pop;dp.pop)while s[0]&&s[-1]!=i;s.pop)while s[0] | s=gets.chop.chars.reverse
dp=[[0]*26]
s.map{|c|
*x=dp[-1]
x[c.ord-97]=x.min+1
dp<<x
}
($><<i=(97+dp[-1].index(dp[-1].min)).chr;(s.pop;dp.pop)while s[0]&&s[-1]!=i;s.pop;dp.pop)while s[0] | [] | 1,319,276 | 1,319,277 | u657913472 | ruby |
p03631 | n = gets
puts n.reverse == n ? :Yes: :No | n = gets.chomp
puts n.reverse == n ? :Yes: :No | [
"call.add"
] | 1,319,944 | 1,319,945 | u489339677 | ruby |
p03631 | n = gets.to_s
r = n.reverse
if n == r
puts 'Yes'
else
puts 'No'
end | n = gets.chop.to_s
r = n.reverse
if n == r
puts 'Yes'
else
puts 'No'
end | [
"call.add"
] | 1,320,248 | 1,320,249 | u467800529 | ruby |
p03631 | gets[0]==$_[2]?:Yes: :No | puts gets[0]==$_[2]?:Yes: :No | [
"io.output.change",
"call.add"
] | 1,320,302 | 1,320,303 | u655122274 | ruby |
p03631 | a = gets.chomp
puts a == a.reverse ? 'YES' : 'NO' | a = gets.chomp
puts a == a.reverse ? 'Yes' : 'No'
| [
"literal.string.change",
"literal.string.case.change",
"call.arguments.change"
] | 1,320,434 | 1,320,435 | u183509493 | ruby |
p03631 | puts (s=gets)==s.reverse ? :Yes: :No | puts (s=gets.chomp)==s.reverse ? :Yes: :No | [
"control_flow.branch.if.condition.change",
"call.add"
] | 1,320,534 | 1,320,535 | u782685137 | ruby |
p03631 | n = gets.to_s
m = n.reverse
if n == m
puts 'Yes'
else
puts 'No'
end | n = gets.chomp.to_s
m = n.reverse
if n == m
puts 'Yes'
else
puts 'No'
end | [
"call.add"
] | 1,320,542 | 1,320,543 | u135201316 | ruby |
p03631 | num_a = gets.chomp.split("")
length = num_a.length
num_b = []
comparison = 0
v = 0
i = length - 1
while i >= 0
num_b[v] = num_a[i]
v = v + 1
i = i - 1
end
for count in 0..length-1
if num_a[count] == num_b[count]
comparison = comparison + 1
end
end
if comparison == length
puts "Yes"
end
| num_a = gets.chomp.split("")
length = num_a.length
num_b = []
comparison = 0
v = 0
i = length - 1
while i >= 0
num_b[v] = num_a[i]
v = v + 1
i = i - 1
end
for count in 0..length-1
if num_a[count] == num_b[count]
comparison = comparison + 1
end
end
if comparison == length
puts "Yes"
else
puts "No"
end | [
"call.add"
] | 1,320,847 | 1,320,848 | u631187689 | ruby |
p03631 | s = gets.chomp
if s == s.reverse
puts 'YES'
else
puts 'NO'
end
| s = gets.chomp
if s == s.reverse
puts 'Yes'
else
puts 'No'
end
| [
"literal.string.change",
"literal.string.case.change",
"call.arguments.change"
] | 1,320,868 | 1,320,869 | u253759478 | ruby |
p03631 | num = gets.chomp!
p num == num.reverse ? "Yes" : "No" | num = gets.chomp!
puts num == num.reverse ? 'Yes' : 'No' | [
"call.function.change",
"io.output.change",
"literal.string.change",
"call.arguments.change"
] | 1,320,888 | 1,320,889 | u354075848 | ruby |
p03632 | class DP
attr_accessor :value
end
def chmin(dp_object, value)
if dp_object.value != nil
if (dp_object.value > value)
dp_object.value = value
return dp_object.value
end
return dp_object.value
else
dp_object.value = value
return dp_object.value
end
end
def chmax(dp_object, value)
if dp_object.value != nil
if (dp_object.value < value)
dp_object.value = value
return dp_object.value
end
return dp_object.value
else
dp_object.value = value
return dp_object.value
end
end
def action_handler(a, b, c, d)
return 0 if b <= c
start_dp = DP.new
stop_dp = DP.new
chmax(start_dp, a)
chmax(start_dp, c)
chmin(stop_dp, b)
chmin(stop_dp, d)
result = stop_dp.value - start_dp.value
return result
end
a, b, c, d = gets.chop.split.map(&:to_i)
p action_handler(a, b, c, d)
| class DP
attr_accessor :value
end
def chmin(dp_object, value)
if dp_object.value != nil
if (dp_object.value > value)
dp_object.value = value
return dp_object.value
end
return dp_object.value
else
dp_object.value = value
return dp_object.value
end
end
def chmax(dp_object, value)
if dp_object.value != nil
if (dp_object.value < value)
dp_object.value = value
return dp_object.value
end
return dp_object.value
else
dp_object.value = value
return dp_object.value
end
end
def action_handler(a, b, c, d)
return 0 if b <= c || d <= a
start_dp = DP.new
stop_dp = DP.new
chmax(start_dp, a)
chmax(start_dp, c)
chmin(stop_dp, b)
chmin(stop_dp, d)
result = stop_dp.value - start_dp.value
return result
end
a, b, c, d = gets.chop.split.map(&:to_i)
p action_handler(a, b, c, d)
| [
"control_flow.branch.if.condition.change"
] | 1,321,510 | 1,321,511 | u414732171 | ruby |
p03632 | a, b, c, d = gets.split(" ").map(&:to_i)
k = [a,c].max
j = [b,d].min
if b<c
puts 0
else
puts j-k
end | a, b, c, d = gets.split(" ").map(&:to_i)
k = [a,c].max
j = [b,d].min
if b<c || a>d
puts 0
else
puts j-k
end | [
"control_flow.branch.if.condition.change"
] | 1,321,531 | 1,321,532 | u599631096 | ruby |
p03632 | a,b,c,d=gets.split.map &:to_i
p [b,d].min - [a,c].max | a,b,c,d=gets.split.map &:to_i
p [[b,d].min-[a,c].max,0].max | [
"call.arguments.change",
"call.add"
] | 1,321,659 | 1,321,660 | u025592199 | ruby |
p03632 | a,b,c,d=gets.split.map &:to_i
p [b,d].min - [a,c].max | a,b,c,d=gets.split.map &:to_i
p [[b,d].min - [a,c].max, 0].max | [
"call.arguments.change",
"call.add"
] | 1,321,659 | 1,321,661 | u025592199 | ruby |
p03632 | input = gets.split().map{|a| a.to_i}
a = input[0]
b = input[1]
c = input[2]
d = input[3]
if b <= c || d <= a
puts 0
elsif a < b && b < d
puts b-c
elsif b < a && d < b
puts d-a
elsif a <= c && b >= d
puts d-c
elsif c <= a && d >= b
puts b-a
else
puts b-a
end | input = gets.split().map{|a| a.to_i}
a = input[0]
b = input[1]
c = input[2]
d = input[3]
if b <= c || d <= a
puts 0
elsif a < c && b < d
puts b-c
elsif c < a && d < b
puts d-a
elsif a <= c && b >= d
puts d-c
elsif c <= a && d >= b
puts b-a
else
puts b-a
end | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 1,321,752 | 1,321,753 | u103857220 | ruby |
p03631 | s = gets.split
puts s==s.reverse ? "Yes" : "No" | s = gets.chomp
puts s==s.reverse ? "Yes" : "No" | [
"assignment.value.change",
"identifier.change"
] | 1,321,974 | 1,321,975 | u693378622 | ruby |
p03631 | s = gets
puts s==s.reverse ? "Yes" : "No" | s = gets.chomp
puts s==s.reverse ? "Yes" : "No" | [
"call.add"
] | 1,321,976 | 1,321,975 | u693378622 | ruby |
p03631 | n = gets.to_i
puts n == n.reverse ? 'Yes':'No' | n = gets.chomp.to_s
puts n == n.reverse ? 'Yes':'No' | [
"assignment.value.change",
"identifier.change",
"call.add"
] | 1,322,012 | 1,322,013 | u781354194 | ruby |
p03632 | (a, b, c, d) = gets.chomp.split(' ').map(&:to_i)
if a > c then
t = a
a = c
c = t
t = b
b = d
d = t
end
# a < cを保証した下で
if b < c then
t = [b - c, d - c].min
else
t = 0
end
puts t.to_s | (a, b, c, d) = gets.chomp.split(' ').map(&:to_i)
if a > c then
t = a
a = c
c = t
t = b
b = d
d = t
end
# a < cを保証した下で
if c < b then
t = [b - c, d - c].min
else
t = 0
end
puts t.to_s | [
"expression.operation.binary.remove",
"control_flow.branch.if.condition.change"
] | 1,322,148 | 1,322,149 | u198355306 | ruby |
p03632 | A,B,C,D = gets.split.map(&:to_i)
start = [A,C].max
finish = [B,D].min
puts [0,start-finish].max
| A,B,C,D = gets.split.map(&:to_i)
start = [A,C].max
finish = [B,D].min
puts [0,finish-start].max
| [
"expression.operation.binary.remove"
] | 1,322,152 | 1,322,153 | u151483411 | ruby |
p03632 | A,B,C,D = gets.split.map(&:to_i)
start = [A,C].max
finish = [B,D].min
puts [0, start-finish].max
| A,B,C,D = gets.split.map(&:to_i)
start = [A,C].max
finish = [B,D].min
puts [0,finish-start].max
| [
"expression.operation.binary.remove"
] | 1,322,154 | 1,322,153 | u151483411 | ruby |
p03632 | a = gets.chomp.split.map(&:to_i)
ans = 0
if a[0] <= a[3] or a[1] >= a[2]
a.sort!
ans = a[2] - a[1]
end
puts ans | a = gets.chomp.split.map(&:to_i)
ans = 0
if a[0] <= a[3] and a[1] >= a[2]
a.sort!
ans = a[2] - a[1]
end
puts ans | [
"control_flow.branch.if.condition.change"
] | 1,322,160 | 1,322,161 | u677020059 | ruby |
p03632 | a = gets.chomp.split.map(&:to_i)
ans = 0
if a[0] <= a[3] or a[1] >= a[2]
a.sort!
ans = a[2] - a[1]
end
puts ans | a = gets.chomp.split.map(&:to_i)
ans = 0
if a[0] >= a[3] or a[1] <= a[2]
else
a.sort!
ans = a[2] - a[1]
end
puts ans | [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 1,322,160 | 1,322,162 | u677020059 | ruby |
p03632 | a = gets.chomp.split.map(&:to_i)
ans = 0
if a[0] <= a[3] or a[1] >= a[2]
a.sort!
ans = a[2] - a[1]
end
puts ans | a = gets.chomp.split.map(&:to_i)
ans = 0
if a[0] >= a[3] or a[1] <= a[2]
else
a.sort!
ans = a[2] - a[1]
end
puts ans | [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 1,322,160 | 1,322,163 | u677020059 | ruby |
p03632 | a,b,c,d=gets.split.map(&:to_i)
result =
if a<=c
[[b-c, d-c].min, 0].max
elsif a>c
[[d-a, c-a].min, 0].max
end
p result | a,b,c,d=gets.split.map(&:to_i)
result =
if a<=c
[[b-c, d-c].min, 0].max
elsif a>c
[[d-a, b-a].min, 0].max
end
p result | [
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change"
] | 1,322,232 | 1,322,233 | u901038066 | ruby |
p03632 | A,B,C,D = gets.split.map(&:to_i)
if B <= C
p 0
else
p [B,D].min - [A,C].max
end
| A,B,C,D = gets.split.map(&:to_i)
if B <= C || D <= A
p 0
else
p [B,D].min - [A,C].max
end
| [
"control_flow.branch.if.condition.change"
] | 1,322,292 | 1,322,293 | u437302815 | ruby |
p03632 | a,b,c,d=gets.split.map(&:to_i)
puts (a...b).to_a & (c...d).to_a | a,b,c,d=gets.split.map(&:to_i)
puts ((a...b).to_a & (c...d).to_a).size | [
"call.arguments.change",
"call.add"
] | 1,322,341 | 1,322,342 | u056944756 | ruby |
p03632 | a, b, c, d = gets.split.map(&:to_i)
t = 0
u = 0
if c >=a
t = c
else
t = a
end
if d <=b
u = d
else
u = b
end
if b > c
puts 0
exit
end
if a > d
puts 0
exit
end
puts u - t | a, b, c, d = gets.split.map(&:to_i)
t = 0
u = 0
if c >=a
t = c
else
t = a
end
if d <=b
u = d
else
u = b
end
if c > b
puts 0
exit
end
if a > d
puts 0
exit
end
puts u - t | [
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 1,322,405 | 1,322,406 | u614043796 | ruby |
p03632 | a, b, c, d = gets.chomp.split(" ").map(&:to_i)
if b <= c || a >= d then
puts 0
elsif b > c then
puts [b, d].min - c
else
puts [b, d].min - a
end | a, b, c, d = gets.chomp.split(" ").map(&:to_i)
if b <= c || a >= d then
puts 0
elsif b > c && a < c then
puts [b, d].min - c
else
puts [b, d].min - a
end | [
"control_flow.branch.if.condition.change"
] | 1,322,438 | 1,322,439 | u868089307 | ruby |
p03632 | a, b, c, d = gets.chomp.split(" ").map(&:to_i)
if b <= c || a >= d then
puts 0
elsif b > c then
puts [b, d].min - c
else
puts [c, d].min - a
end | a, b, c, d = gets.chomp.split(" ").map(&:to_i)
if b <= c || a >= d then
puts 0
elsif b > c && a < c then
puts [b, d].min - c
else
puts [b, d].min - a
end | [
"control_flow.branch.if.condition.change",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 1,322,440 | 1,322,439 | u868089307 | ruby |
p03632 | A, B, C, D = gets.split.take(4).map(&:to_i)
p [B,D].min - [A,C].max | A, B, C, D = gets.split.take(4).map(&:to_i)
p [0, [B,D].min - [A,C].max].max | [
"literal.array.change",
"call.add"
] | 1,322,496 | 1,322,497 | u711705317 | ruby |
p03633 | N = gets.to_i
lcm = 1
N.times do |i|
data = gets.to_i
if !T.include?(data)
lcm = lcm.lcm(data)
end
end
p lcm | N = gets.to_i
T = Array.new
lcm = 1
N.times do |i|
data = gets.to_i
if !T.include?(data)
lcm = lcm.lcm(data)
end
end
p lcm | [
"assignment.add"
] | 1,323,910 | 1,323,911 | u967314298 | ruby |
p03633 | p (1..gets.to_i).inject{|m,_|m.lcm gets.to_i} | p (1..gets.to_i).inject(1){|m,_|m.lcm gets.to_i} | [
"call.arguments.add"
] | 1,323,984 | 1,323,985 | u782685137 | ruby |
p03633 | # lcmを求めればいいと思います はい
n = gets.chomp.to_i
def gcd(a, b)
return gcd(b, a) if a<b
return a if b==0
return gcd(b, a%b)
end
def lcm(a, b)
return (a*b/gcd(a, b))
end
if n==1
puts gets.chomp.to_i
else
a = gets.chomp.to_i
ans = 0
(n-1).times do
b = gets.chomp.to_i
ans = lcm(a, b)
a = b
end
puts ans
end | # lcmを求めればいいと思います はい
# なんかダメでした
# なんかアルゴリズムのコアは合ってたけどa,bとansの取扱がミスってたっぽい
n = gets.chomp.to_i
def gcd(a, b)
return gcd(b, a) if a<b
return a if b==0
return gcd(b, a%b)
end
def lcm(a, b)
return (a*b/gcd(a, b))
end
if n==1
puts gets.chomp.to_i
else
a = gets.chomp.to_i
ans = 0
(n-1).times do
b = gets.chomp.to_i
a = lcm(a, b)
end
puts a
end | [
"assignment.variable.change",
"identifier.change",
"call.arguments.change"
] | 1,324,037 | 1,324,038 | u445624660 | ruby |
p03633 | def gcm(x,y)
return x if y == 0
return gcm(y,x % y)
end
x = 1
while s = gets
y = s.to_i
x = y * x / gcm(y,x)
end
puts x | def gcm(x,y)
return x if y == 0
return gcm(y,x % y)
end
gets
x = 1
while s = gets
y = s.to_i
x = y * x / gcm(y,x)
end
puts x | [] | 1,324,224 | 1,324,225 | u022797848 | ruby |
p03633 | N = gets.to_i
ary = []
for i in 0..n-1 do
a = i*1
ary.push(gets.to_i)
end
ans = 1
ary.each do |x|
ans = ans.lcm(x)
end
puts ans | N = gets.to_i
ary = []
for i in 0..N-1 do
ary.push(gets.to_i)
end
ans = 1
ary.each do |x|
ans = ans.lcm(x)
end
puts ans | [
"expression.operation.binary.change"
] | 1,324,259 | 1,324,260 | u140205718 | ruby |
p03633 | N = gets.to_i
ary = []
for i in 0..n-1 do
ary.push(gets.to_i)
end
ans = 1
ary.each do |x|
ans = ans.lcm(x)
end
puts ans | N = gets.to_i
ary = []
for i in 0..N-1 do
ary.push(gets.to_i)
end
ans = 1
ary.each do |x|
ans = ans.lcm(x)
end
puts ans | [
"expression.operation.binary.change"
] | 1,324,261 | 1,324,260 | u140205718 | ruby |
p03633 | N = gets.to_i
ary = []
for i in 0..n-1 do
i = i
ary.push(gets.to_i)
end
ans = 1
ary.each do |x|
ans = ans.lcm(x)
end
puts ans | N = gets.to_i
ary = []
for i in 0..N-1 do
ary.push(gets.to_i)
end
ans = 1
ary.each do |x|
ans = ans.lcm(x)
end
puts ans | [
"expression.operation.binary.change"
] | 1,324,262 | 1,324,260 | u140205718 | ruby |
p03634 | require "set"
n = gets.chomp.to_i
@tree = Hash.new(){|h,k| h[k] = Hash.new}
(n-1).times do
a,b,c = gets.chomp.split.map(&:to_i)
@tree[a][b] = c
@tree[b][a] = c
end
q, K = gets.chomp.split.map(&:to_i)
# K からの距離を格納
@distances = Array.new(n + 1)
@distances[K] = 0
visited = Set.new([k])
next_queue = [[K, 0]]
until next_queue.empty? do
now_node, now_dis = next_queue.pop
@tree[now_node].each do |node, dis|
next if visited.include? node
@distances[node] = now_dis + dis
visited.add node
next_queue.push [node, @distances[node]]
end
end
def cal_dis(s, e)
@distances[s] + @distances[e]
end
q.times do
puts cal_dis(*gets.chomp.split.map(&:to_i))
end
| require "set"
n = gets.chomp.to_i
@tree = Hash.new(){|h,k| h[k] = Hash.new}
(n-1).times do
a,b,c = gets.chomp.split.map(&:to_i)
@tree[a][b] = c
@tree[b][a] = c
end
q, K = gets.chomp.split.map(&:to_i)
# K からの距離を格納
@distances = Array.new(n + 1)
@distances[K] = 0
visited = Set.new([K])
next_queue = [[K, 0]]
until next_queue.empty? do
now_node, now_dis = next_queue.pop
@tree[now_node].each do |node, dis|
# ここがSetでないと間に合わない。
next if visited.include? node
@distances[node] = now_dis + dis
visited.add node
next_queue.push [node, @distances[node]]
end
end
def cal_dis(s, e)
@distances[s] + @distances[e]
end
q.times do
puts cal_dis(*gets.chomp.split.map(&:to_i))
end
| [
"assignment.value.change",
"call.arguments.change"
] | 1,324,368 | 1,324,369 | u792512290 | ruby |
p03634 | require "set"
n = gets.chomp.to_i
@tree = Hash.new(){|h,k| h[k] = Hash.new}
(n-1).times do
a,b,c = gets.chomp.split.map(&:to_i)
@tree[a][b] = c
@tree[b][a] = c
end
q, K = gets.chomp.split.map(&:to_i)
# K からの距離を格納
@distances = Array.new(n + 1)
@distances[K] = 0
visited = Set.new([k])
next_queue = [[K, 0]]
until next_queue.empty? do
now_node, now_dis = next_queue.pop
@tree[now_node].each do |node, dis|
next if visited.include? node
@distances[node] = now_dis + dis
visited.add node
next_queue.push [node, @distances[node]]
end
end
def cal_dis(s, e)
@distances[s] + @distances[e]
end
q.times do
puts cal_dis(*gets.chomp.split.map(&:to_i))
end
| require "set"
n = gets.chomp.to_i
@tree = Hash.new(){|h,k| h[k] = Hash.new}
(n-1).times do
a,b,c = gets.chomp.split.map(&:to_i)
@tree[a][b] = c
@tree[b][a] = c
end
q, K = gets.chomp.split.map(&:to_i)
# K からの距離を格納
@distances = Array.new(n + 1)
@distances[K] = 0
visited = Set.new([K])
next_queue = [[K, 0]]
until next_queue.empty? do
now_node, now_dis = next_queue.pop
@tree[now_node].each do |node, dis|
next if visited.include? node
@distances[node] = now_dis + dis
visited.add node
next_queue.push [node, @distances[node]]
end
end
def cal_dis(s, e)
@distances[s] + @distances[e]
end
q.times do
puts cal_dis(*gets.chomp.split.map(&:to_i))
end
| [
"assignment.value.change",
"call.arguments.change"
] | 1,324,368 | 1,324,370 | u792512290 | ruby |
p03632 | a,b,c,d=gets.split.map &:to_i
p [[a+b,c+d].min-[a,c].max,0].max | a,b,c,d=gets.split.map &:to_i;p [[b,d].min-[a,c].max,0].max | [
"expression.operation.binary.remove"
] | 1,324,562 | 1,324,563 | u280667879 | ruby |
p03632 | a,b,c,d=gets.split.map &:to_i
p [[a+b,c+d].min-[a,b].max,0].max | a,b,c,d=gets.split.map &:to_i;p [[b,d].min-[a,c].max,0].max | [
"expression.operation.binary.remove",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 1,324,564 | 1,324,563 | u280667879 | ruby |
p03635 | n, m = gets.chomp.map(&:to_i)
puts (n - 1) * (m - 1) | n, m = gets.split.map(&:to_i)
puts (n - 1) * (m - 1) | [
"assignment.value.change",
"identifier.change"
] | 1,324,932 | 1,324,933 | u395702176 | ruby |
p03635 | n, m = gets.chomo.split(" ").map(&:to_i)
puts (n-1) * (m-1) | a, b = gets.chomp.split(" ").map(&:to_i)
puts (a-1) * (b-1) | [
"assignment.variable.change",
"identifier.change",
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 1,325,270 | 1,325,271 | u126541218 | ruby |
p03635 | n, m = gets.chomo.split(" "),map(&:to_i)
puts (n-1) * (m-1) | a, b = gets.chomp.split(" ").map(&:to_i)
puts (a-1) * (b-1) | [
"assignment.variable.change",
"identifier.change",
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 1,325,272 | 1,325,271 | u126541218 | ruby |
p03635 | n,m=gets.split.map(&to_i)
puts (n-1)*(m-1) | n, m = gets.split.map &:to_i
puts (n - 1) * (m - 1) | [
"call.arguments.change",
"assignment.value.change"
] | 1,325,345 | 1,325,346 | u662265921 | ruby |
p03636 | s = gets.chomp
puts s[0] + (s.length - 2).to_s + s[s.length -1] | s = gets.chomp.chars
puts s[0] + (s.size - 2).to_s + s[s.size - 1]
| [
"call.add",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"variable_access.subscript.index.change",
"io.output.change"
] | 1,325,386 | 1,325,387 | u059126963 | ruby |
p03636 | s = gets.chomp
print "#{s[0]}#{s.length -2}#{s[-1]}" | s = gets.chomp
print "#{s[0]}#{s.size - 2}#{s[-1]}"
| [
"literal.string.change",
"call.arguments.change"
] | 1,325,390 | 1,325,391 | u978288665 | ruby |
p03636 | s = gets.strip.to_s
p s[0] + s.slice(1..-2).length.to_s + s[-1] | s = gets.strip.to_s
puts s[0] + s.slice(1..-2).length.to_s + s[-1] | [
"call.function.change",
"io.output.change"
] | 1,325,441 | 1,325,442 | u658673788 | ruby |
p03636 | words = gets.chomp.split("")
puts words.first + (words.count - 2) + words.last | words = gets.chomp.split("")
puts words.first + (words.count - 2).to_s + words.last | [
"call.add"
] | 1,325,613 | 1,325,614 | u809809975 | ruby |
p03636 | list = gets.chomp
puts "#{list[0]} #{list.size - 2} #{list[-1]}" | list = gets.chomp
puts "#{list[0]}#{list.size - 2}#{list[-1]}" | [
"literal.string.change",
"call.arguments.change"
] | 1,325,672 | 1,325,673 | u683471974 | ruby |
p03636 | list = gets.chomp.
puts "#{list[0]} #{list.size - 2} #{list[-1]}" | list = gets.chomp
puts "#{list[0]}#{list.size - 2}#{list[-1]}" | [
"literal.string.change",
"call.arguments.change"
] | 1,325,674 | 1,325,673 | u683471974 | ruby |
p03636 | list = gets.chomp
puts "#{list[0]} #{list.size - 2} #{list.last}" | list = gets.chomp
puts "#{list[0]}#{list.size - 2}#{list[-1]}" | [
"literal.string.change",
"call.arguments.change"
] | 1,325,675 | 1,325,673 | u683471974 | ruby |
p03636 | str = gets
num = str[1..-2].length
puts "#{str[0]}#{num}#{str[-1]}" | str = gets.chomp
num = str[1..-2].length
puts "#{str[0]}#{num}#{str[-1]}" | [
"call.add"
] | 1,325,704 | 1,325,705 | u448908254 | ruby |
p03636 | s = gets.split
#出力できない、putsの仕様がよく分からない
size = s.size
length = size - 3
puts s[0] + length.to_s + s[size - 1] | s = gets
#出力できない、putsの仕様がよく分からない
size = s.size
length = size - 3
puts s[0] + length.to_s + s[size - 2] | [
"call.remove",
"literal.number.integer.change",
"variable_access.subscript.index.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 1,325,742 | 1,325,743 | u802039083 | ruby |
p03636 | s = gets
#出力できない、putsの仕様がよく分からない
size = s.size
length = size - 3
puts s[0] + length + s[size - 1] | s = gets
#出力できない、putsの仕様がよく分からない
size = s.size
length = size - 3
puts s[0] + length.to_s + s[size - 2] | [
"call.add",
"literal.number.integer.change",
"variable_access.subscript.index.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 1,325,744 | 1,325,743 | u802039083 | ruby |
p03636 | s = gets.chomp
p "#{s[0]}#{s.length-2}#{s[-1]}" | s = gets.chomp
puts "#{s[0]}#{s.length - 2}#{s[-1]}"
| [
"call.function.change",
"io.output.change",
"literal.string.change",
"call.arguments.change"
] | 1,325,808 | 1,325,809 | u501591853 | ruby |
p03636 | s = gets.chomp.split
puts s[0] + (s.size -2).to_s + s[-1] | s = gets.chomp
puts s[0] + (s.size-2).to_s + s[-1] | [
"call.remove"
] | 1,325,878 | 1,325,877 | u374190629 | ruby |
p03636 | s = gets.chomp.split.to_s
puts s[0] + (s.size -2).to_s + s[-1] | s = gets.chomp
puts s[0] + (s.size-2).to_s + s[-1] | [
"call.remove"
] | 1,325,879 | 1,325,877 | u374190629 | ruby |
p03636 | s = gets
puts s[0] + (s.length-2).to_s + s[-1] | s = gets.chomp
puts s[0] + (s.size-2).to_s + s[-1] | [
"call.add",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 1,325,880 | 1,325,877 | u374190629 | ruby |
p03636 | s = gets.chomp.split
puts s[0] + (s.size -2).to_s + s[-1] | s=gets.chomp
puts s[0] + (s.size-2).to_s + s[-1] | [
"call.remove"
] | 1,325,878 | 1,325,881 | u374190629 | ruby |
p03636 | s = gets.chomp.split.to_s
puts s[0] + (s.size -2).to_s + s[-1] | s=gets.chomp
puts s[0] + (s.size-2).to_s + s[-1] | [
"call.remove"
] | 1,325,879 | 1,325,881 | u374190629 | ruby |
p03636 | s = gets
puts s[0] + (s.length-2).to_s + s[-1] | s=gets.chomp
puts s[0] + (s.size-2).to_s + s[-1] | [
"call.add",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 1,325,880 | 1,325,881 | u374190629 | ruby |
p03636 | s = gets
puts s[0] + (s.length-2).to_s + s[-1] | s = gets.chomp
puts s[0] + (s.length-2).to_s + s[-1] | [
"call.add"
] | 1,325,880 | 1,325,883 | u374190629 | ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.