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 |
|---|---|---|---|---|---|---|---|
p02409 | apt = Array.new(4){Array.new(3){Array.new(10,0)}}
gets.chomp
while (info = gets.chomp)
b,f,r,v = info.spilit.map(&:to_i)
apt[b-1][f-1][r-1] += v
end
apt.each.with_index(0) do | bldg,i |
puts "#"*20 if i > 0
bldg.each do |floor|
puts " " + floor.join(" ")
end
end | apt = Array.new( 4 ){ Array.new( 3 ){ Array.new( 10, 0 ) } }
gets
while ( info = gets )
b, f, r, v = info.split.map(&:to_i)
apt[ b-1 ][ f-1 ][ r-1 ] += v
end
apt.each.with_index(0) do | bldg, i |
puts "#"*20 if i > 0
bldg.each do | floor |
puts " "+floor.join( " " )
end
end | [
"call.remove",
"assignment.value.change",
"identifier.change"
] | 209,826 | 209,827 | u407138207 | ruby |
p02409 | apt = Array.new(4){Array.new(3){Array.new(10,0)}}
gets.chomp
while (info = gets.chomp)
b,f,r,v = info.split.map(&:to_i)
apt[b-1][f-1][r-1] += v
end
apt.each.with_index(0) do | bldg,i |
puts "#"*20 if i > 0
bldg.each do |floor|
puts " " + floor.join(" ")
end
end | apt = Array.new( 4 ){ Array.new( 3 ){ Array.new( 10, 0 ) } }
gets
while ( info = gets )
b, f, r, v = info.split.map(&:to_i)
apt[ b-1 ][ f-1 ][ r-1 ] += v
end
apt.each.with_index(0) do | bldg, i |
puts "#"*20 if i > 0
bldg.each do | floor |
puts " "+floor.join( " " )
end
end | [
"call.remove"
] | 209,828 | 209,827 | u407138207 | ruby |
p02409 | apt = Array.new( 4 ){Array.new( 3 ){Array.new( 10,0 ) } }
gets.chomp
while (info = gets.chomp)
b,f,r,v = info.split.map(&:to_i)
apt[ b-1 ][ f-1 ][ r-1 ] += v
end
apt.each.with_index(0) do | bldg,i |
puts "#"*20 if i > 0
bldg.each do |floor|
puts " " + floor.join(" ")
end
end | apt = Array.new( 4 ){ Array.new( 3 ){ Array.new( 10, 0 ) } }
gets
while ( info = gets )
b, f, r, v = info.split.map(&:to_i)
apt[ b-1 ][ f-1 ][ r-1 ] += v
end
apt.each.with_index(0) do | bldg, i |
puts "#"*20 if i > 0
bldg.each do | floor |
puts " "+floor.join( " " )
end
end | [
"call.remove"
] | 209,829 | 209,827 | u407138207 | ruby |
p02409 | apt = Array.new( 4 ){Array.new( 3 ){Array.new( 10,0 ) } }
gets.chomp
while (info = gets.chomp)
b,f,r,v = info.split.map(&:to_i)
apt[ b-1 ][ f-1 ][ r-1 ] += v
end
apt.each.with_index(0) do | bldg, i |
puts "#"*20 if i > 0
bldg.each do |floor|
puts " " + floor.join(" ")
end
end | apt = Array.new( 4 ){ Array.new( 3 ){ Array.new( 10, 0 ) } }
gets
while ( info = gets )
b, f, r, v = info.split.map(&:to_i)
apt[ b-1 ][ f-1 ][ r-1 ] += v
end
apt.each.with_index(0) do | bldg, i |
puts "#"*20 if i > 0
bldg.each do | floor |
puts " "+floor.join( " " )
end
end | [
"call.remove"
] | 209,830 | 209,827 | u407138207 | ruby |
p02409 | apt = Array.new( 4 ){ Array.new( 3 ){ Array.new( 10, 0 ) } }
gets.chomp
while ( info = gets.chomp )
b, f, r, v = info.split.map(&:to_i)
apt[ b-1 ][ f-1 ][ r-1 ] += v
end
apt.each.with_index(0) do | bldg, i |
puts "#"*20 if i > 0
bldg.each do | floor |
puts " "+floor.join( " " )
end
end | apt = Array.new( 4 ){ Array.new( 3 ){ Array.new( 10, 0 ) } }
gets
while ( info = gets )
b, f, r, v = info.split.map(&:to_i)
apt[ b-1 ][ f-1 ][ r-1 ] += v
end
apt.each.with_index(0) do | bldg, i |
puts "#"*20 if i > 0
bldg.each do | floor |
puts " "+floor.join( " " )
end
end | [
"call.remove"
] | 209,832 | 209,827 | u407138207 | ruby |
p02409 | apt = Array.new(4){Array.new(3){Array.new(10,0)}}
gets.chomp
while (info = gets.chomp)
b,f,r,v = info.spilit.map(&:to_i)
apt[b-1][f-1][r-1] += v
end
apt.each.with_index(0) do | bldg,i |
puts "#"*20 if i > 0
bldg.each do |floor|
puts " " + floor.join(" ")
end
end | apt = Array.new(4){Array.new(3){Array.new(10,0)}}
gets
while ( info = gets )
b,f,r,v = info.split.map(&:to_i)
apt[b-1][f-1][r-1] += v
end
apt.each.with_index(0) do |bldg,i|
puts "#"*20 if i > 0
bldg.each do |floor|
puts " " + floor.join(" ")
end
end | [
"call.remove",
"assignment.value.change",
"identifier.change"
] | 209,826 | 209,834 | u407138207 | ruby |
p02409 | apt = Array.new( 4 ){Array.new( 3 ){Array.new( 10,0 ) } }
gets.chomp
while (info = gets.chomp)
b,f,r,v = info.split.map(&:to_i)
apt[ b-1 ][ f-1 ][ r-1 ] += v
end
apt.each.with_index(0) do | bldg,i |
puts "#"*20 if i > 0
bldg.each do |floor|
puts " " + floor.join(" ")
end
end | apt = Array.new(4){Array.new(3){Array.new(10,0)}}
gets
while ( info = gets )
b,f,r,v = info.split.map(&:to_i)
apt[b-1][f-1][r-1] += v
end
apt.each.with_index(0) do |bldg,i|
puts "#"*20 if i > 0
bldg.each do |floor|
puts " " + floor.join(" ")
end
end | [
"call.remove"
] | 209,829 | 209,834 | u407138207 | ruby |
p02409 | apt = Array.new( 4 ){Array.new( 3 ){Array.new( 10,0 ) } }
gets.chomp
while (info = gets.chomp)
b,f,r,v = info.split.map(&:to_i)
apt[ b-1 ][ f-1 ][ r-1 ] += v
end
apt.each.with_index(0) do | bldg, i |
puts "#"*20 if i > 0
bldg.each do |floor|
puts " " + floor.join(" ")
end
end | apt = Array.new(4){Array.new(3){Array.new(10,0)}}
gets
while ( info = gets )
b,f,r,v = info.split.map(&:to_i)
apt[b-1][f-1][r-1] += v
end
apt.each.with_index(0) do |bldg,i|
puts "#"*20 if i > 0
bldg.each do |floor|
puts " " + floor.join(" ")
end
end | [
"call.remove"
] | 209,830 | 209,834 | u407138207 | ruby |
p02409 | apt = Array.new( 4 ){ Array.new( 3 ){ Array.new( 10, 0 ) } }
gets.chomp
while ( info = gets.chomp )
b, f, r, v = info.split.map(&:to_i)
apt[ b-1 ][ f-1 ][ r-1 ] += v
end
apt.each.with_index(0) do | bldg, i |
puts "#"*20 if i > 0
bldg.each do | floor |
puts " "+floor.join( " " )
end
end | apt = Array.new(4){Array.new(3){Array.new(10,0)}}
gets
while ( info = gets )
b,f,r,v = info.split.map(&:to_i)
apt[b-1][f-1][r-1] += v
end
apt.each.with_index(0) do |bldg,i|
puts "#"*20 if i > 0
bldg.each do |floor|
puts " " + floor.join(" ")
end
end | [
"call.remove"
] | 209,832 | 209,834 | u407138207 | ruby |
p02409 | apt = Array.new( 4 ){Aarrey.new(3){Array.new(10.0)}}
gets
while( info = gets )
b,f,r,v = info.split.map(&:to_i)
apt[b-1][f-1][r-1] += v
end
apt.each.with_index(0) do |blbg,i|
puts "#"*20 if i > 0
blbg.each do |floor|
puts " " + floor.join(" ")
end
end | apt = Array.new(4){Array.new(3){Array.new(10,0)}}
gets
while ( info = gets )
b,f,r,v = info.split.map(&:to_i)
apt[b-1][f-1][r-1] += v
end
apt.each.with_index(0) do |bldg,i|
puts "#"*20 if i > 0
bldg.each do |floor|
puts " " + floor.join(" ")
end
end | [
"assignment.value.change",
"call.arguments.change",
"call.arguments.add",
"identifier.change",
"io.output.change"
] | 209,835 | 209,834 | u407138207 | ruby |
p02409 | apt = Array.new( 4 ){Arrey.new(3){Array.new(10.0)}}
gets
while( info = gets )
b,f,r,v = info.split.map(&:to_i)
apt[b-1][f-1][r-1] += v
end
apt.each.with_index(0) do |blbg,i|
puts "#"*20 if i > 0
blbg.each do |floor|
puts " " + floor.join(" ")
end
end | apt = Array.new(4){Array.new(3){Array.new(10,0)}}
gets
while ( info = gets )
b,f,r,v = info.split.map(&:to_i)
apt[b-1][f-1][r-1] += v
end
apt.each.with_index(0) do |bldg,i|
puts "#"*20 if i > 0
bldg.each do |floor|
puts " " + floor.join(" ")
end
end | [
"assignment.value.change",
"call.arguments.change",
"call.arguments.add",
"identifier.change",
"io.output.change"
] | 209,836 | 209,834 | u407138207 | ruby |
p02409 | apt = Array.new(4){Arrey.new(3){Array.new(10.0)}}
gets
while( info = gets )
b,f,r,v = info.split.map(&:to_i)
apt[b-1][f-1][r-1] += v
end
apt.each.with_index(0) do |blbg,i|
puts "#"*20 if i > 0
blbg.each do |floor|
puts " " + floor.join(" ")
end
end | apt = Array.new(4){Array.new(3){Array.new(10,0)}}
gets
while ( info = gets )
b,f,r,v = info.split.map(&:to_i)
apt[b-1][f-1][r-1] += v
end
apt.each.with_index(0) do |bldg,i|
puts "#"*20 if i > 0
bldg.each do |floor|
puts " " + floor.join(" ")
end
end | [
"assignment.value.change",
"call.arguments.change",
"call.arguments.add",
"identifier.change",
"io.output.change"
] | 209,837 | 209,834 | u407138207 | ruby |
p02409 | apt = Array.new(4){Arrey.new(3){Array.new(10.0)}}
gets
while( info = gets )
b,f,r,v = info.split.map(&:to_i)
apt[b-1][f-1][r-1] += v
end
apt.each.with_index(0) do |bldg,i|
puts "#"*20 if i > 0
bldg.each do |floor|
puts " " + floor.join(" ")
end
end | apt = Array.new(4){Array.new(3){Array.new(10,0)}}
gets
while ( info = gets )
b,f,r,v = info.split.map(&:to_i)
apt[b-1][f-1][r-1] += v
end
apt.each.with_index(0) do |bldg,i|
puts "#"*20 if i > 0
bldg.each do |floor|
puts " " + floor.join(" ")
end
end | [
"assignment.value.change",
"call.arguments.change",
"call.arguments.add"
] | 209,838 | 209,834 | u407138207 | ruby |
p02409 | apt = Array.new(4){Array.new(3){Array.new(10.0)}}
gets
while ( info = gets )
b,f,r,v = info.split.map(&:to_i)
apt[b-1][f-1][r-1] += v
end
apt.each.with_index(0) do |bldg,i|
puts "#"*20 if i > 0
bldg.each do |floor|
puts " " + floor.join(" ")
end
end | apt = Array.new(4){Array.new(3){Array.new(10,0)}}
gets
while ( info = gets )
b,f,r,v = info.split.map(&:to_i)
apt[b-1][f-1][r-1] += v
end
apt.each.with_index(0) do |bldg,i|
puts "#"*20 if i > 0
bldg.each do |floor|
puts " " + floor.join(" ")
end
end | [
"assignment.value.change",
"call.arguments.change",
"call.arguments.add"
] | 209,839 | 209,834 | u407138207 | ruby |
p02409 | A = [
[
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0]
],
[
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0]
],
[
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0]
],
[
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0]
]
]
n = gets.chomp.to_i
input_values = []
n.times do
input_value = gets.chomp.split.map(&:to_i)
input_values.push(input_value)
end
for i in 0..(n-1)
b = input_values[i][0].to_i
f = input_values[i][1].to_i
r = input_values[i][2].to_i
v = input_values[i][3].to_i
A[b-1][f-1][r-1] = v
end
for i in 0..2
for j in 0..2
print " "
print A[i][j].join(' ')
print"\n"
end
print "####################\n"
end
for i in 0..2
print " "
print A[3][i].join(' ')
print"\n"
end | A = [
[
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0]
],
[
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0]
],
[
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0]
],
[
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0]
]
]
n = gets.chomp.to_i
input_values = []
n.times do
input_value = gets.chomp.split.map(&:to_i)
input_values.push(input_value)
end
for i in 0..(n-1)
b = input_values[i][0].to_i
f = input_values[i][1].to_i
r = input_values[i][2].to_i
v = input_values[i][3].to_i
A[b-1][f-1][r-1] += v
end
for i in 0..2
for j in 0..2
print " "
print A[i][j].join(' ')
print"\n"
end
print "####################\n"
end
for i in 0..2
print " "
print A[3][i].join(' ')
print"\n"
end | [
"assignment.value.change"
] | 209,847 | 209,848 | u723368439 | ruby |
p02409 | n = gets.to_i
bi = []
4.times do
bi << Array.new(3).map{Array.new(10,0)}
end
n.times do
b,f,r,v = gets.split(" ").map(&:to_i)
bi[b-1][f-1][r-1] = v
end
4.times do |i|
3.times do |j|
print " "
puts bi[i][j].join(" ")
puts "#"*20 if (j == 2)&&(i < 3)
end
end | n = gets.to_i
bi = []
4.times do
bi << Array.new(3).map{Array.new(10,0)}
end
n.times do
b,f,r,v = gets.split(" ").map(&:to_i)
bi[b-1][f-1][r-1] += v
end
4.times do |i|
3.times do |j|
print " "
puts bi[i][j].join(" ")
puts "#"*20 if (j == 2)&&(i < 3)
end
end | [
"assignment.value.change"
] | 209,859 | 209,858 | u213421924 | ruby |
p02410 | n,m = gets.split.map{|n|:to_i}
mat = Array.new(n).map{Array.new(m)}
vec = Array.new(m)
for i in 1..n
a = gets.split.map {|s|:to_i}
mat[i-1] = a
end
for i in 1..m
j = gets.to_i
vec[i-1] = j
end
for i in 1..n
s = 0
for j in 1..m
s += mat[i-1][j-1] * vec[j-1]
end
puts s
end | n,m = gets.split.map{|n| n.to_i}
mat = Array.new(n).map{Array.new(m)}
vec = Array.new(m)
for i in 1..n
a = gets.split.map {|s| s.to_i}
mat[i-1] = a
end
for i in 1..m
j = gets.to_i
vec[i-1] = j
end
for i in 1..n
s = 0
for j in 1..m
s += mat[i-1][j-1] * vec[j-1]
end
puts s
end | [
"assignment.value.change",
"call.add"
] | 210,578 | 210,577 | u407138207 | ruby |
p02411 | while
x = gets()
x = x.split
m = x[0].to_i
f = x[1].to_i
r = x[2].to_i
if m == -1 && f == -1 && r == -1
end
if m == -1 || f == -1
puts "F"
elsif 80 <= m + f
puts "A"
elsif 65 <= m + f && m + f < 80
puts "B"
elsif 50 <= m + f && m + f < 65
puts "C"
elsif 30 <= m + f && m + f < 50 && r < 50
puts "D"
elsif 30 <= m + f && m + f < 50 && 50 <= r
puts "C"
elsif m + f < 30
puts "F"
end
end
| while
x = gets()
x = x.split
m = x[0].to_i
f = x[1].to_i
r = x[2].to_i
if m == -1 && f == -1 && r == -1;break
end
if m == -1 || f == -1
puts "F"
elsif 80 <= m + f
puts "A"
elsif 65 <= m + f && m + f < 80
puts "B"
elsif 50 <= m + f && m + f < 65
puts "C"
elsif 30 <= m + f && m + f < 50 && r < 50
puts "D"
elsif 30 <= m + f && m + f < 50 && 50 <= r
puts "C"
elsif m + f < 30
puts "F"
end
end
| [] | 212,447 | 212,448 | u587994751 | ruby |
p02411 | loop {
m,f,r=gets.split(" ").map(&:to_i)
break if m==-1 && f==-1 && r==-1
grade="F"
if m == -1 && f == -1
elsif (m + f) >=80
grade= "A"
elsif (m + f) >=65
grade= "B"
elsif (m + f)>=50
grade="C"
elsif (m + f)>=30
if r >= 50
grade= "C"
else
grade= "D"
end
end
puts grade
}
| loop {
m,f,r=gets.split(" ").map(&:to_i)
break if m==-1 && f==-1 && r==-1
grade="F"
if m == -1 or f == -1
elsif (m + f) >=80
grade= "A"
elsif (m + f) >=65
grade= "B"
elsif (m + f)>=50
grade="C"
elsif (m + f)>=30
if r >= 50
grade= "C"
else
grade= "D"
end
end
puts grade
}
| [
"control_flow.branch.if.condition.change"
] | 212,451 | 212,452 | u156659396 | ruby |
p02411 | ans =[]
while true
args = gets.split(" ").map{|e|e.to_i}
break if args[0] == -1 && args[1] == -1 && args[2] == -1
if args[0] == -1 || args[1] == -1
ans.push "F"
elsif args[0] + args[1] >= 80
ans.push "A"
elsif args[0] + args[1] >= 65
ans.push "B"
elsif args[0] + args[1] >= 50
ans.push "C"
elsif args[0] + args[1] >=30
if args[2] >=50
ans.push "C"
else
ans.push "D"
end
elsif args[0] + args[1] < 30
ans.push "F"
end
end
ans.each {|e|
puts c
} | ans =[]
while true
args = gets.split(" ").map{|e|e.to_i}
break if args[0] == -1 && args[1] == -1 && args[2] == -1
if args[0] == -1 || args[1] == -1
ans.push "F"
elsif args[0] + args[1] >= 80
ans.push "A"
elsif args[0] + args[1] >= 65
ans.push "B"
elsif args[0] + args[1] >= 50
ans.push "C"
elsif args[0] + args[1] >=30
if args[2] >=50
ans.push "C"
else
ans.push "D"
end
elsif args[0] + args[1] < 30
ans.push "F"
end
end
ans.each {|e|
puts e
} | [
"identifier.change",
"call.arguments.change",
"io.output.change"
] | 212,489 | 212,490 | u407138207 | ruby |
p02411 | ans = []
while true
m, f, r = gets.chop.split.map(&:to_i)
break if m == -1 && f == -1 && r == -1
a = [m, f, r].to_a
ans << a
end
ans.each do |i, j, k|
case
when i == 0 || j == 0
puts "F"
when 80 <= i + j
puts "A"
when 65 <= i + j && i+j < 80
puts "B"
when 50 <= i + j && i+j < 65 || 50 <= k
puts "C"
when 30 <= i + j && i+j < 50
puts "D"
when i + j < 30
puts "E"
end
end | ans = []
while true
m, f, r = gets.chop.split.map(&:to_i)
break if m == -1 && f == -1 && r == -1
a = [m, f, r].to_a
ans << a
end
ans.each do |i, j, k|
case
when i == -1 || j == -1
puts "F"
when 80 <= i + j
puts "A"
when 65 <= i + j && i+j < 80
puts "B"
when 50 <= i + j && i+j < 65 || 50 <= k
puts "C"
when 30 <= i + j && i+j < 50
puts "D"
when i + j < 30
puts "F"
end
end | [
"expression.operation.binary.change",
"expression.operation.unary.add",
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 212,495 | 212,496 | u115706413 | ruby |
p02411 | scores = readlines
scores.each do |score|
texam,kexam,sexam = score.split.map(&:to_i)
break if (texam == -1) && (kexam == -1) && (sexam == -1)
exam = texam + kexam
if (texam == -1) && (kexam == -1)
puts "F"
elsif exam >= 80
puts "A"
elsif exam >= 65 && exam < 80
puts "B"
elsif exam >= 50 && exam < 65
puts "C"
elsif exam >= 30 && exam < 50
if sexam >= 50
puts "C"
else
puts "D"
end
elsif texam + kexam <= 29
puts "F"
end
end
| scores = readlines
scores.each do |score|
texam,kexam,sexam = score.split.map(&:to_i)
break if (texam == -1) && (kexam == -1) && (sexam == -1)
exam = texam + kexam
if (texam == -1) || (kexam == -1)
puts "F"
elsif exam >= 80
puts "A"
elsif exam >= 65 && exam < 80
puts "B"
elsif exam >= 50 && exam < 65
puts "C"
elsif exam >= 30 && exam < 50
if sexam >= 50
puts "C"
else
puts "D"
end
elsif texam + kexam <= 29
puts "F"
end
end
| [
"misc.opposites",
"control_flow.branch.if.condition.change"
] | 212,510 | 212,511 | u958508535 | ruby |
p02413 | #!/usr/bin/env ruby
numbers = gets.split.map(&:to_i)
WIDTH = numbers[1]
HEIGHT = numbers[0]
result = []
(WIDTH-1).times do
temp = 0
row = gets.split.map(&:to_i)
row.each do |value|
temp += value
result << value
end
result << temp
row.clear
if WIDTH == 1 then
break
end
end
(WIDTH+1).times do |index|
temp = 0
HEIGHT.times do |rownumber|
temp += result[(rownumber*(WIDTH+1)) + index]
end
result << temp
end
result.count.times do |i|
print result[i]
if i % (WIDTH+1.0) == WIDTH then
puts ""
else
print " "
end
end
| #!/usr/bin/env ruby
numbers = gets.split.map(&:to_i)
WIDTH = numbers[1]
HEIGHT = numbers[0]
result = []
HEIGHT.times do
temp = 0
row = gets.split.map(&:to_i)
row.each do |value|
temp += value
result << value
end
result << temp
row.clear
if HEIGHT == 1 then
break
end
end
(WIDTH+1).times do |index|
temp = 0
HEIGHT.times do |rownumber|
temp += result[(rownumber*(WIDTH+1)) + index]
end
result << temp
end
result.count.times do |i|
print result[i]
if i % (WIDTH+1.0) == WIDTH then
puts ""
else
print " "
end
end
| [
"control_flow.branch.if.condition.change"
] | 214,953 | 214,954 | u948491783 | ruby |
p02413 | #!/usr/bin/env ruby
numbers = gets.split.map(&:to_i)
WIDTH = numbers[1]
HEIGHT = numbers[0]
result = []
WIDTH.times do
temp = 0
row = gets.split.map(&:to_i)
row.each do |value|
temp += value
result << value
end
result << temp
row.clear
if HEIGHT == 1 then
break
end
end
(WIDTH+1).times do |index|
temp = 0
HEIGHT.times do |rownumber|
temp += result[(rownumber*(WIDTH+1)) + index]
end
result << temp
end
result.count.times do |i|
print result[i]
if i % (WIDTH+1.0) == WIDTH then
puts ""
else
print " "
end
end
| #!/usr/bin/env ruby
numbers = gets.split.map(&:to_i)
WIDTH = numbers[1]
HEIGHT = numbers[0]
result = []
HEIGHT.times do
temp = 0
row = gets.split.map(&:to_i)
row.each do |value|
temp += value
result << value
end
result << temp
row.clear
if HEIGHT == 1 then
break
end
end
(WIDTH+1).times do |index|
temp = 0
HEIGHT.times do |rownumber|
temp += result[(rownumber*(WIDTH+1)) + index]
end
result << temp
end
result.count.times do |i|
print result[i]
if i % (WIDTH+1.0) == WIDTH then
puts ""
else
print " "
end
end
| [] | 214,955 | 214,954 | u948491783 | ruby |
p02413 |
n,m=gets.split(" ").map(&:to_i)
h = Array.new(n+1).map {Array.new(m+1,0)}
for i in 1..n
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print mat[i][j]
end
print "\n"
end
|
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"assignment.variable.change",
"identifier.change",
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 214,958 | 214,959 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(n+1).map{Array.new(m+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
|
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 214,960 | 214,959 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(n+1).map{Array.new(c+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
|
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 214,961 | 214,959 | u156659396 | ruby |
p02413 |
n,m=gets.split(" ").map(&:to_i)
h = Array.new(n+1).map {Array.new(m+1,0)}
for i in 1..n
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print mat[i][j]
end
print "\n"
end
|
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"assignment.variable.change",
"identifier.change",
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 214,958 | 214,970 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(n+1).map{Array.new(c+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
|
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 214,961 | 214,970 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 1..r
for j in 1..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
|
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"literal.number.integer.change"
] | 214,965 | 214,970 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 1...r
for j in 1...c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
|
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"literal.number.integer.change"
] | 214,966 | 214,970 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 1..r
for j in 1..c
print " " unless j == 1
print h[i][j]
end
print "\n"
end
|
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"literal.number.integer.change",
"expression.operation.binary.change"
] | 214,968 | 214,970 | u156659396 | ruby |
p02413 |
n,m=gets.split(" ").map(&:to_i)
h = Array.new(n+1).map {Array.new(m+1,0)}
for i in 1..n
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print mat[i][j]
end
print "\n"
end
|
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"assignment.variable.change",
"identifier.change",
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 214,958 | 214,972 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(n+1).map{Array.new(m+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
|
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 214,960 | 214,972 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(n+1).map{Array.new(c+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
|
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 214,961 | 214,972 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
|
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"call.arguments.add"
] | 214,963 | 214,972 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 1...r
for j in 1...c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
|
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"literal.number.integer.change"
] | 214,966 | 214,972 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 1..r
for j in 1..c
print " " unless j == 1
print h[i][j]
end
print "\n"
end
|
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"literal.number.integer.change",
"expression.operation.binary.change"
] | 214,968 | 214,972 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 1...r
for j in 1...c
print " " unless j == 1
print h[i][j]
end
print "\n"
end
|
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"literal.number.integer.change",
"expression.operation.binary.change"
] | 214,969 | 214,972 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j+1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
|
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 214,973 | 214,972 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(n+1).map{Array.new(m+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
|
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
puts
end
| [
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 214,960 | 214,975 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(n+1).map{Array.new(c+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
|
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
puts
end
| [
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 214,961 | 214,975 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
|
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
puts
end
| [
"call.arguments.add"
] | 214,963 | 214,975 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 1..r
for j in 1..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
|
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
puts
end
| [
"literal.number.integer.change"
] | 214,965 | 214,975 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j+1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
|
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
puts
end
| [
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 214,973 | 214,975 | u156659396 | ruby |
p02413 |
n,m=gets.split(" ").map(&:to_i)
h = Array.new(n+1).map {Array.new(m+1,0)}
for i in 1..n
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print mat[i][j]
end
print "\n"
end
| #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"assignment.variable.change",
"identifier.change",
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 214,958 | 214,982 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(n+1).map{Array.new(m+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 214,960 | 214,982 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(n+1).map{Array.new(c+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 214,961 | 214,982 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"call.arguments.add"
] | 214,963 | 214,982 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 1..r
for j in 1..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"literal.number.integer.change"
] | 214,965 | 214,982 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 1...r
for j in 1...c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"literal.number.integer.change"
] | 214,966 | 214,982 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 1..r
for j in 1..c
print " " unless j == 1
print h[i][j]
end
print "\n"
end
| #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"literal.number.integer.change",
"expression.operation.binary.change"
] | 214,968 | 214,982 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r
a= gets.split.map(&:to_i)
for j in 1..c
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 1...r
for j in 1...c
print " " unless j == 1
print h[i][j]
end
print "\n"
end
| #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"literal.number.integer.change",
"expression.operation.binary.change"
] | 214,969 | 214,982 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
puts " " unless j == 0
print h[i][j]
end
puts
end
| #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"identifier.change"
] | 214,977 | 214,982 | u156659396 | ruby |
p02413 |
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
puts h[i][j]
end
puts
end
| #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 1..r # 変数 i を1からrまで増やして繰り返し処理する。
a= gets.split.map(&:to_i)
for j in 1..c # 変数 i を1からcまで増やして繰り返し処理する。
h[i-1][j-1] = a[j-1]
h[i-1][c] += a[j-1]
h[r][j-1] += a[j-1]
h[r][c] += a[j-1]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"identifier.change"
] | 214,981 | 214,982 | u156659396 | ruby |
p02413 | #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 0..r-1 # 変数 i を1からr-1まで増やして繰り返し処理する。(arrayゼロから始めるから)
a= gets.split.map(&:to_i)
for j in 0..c-1 # 変数 i を0からc-1回まで増やして繰り返し処理する。
h[i][j] = a[j] # array のループひとつづつ足していく
h[i][c] += a[j]
h[r][j] += a[j]
h[r][c] += a[j]
end
end
for i in 0..r-1
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 0..r-1 # 変数 i を1からr-1まで増やして繰り返し処理する。(arrayゼロから始めるから)
a= gets.split.map(&:to_i)
for j in 0..c-1 # 変数 i を0からc-1回まで増やして繰り返し処理する。
h[i][j] = a[j] # array のループひとつづつ足していく
h[i][c] += a[j]
h[r][j] += a[j]
h[r][c] += a[j]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"expression.operation.binary.remove"
] | 214,983 | 214,984 | u156659396 | ruby |
p02413 | #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 0..r-1 # 変数 i を1からr-1まで増やして繰り返し処理する。(arrayゼロから始めるから)
a= gets.split.map(&:to_i)
for j in 0..c-1 # 変数 i を0からc-1回まで増やして繰り返し処理する。
h[i][j] = a[j] # array のループひとつづつ足していく
h[i][c] += a[j]
h[r][j] += a[j]
h[r][c] += a[j]
end
end
for i in 1..r-1
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 0..r-1 # 変数 i を1からr-1まで増やして繰り返し処理する。(arrayゼロから始めるから)
a= gets.split.map(&:to_i)
for j in 0..c-1 # 変数 i を0からc-1回まで増やして繰り返し処理する。
h[i][j] = a[j] # array のループひとつづつ足していく
h[i][c] += a[j]
h[r][j] += a[j]
h[r][c] += a[j]
end
end
for i in 0..r
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| [
"literal.number.integer.change",
"expression.operation.binary.remove"
] | 214,985 | 214,984 | u156659396 | ruby |
p02413 | #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 0..r-1 # 変数 i を1からr-1まで増やして繰り返し処理する。(arrayゼロから始めるから)
a= gets.split.map(&:to_i)
for j in 0..c-1 # 変数 i を0からc-1回まで増やして繰り返し処理する。
h[i][j] = a[j] # array のループひとつづつ足していく
h[i][c] += a[j]
h[r][j] += a[j]
h[r][c] += a[j]
end
end
for i in 0..r-1
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 0..r-1 # 変数 i を1からr-1まで増やして繰り返し処理する。(arrayゼロから始めるから)
a= gets.split.map(&:to_i)
for j in 0..c-1 # 変数 i を0からc-1回まで増やして繰り返し処理する。
h[i][j] = a[j] # array のループひとつづつ足していく
h[i][c] += a[j]
h[r][j] += a[j]
h[r][c] += a[j]
end
end
for i in 0..r #本ループをくりかえす row
for j in 0..c #本ループをくりかえす column
print " " unless j == 0
print h[i][j] #全体結果
end
print "\n"
end
| [
"expression.operation.binary.remove"
] | 214,983 | 214,987 | u156659396 | ruby |
p02413 | #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 0..r-1 # 変数 i を1からr-1まで増やして繰り返し処理する。(arrayゼロから始めるから)
a= gets.split.map(&:to_i)
for j in 0..c-1 # 変数 i を0からc-1回まで増やして繰り返し処理する。
h[i][j] = a[j] # array のループひとつづつ足していく
h[i][c] += a[j]
h[r][j] += a[j]
h[r][c] += a[j]
end
end
for i in 1..r-1
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 0..r-1 # 変数 i を1からr-1まで増やして繰り返し処理する。(arrayゼロから始めるから)
a= gets.split.map(&:to_i)
for j in 0..c-1 # 変数 i を0からc-1回まで増やして繰り返し処理する。
h[i][j] = a[j] # array のループひとつづつ足していく
h[i][c] += a[j]
h[r][j] += a[j]
h[r][c] += a[j]
end
end
for i in 0..r #本ループをくりかえす row
for j in 0..c #本ループをくりかえす column
print " " unless j == 0
print h[i][j] #全体結果
end
print "\n"
end
| [
"literal.number.integer.change",
"expression.operation.binary.remove"
] | 214,985 | 214,987 | u156659396 | ruby |
p02413 | #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 0..r-1 # 変数 i を1からr-1まで増やして繰り返し処理する。(arrayゼロから始めるから)
a= gets.split.map(&:to_i)
for j in 0..c-1 # 変数 i を0からc-1回まで増やして繰り返し処理する。
h[i][j] = a[j] # array のループひとつづつ足していく
h[i][c] += a[j]
h[r][j] += a[j]
h[r][c] += a[j]
end
end
for i in 0..r-1
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 0..r-1 # 変数 i を1からr-1まで増やして繰り返し処理する。(arrayゼロから始めるから)
a= gets.split.map(&:to_i)
for j in 0..c-1 # 変数 i を0からc-1回まで増やして繰り返し処理する。
h[i][j] = a[j] # array のループひとつづつ足していく
h[i][c] += a[j]
h[r][j] += a[j]
h[r][c] += a[j]
end
end
for i in 0..r #本ループをくりかえす row
for j in 0..c #本ループをくりかえす column
print " " unless j == 0
print h[i][j] #全体結果
end
puts
end
| [
"expression.operation.binary.remove"
] | 214,983 | 214,991 | u156659396 | ruby |
p02413 | #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 0..r-1 # 変数 i を1からr-1まで増やして繰り返し処理する。(arrayゼロから始めるから)
a= gets.split.map(&:to_i)
for j in 0..c-1 # 変数 i を0からc-1回まで増やして繰り返し処理する。
h[i][j] = a[j] # array のループひとつづつ足していく
h[i][c] += a[j]
h[r][j] += a[j]
h[r][c] += a[j]
end
end
for i in 0..r-1
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 0..r-1 # 変数 i を1からr-1まで増やして繰り返し処理する。(arrayゼロから始めるから)
a= gets.split.map(&:to_i)
for j in 0..c-1 # 変数 i を0からc-1回まで増やして繰り返し処理する。
h[i][j] = a[j] # array のループひとつづつ足していく
h[i][c] += a[j]
h[r][j] += a[j]
h[r][c] += a[j]
end
end
for i in 0..r #本ループをくりかえす row
for j in 0..c #本ループをくりかえす column
print " " unless j == 0
print h[i][j] #全体結果
end
puts #段落あける
end
| [
"expression.operation.binary.remove"
] | 214,983 | 214,992 | u156659396 | ruby |
p02413 | #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 0..r-1 # 変数 i を1からr-1まで増やして繰り返し処理する。(arrayゼロから始めるから)
a= gets.split.map(&:to_i)
for j in 0..c-1 # 変数 i を0からc-1回まで増やして繰り返し処理する。
h[i][j] = a[j] # array のループひとつづつ足していく
h[i][c] += a[j]
h[r][j] += a[j]
h[r][c] += a[j]
end
end
for i in 0..r-1
for j in 0..c
print " " unless j == 0
print h[i][j]
end
print "\n"
end
| #表計算を行うプログラムを作成。
r,c=gets.split(" ").map(&:to_i)
h = Array.new(r+1).map{Array.new(c+1,0)}
for i in 0..r-1 # 変数 i を1からr-1まで増やして繰り返し処理する。(arrayゼロから始めるから)
a= gets.split.map(&:to_i)
for j in 0..c-1 # 変数 i を0からc-1回まで増やして繰り返し処理する。
h[i][j] = a[j] # array のループひとつづつ足していく
h[i][c] += a[j]
h[r][j] += a[j]
h[r][c] += a[j]
end
end
for i in 0..r #本ループをくりかえす row
for j in 0..c #本ループをくりかえす column
print " " unless j == 0
print h[i][j] #全体結果
end
puts #段落あける
end
| [
"expression.operation.binary.remove"
] | 214,983 | 214,995 | u156659396 | ruby |
p02413 | r, c = gets.split.map(&:to_i)
arr = Array.new(r+1).map{ Array.new(c+1, 0) }
for i in 0..r-1 do
arr[i] = gets.split.map(&:to_i)
arr[i][c] = 0
end
for i in 0..r-1 do
for j in 0..c-1 do
arr[i][c] += arr[i][j]
end
end
for i in 0..c do
for j in 0..r-1 do
arr[r][i] += a[j][i]
end
end
for i in 0..r do
puts arr[i].join(" ")
end
| r, c = gets.split.map(&:to_i)
arr = Array.new(r+1).map{ Array.new(c+1, 0) }
for i in 0..r-1 do
arr[i] = gets.split.map(&:to_i)
arr[i][c] = 0
end
for i in 0..r-1 do
for j in 0..c-1 do
arr[i][c] += arr[i][j]
end
end
for i in 0..c do
for j in 0..r-1 do
arr[r][i] += arr[j][i]
end
end
for i in 0..r do
puts arr[i].join(" ")
end
| [
"identifier.change"
] | 215,029 | 215,030 | u087014397 | ruby |
p02413 | r, c = gets.split.map(&:to_i)
arr = Array.new(r+1).map{ Array.new(c+1, 0) }
for i in 0..r-1
arr[i] = gets.split.map(&:to_i)
arr[i][c] = 0
end
for i in 0..r-1
for j in 0..c-1
arr[i][c] += arr[i][j]
end
end
for i in 0..c
for j in 0..r-1
arr[r][i] += a[j][i]
end
end
for i in 0..r
puts arr[i].join(" ")
end
| r, c = gets.split.map(&:to_i)
arr = Array.new(r+1).map{ Array.new(c+1, 0) }
for i in 0..r-1
arr[i] = gets.split.map(&:to_i)
arr[i][c] = 0
end
for i in 0..r-1
for j in 0..c-1
arr[i][c] += arr[i][j]
end
end
for i in 0..c
for j in 0..r-1
arr[r][i] += arr[j][i]
end
end
for i in 0..r do
puts arr[i].join(" ")
end
| [
"identifier.change"
] | 215,031 | 215,032 | u087014397 | ruby |
p02413 | r, c = gets.split.map(&:to_i)
arr = Array.new(r+1).map{ Array.new(c+1, 0) }
for i in 0..r-1
arr[i] = gets.split.map(&:to_i)
arr[i][c] = 0
end
for i in 0..r-1
for j in 0..c-1
arr[i][c] += arr[i][j]
end
end
for i in 0..c
for j in 0..r-1
arr[r][i] += arr[j][i]
end
end
for i in 0..r do
puts a[i].join(" ")
end
| r, c = gets.split.map(&:to_i)
arr = Array.new(r+1).map{ Array.new(c+1, 0) }
for i in 0..r-1
arr[i] = gets.split.map(&:to_i)
arr[i][c] = 0
end
for i in 0..r-1
for j in 0..c-1
arr[i][c] += arr[i][j]
end
end
for i in 0..c
for j in 0..r-1
arr[r][i] += arr[j][i]
end
end
for i in 0..r do
puts arr[i].join(" ")
end
| [
"identifier.change",
"call.arguments.change",
"io.output.change"
] | 215,033 | 215,032 | u087014397 | ruby |
p02413 | r, c = gets.split.map(&:to_i)
m = []
r.times {m << gets.split.map(&:to_i)}
tate = Array.new(c, 0)
putout = ->(ar) {
st = ""
sum = 0
ar.each_with_index do |x, i|
st += x.to_s + " "
sum += x
tate[i] += x
end
st += sum.to_s
puts st
}
m.each {|x| putout.(x)}
putout.(last)
| r, c = gets.split.map(&:to_i)
m = []
r.times {m << gets.split.map(&:to_i)}
tate = Array.new(c, 0)
putout = ->(ar) {
st = ""
sum = 0
ar.each_with_index do |x, i|
st += x.to_s + " "
sum += x
tate[i] += x
end
st += sum.to_s
puts st
}
m.each {|x| putout.(x)}
putout.(tate)
| [
"identifier.change",
"call.arguments.change"
] | 215,034 | 215,035 | u864617427 | ruby |
p02415 | string = gets.chomp
p string.swapcase | string = gets.chomp
puts string.swapcase | [
"call.function.change",
"io.output.change"
] | 218,444 | 218,445 | u854258289 | ruby |
p02414 | line = STDIN.gets.split(" ")
size = Array.new(3) { |i| i = line[i].to_i}
matrixA = []
matrixB = []
matrixC = []
# matrixA
for i in 0..size[0] - 1 do
line = STDIN.gets.split(" ")
for j in 0..size[1] - 1 do
# puts "i = #{i}, j = #{j}"
line[j] = line[j].to_i
end
matrixA << line
# print matrix
end
# print matrixA, "\n"
# matrixB
for i in 0..size[1] - 1 do
line = STDIN.gets.split(" ")
for j in 0..size[2] - 1 do
# puts "i = #{i}, j = #{j}"
line[j] = line[j].to_i
end
matrixB << line
# print matrix
end
# print matrixB, "\n"
# calc
for i in 0..size[2] - 1 do
line = []
for j in 0..size[0] - 1 do
sum = 0
for k in 0..size[1] - 1 do
# puts "i = #{i}, j = #{j}, k = #{k}"
sum += matrixA[i][k] * matrixB[k][j]
end
# puts "sum = #{sum}"
line << sum
end
puts line.join(" ")
end | line = STDIN.gets.split(" ")
size = Array.new(3) { |i| i = line[i].to_i}
matrixA = []
matrixB = []
matrixC = []
# matrixA
for i in 0..size[0] - 1 do
line = STDIN.gets.split(" ")
for j in 0..size[1] - 1 do
# puts "i = #{i}, j = #{j}"
line[j] = line[j].to_i
end
matrixA << line
# print matrix
end
# print matrixA, "\n"
# matrixB
for i in 0..size[1] - 1 do
line = STDIN.gets.split(" ")
for j in 0..size[2] - 1 do
# puts "i = #{i}, j = #{j}"
line[j] = line[j].to_i
end
matrixB << line
# print matrix
end
# print matrixB, "\n"
# calc
for i in 0..size[0] - 1 do
line = []
for j in 0..size[2] - 1 do
sum = 0
for k in 0..size[1] - 1 do
# puts "i = #{i}, j = #{j}, k = #{k}"
sum += matrixA[i][k] * matrixB[k][j]
end
# puts "sum = #{sum}"
line << sum
end
puts line.join(" ")
end | [
"literal.number.integer.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 218,913 | 218,914 | u938745275 | ruby |
p02414 | n,m,l = gets.chomp.split(" ").map &:to_i
matA = Array.new
n.times { matA << (gets.chomp.split(" ").map &:to_i) }
matB = Array.new
m.times { matB << (gets.chomp.split(" ").map &:to_i) }
matC = Array.new
n.times { |r|
l.times { |c|
f = 0
m.times { |i| f += matA[r][i]*matB[i][c] }
matC << f
}
}
matC.length.times { |i|
puts if i%n == 0 and i != 0
print " " if i%n != 0
print matC[i]
}
puts | n,m,l = gets.chomp.split(" ").map &:to_i
matA = Array.new
n.times { matA << (gets.chomp.split(" ").map &:to_i) }
matB = Array.new
m.times { matB << (gets.chomp.split(" ").map &:to_i) }
matC = Array.new
n.times { |r|
l.times { |c|
f = 0
m.times { |i| f += matA[r][i]*matB[i][c] }
matC << f
}
}
matC.length.times { |i|
puts if i%l == 0 and i != 0
print " " if i%l != 0
print matC[i]
}
puts | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 218,917 | 218,918 | u281257618 | ruby |
p02414 | n,m,l = gets.split.map {|s| s.to_i}
a = Array.new
b = Array.new
for i in 1..n
c = gets.split.map{|x| x.to_i}
a.push(c)
end
for i in 1..m
b = gets.split.map{|x| x.to_i}
b.push(c)
end
for i in 1..n
for j in 1..l
print " " unless j == 1
s = 0
for k in 1..m
s += a[i-1][k-1]*b[k-1][j-1]
end
print s
end
print "\n"
end
| n,m,l = gets.split.map {|s| s.to_i}
a = Array.new
b = Array.new
for i in 1..n
c = gets.split.map {|s| s.to_i}
a.push(c)
end
for j in 1..m
c = gets.split.map {|s| s.to_i}
b.push(c)
end
for i in 1..n
for j in 1..l
print " " unless j == 1
s = 0
for k in 1..m
s += a[i-1][k-1] * b[k-1][j-1]
end
print s
end
print "\n"
end
| [
"assignment.value.change",
"identifier.change",
"assignment.variable.change"
] | 218,925 | 218,926 | u236620240 | ruby |
p02414 | n,m,l = gets.split.map {|s| s.to_i}
a = Array.new
b = Array.new
for i in 1..n
c = gets.split.map{|x| x.to_i}
a.push(c)
end
for i in 1..m
b = gets.split.map{|x| x.to_i}
b.push(c)
end
for i in 1..n
for j in 1..l
print " " unless j == 1
s = 0
for k in 1..m
s += a[i-1][k-1]*b[k-1][j-1]
end
print s
end
print "\n"
end
| n,m,l = gets.split.map {|s| s.to_i}
a = Array.new
b = Array.new
for i in 1..n
c = gets.split.map{|s| s.to_i}
a.push(c)
end
for j in 1..m
c = gets.split.map{|s| s.to_i}
b.push(c)
end
for i in 1..n
for j in 1..l
print " " unless j == 1
s = 0
for k in 1..m
s += a[i-1][k-1]*b[k-1][j-1]
end
print s
end
print "\n"
end
| [
"assignment.value.change",
"identifier.change",
"assignment.variable.change"
] | 218,925 | 218,927 | u236620240 | ruby |
p02414 | n, m, l = gets.split.map(&:to_i)
mtx_a,mtx_b = [],[]
mtx_c = Array.new(n){ Array.new(l){0} }
n.times do
mtx_a << file.gets.split.map(&:to_i)
end
m.times do
mtx_b << file.gets.split.map(&:to_i)
end
n.times do | i_idx |
m.times do | j_idx |
l.times do | k_idx |
mtx_c[i_idx][k_idx] += mtx_a[i_idx][j_idx] * mtx_b[j_idx][k_idx]
end
end
end
mtx_c.each{|out| puts(out.join(" "))}
| n, m, l = gets.split.map(&:to_i)
mtx_a,mtx_b = [],[]
mtx_c = Array.new(n){ Array.new(l){0} }
n.times do
mtx_a << gets.split.map(&:to_i)
end
m.times do
mtx_b << gets.split.map(&:to_i)
end
n.times do | i_idx |
m.times do | j_idx |
l.times do | k_idx |
mtx_c[i_idx][k_idx] += mtx_a[i_idx][j_idx] * mtx_b[j_idx][k_idx]
end
end
end
mtx_c.each{|out| puts(out.join(" "))}
| [
"call.remove"
] | 218,928 | 218,929 | u958508535 | ruby |
p02412 | count = 0
ans = []
xmax = []
num = []
loop do
prexmax, prenum = gets.split.map &:to_i
if prexmax != 0 && prenum != 0
xmax << prexmax
num << prenum
count += 1
else
break
end
end
for c in 0..count-1
preans = 0
imax = [num[c]/3-1, xmax[c]].min
for i in 1..imax
jmax = [((num[c]-i)/2.to_f).ceil-1, xmax[c]].min
for j in i+1..jmax
if num[c]-i-j <= xmax[c] then preans += 1 end
end
end
ans << preans
end
puts ans
| count = 0
ans = []
xmax = []
num = []
loop do
prexmax, prenum = gets.split.map &:to_i
if !( prexmax == 0 && prenum == 0 )
xmax << prexmax
num << prenum
count += 1
else
break
end
end
for c in 0..count-1
preans = 0
imax = [num[c]/3-1, xmax[c]].min
for i in 1..imax
jmax = [((num[c]-i)/2.to_f).ceil-1, xmax[c]].min
for j in i+1..jmax
if num[c]-i-j <= xmax[c] then preans += 1 end
end
end
ans << preans
end
puts ans
| [
"control_flow.branch.if.condition.change",
"misc.opposites",
"expression.operator.compare.change"
] | 219,135 | 219,136 | u699389099 | ruby |
p02412 | #1 から n までの数の中から、重複無しで3つの数を選びそれらの合計が x となる組み合わせの数を求める
while true
n,x=gets.split(" ").map(&:to_i) #n とx数字をとる
break if n==0 && x==0 #値ゼロの場合終了
count=0
for a in 1..n #loopを始める
for b in 1+1..n
for c in b+1..n
count += 1 if a+b+c==x
end
end
end
puts count
end
| #1 から n までの数の中から、重複無しで3つの数を選びそれらの合計が x となる組み合わせの数を求める
while true
n,x=gets.split(" ").map(&:to_i) #n とx数字をとる
break if n==0 && x==0 #値ゼロの場合終了
count=0
for a in 1..n #loopを始める
for b in 1+a..n
for c in b+1..n
count += 1 if a+b+c==x
end
end
end
puts count
end
| [
"identifier.replace.add",
"literal.replace.remove",
"expression.operation.binary.change"
] | 219,137 | 219,138 | u156659396 | ruby |
p02412 | #1 から n までの数の中から、重複無しで3つの数を選びそれらの合計が x となる組み合わせの数を求める
while true
n,x=gets.split(" ").map(&:to_i) #n とx数字をとる
break if n==0 && x==0 #値ゼロの場合終了
count=0
for a in 1..n #loopを始める
for b in 1+1..n
for c in b+1..n
count += 1 if a+b+c==x
end
end
end
puts count
end
| #1 から n までの数の中から、重複無しで3つの数を選びそれらの合計が x となる組み合わせの数を求める
while true
n,x=gets.split(" ").map(&:to_i) #n とx数字をとる
break if n==0 && x==0 #値ゼロの場合終了
count=0 #resultをまずゼロにする
#loopを始める
for a in 1..n #a を n回繰り返す an1,an2,an3....
for b in 1+a..n
for c in b+1..n
count += 1 if a+b+c==x #abcのsum xに同じ場合countを1を足してまた繰り返す
end
end
end
puts count
end
| [
"identifier.replace.add",
"literal.replace.remove",
"expression.operation.binary.change"
] | 219,137 | 219,139 | u156659396 | ruby |
p02412 | ARGF.each do |line|
n, x = line.split.map(&:to_i)
break if n == 0 && x == 0
ary = [1..n]
i = 0
ary.combination(3){|a,b,c| i += 1 if (a+b+c) == x}
puts i
end | ARGF.each do |line|
n, x = line.split.map(&:to_i)
break if n == 0 && x == 0
ary = [*1..n]
i = 0
ary.combination(3){ |a,b,c| i += 1 if (a+b+c) == x }
puts i
end | [] | 219,142 | 219,143 | u330842660 | ruby |
p02412 | class Counter
@@max_size = 3
def initialize(max, cond)
@max = max
@cond = cond
@queue = []
@count = 0
end
def run
@queue << [1, @max, []]
while @queue.size > 0 do
task = @queue.shift
from, to, nums = task
(from..to).each do |i|
new_nums = nums + [i]
if new_nums.size >= @@max_size
if new_nums.reduce{|sum, n| sum + n} == @cond
@count += 1
end
else
if i + 1 < @max
@queue << [i + 1, @max, new_nums]
end
end
end
end
return @count
end
end
lines = STDIN.read.split("\n")
lines.each do |line|
n, x = line.split(' ').map(&:to_i)
break if n == 0 && x == 0
puts Counter.new(n, x).run()
end | class Counter
@@max_size = 3
def initialize(max, cond)
@max = max
@cond = cond
@queue = []
@count = 0
end
def run
@queue << [1, @max, []]
while @queue.size > 0 do
task = @queue.shift
from, to, nums = task
(from..to).each do |i|
new_nums = nums + [i]
if new_nums.size >= @@max_size
if new_nums.reduce{|sum, n| sum + n} == @cond
@count += 1
end
else
if i + 1 <= @max
@queue << [i + 1, @max, new_nums]
end
end
end
end
return @count
end
end
lines = STDIN.read.split("\n")
lines.each do |line|
n, x = line.split(' ').map(&:to_i)
break if n == 0 && x == 0
puts Counter.new(n, x).run()
end | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 219,153 | 219,154 | u854587684 | ruby |
p02412 | def read_inputs
inputs = []
loop do
input = gets.split(" ").map(&:to_i)
case input
when [0, 0] then break
else inputs << input
end
end
inputs
end
def countWays(n, x)
(1..n).map {|a|
sb = a + 1
next 0 if sb >= n
[*sb..n].map {|b|
sc = b + 1
next 0 if sc >= n
[*sc..n].map {|c|
next 0 if a == b || b == c || a == c
next 1 if a + b + c == x
0
}.inject(:+)
}.inject(:+)
}.inject(:+)
end
inputs = read_inputs
puts inputs.map {|i| countWays(*i)}.join("\n") | def read_inputs
inputs = []
loop do
input = gets.split(" ").map(&:to_i)
case input
when [0, 0] then break
else inputs << input
end
end
inputs
end
def countWays(n, x)
(1..n).map {|a|
sb = a + 1
next 0 if sb > n
[*sb..n].map {|b|
sc = b + 1
next 0 if sc > n
[*sc..n].map {|c|
next 0 if a == b || b == c || a == c
next 1 if a + b + c == x
0
}.inject(:+)
}.inject(:+)
}.inject(:+)
end
inputs = read_inputs
puts inputs.map {|i| countWays(*i)}.join("\n") | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 219,169 | 219,170 | u906710658 | ruby |
p02412 | loop do
n, x = gets.split.map(&:to_i)
break if n && x == 0
anscount = 0
(1..(n - 2)).each do |a|
((a + 1)..(n - 1)).each do |b|
((b + 1)..n).each do |c|
if a + b + c == x
anscount += 1
end
end
end
end
puts anscount
end | loop do
n, x = gets.split.map(&:to_i)
break if n == 0 && x == 0
anscount = 0
(1..(n - 2)).each do |a|
((a + 1)..(n - 1)).each do |b|
((b + 1)..n).each do |c|
if a + b + c == x
anscount += 1
end
end
end
end
puts anscount
end | [
"control_flow.branch.if.condition.change"
] | 219,173 | 219,174 | u932376477 | ruby |
p02412 | loop do
input = gets.split(" ")
if input[0] == "0" && input[1] == "0"; break; end
n = input[0].to_i
x = input[1].to_i
sum = 0
1.upto(n) do |a|
(a+1).upto(n) do |b|
(b+1).upto(n) do |c|
if a != b && b != c && a != c && (a + b + c == x)
sum += 1
end
end
end
end
ans << sum
end
puts ans
| ans = []
loop do
input = gets.split(" ")
if input[0] == "0" && input[1] == "0"; break; end
n = input[0].to_i
x = input[1].to_i
sum = 0
1.upto(n) do |a|
(a+1).upto(n) do |b|
(b+1).upto(n) do |c|
if a != b && b != c && a != c && (a + b + c == x)
sum += 1
end
end
end
end
ans << sum
end
puts ans
| [
"assignment.add"
] | 219,177 | 219,178 | u219639974 | ruby |
p02412 | while true
n, x = gets.split.map(&:to_i)
break if n == 0 && x == 0
com = 0
for i in 1..n
for j in (i + 1)..n
for k in (i + 2)..n
if i + j + k == x
com += 1
end
end
end
end
puts com
end
| while true
n, x = gets.split.map(&:to_i)
break if n == 0 && x == 0
com = 0
for i in 1..n
for j in (i + 1)..n
for k in (j + 1)..n
if i + j + k == x
com += 1
end
end
end
end
puts com
end
| [
"identifier.change",
"expression.operation.binary.change",
"literal.number.integer.change"
] | 219,179 | 219,180 | u087014397 | ruby |
p02416 | while x = gets
break if x == "0"
sum = 0
x.split("").map{|a|sum += a.to_i}
puts sum
end | while x = gets.chomp
break if x == "0"
sum = 0
x.split("").map{|a|sum += a.to_i}
puts sum
end | [
"call.add"
] | 221,825 | 221,826 | u229669351 | ruby |
p02416 | while true do
x = gets
break if x == '0'
i = 0
for c in x.chars
i += c.to_i
end
puts i
end
| while true do
x = gets.chomp
break if x == '0'
i = 0
for c in x.chars
i += c.to_i
end
puts i
end
| [
"call.add"
] | 221,829 | 221,830 | u407138207 | ruby |
p02416 | while true do
x = gets
break if x == '0'
i = 0
for c in x.chars
i += c.to_i
end
puts i
end
| while true
x = gets.chomp
break if x == '0'
i = 0
for c in x.chars
i += c.to_i
end
puts i
end | [
"call.add"
] | 221,829 | 221,831 | u407138207 | ruby |
p02416 | while true
x = gets.chomp
break if x == 0
i = 0
for c in x.chars
i += c.to_i
end
puts i
end | while true
x = gets.chomp
break if x == '0'
i = 0
for c in x.chars
i += c.to_i
end
puts i
end | [
"control_flow.branch.if.condition.change"
] | 221,832 | 221,831 | u407138207 | ruby |
p02416 | while true do
x = gets.chomp
break if x == 0
i = 0
for c in x.chars
i += c.to_i
end
puts i
end | while true
x = gets.chomp
break if x == '0'
i = 0
for c in x.chars
i += c.to_i
end
puts i
end | [
"control_flow.branch.if.condition.change"
] | 221,833 | 221,831 | u407138207 | ruby |
p02416 | while(x=gets)!="0"
s=0
x.length.times{|i|s+=x[i].to_i}
puts s
end | while (x=gets)!="0\n"
s=0
x.length.times{|i|s+=x[i].to_i}
puts s
end | [
"literal.string.change",
"expression.operation.binary.change"
] | 221,834 | 221,835 | u279605379 | ruby |
p02416 | while num = gets
answer = 0
return if num == '0'
(num.chomp).each_char{|ch|
answer += ch.to_i
}
puts answer
end
| while line = gets
num = line.chomp
answer = 0
return if num == '0'
(num.chomp).each_char{|ch|
answer += ch.to_i
}
puts answer
end
| [
"assignment.variable.change",
"identifier.change"
] | 221,845 | 221,846 | u401720175 | ruby |
p02416 | while (n = gets.to_i) != 0
puts n.to_s.gets.split(" ").map(&:to_i).inject(:+)
end
| while (n = gets.to_i) != 0
puts n.to_s.split("").map(&:to_i).inject(:+)
end
| [
"call.remove",
"literal.string.change",
"call.arguments.change"
] | 221,849 | 221,850 | u236620240 | ruby |
p02418 | a=gets.chomp
b=gets.chomp
string = "#{a}"
if string.include?("#{b}")
puts "Yes"
else
puts "No"
end
| a=gets.chomp
b=gets.chomp
string = "#{a}"*2
if string.include?("#{b}")
puts "Yes"
else
puts "No"
end
| [
"assignment.change"
] | 222,092 | 222,093 | u156659396 | ruby |
p02418 | s = gets.chomp *2
p = gets.chomp
if [0..s.size].any?{|i| s[i,p.size] == p}
puts 'Yes'
else
puts 'No'
end | s = gets.chomp()*2
p = gets.chomp
if [*0..s.size].any?{|i| s[i,p.size] == p}
puts 'Yes'
else
puts 'No'
end | [
"call.add",
"control_flow.branch.if.condition.change"
] | 222,109 | 222,110 | u714639016 | ruby |
p02418 | s = gets.chomp()*2
p = gets.chomp
if [0..s.size].any?{|i| s[i,p.size] == p}
puts 'Yes'
else
puts 'No'
end | s = gets.chomp()*2
p = gets.chomp
if [*0..s.size].any?{|i| s[i,p.size] == p}
puts 'Yes'
else
puts 'No'
end | [
"control_flow.branch.if.condition.change"
] | 222,111 | 222,110 | u714639016 | ruby |
p02418 | a=gets.chomp,b=gets.chomp
puts (a*2).include?(b)?"YES":"NO" | a=gets.chomp
b=gets.chomp
puts (a*2).include?(b)?"Yes":"No" | [
"literal.string.change",
"literal.string.case.change",
"call.arguments.change"
] | 222,114 | 222,115 | u712035986 | ruby |
p02419 | gets.chop!
p$<.read.split.count$_
| gets.chop!
p$<.read.downcase.split.count$_
| [
"call.add"
] | 222,154 | 222,155 | u353994935 | ruby |
p02419 | word = gets.chomp.downcase
text = readline('END_OF_TEXT').gsub!('END_OF_TEXT', '').downcase
p text
puts text.scan(/\b#{word}\b/).size | word = gets.chomp.downcase
text = readline('END_OF_TEXT').gsub!('END_OF_TEXT', '').downcase
puts text.scan(/\b#{word}\b/).size | [
"call.remove"
] | 222,160 | 222,161 | u390149337 | ruby |
p02419 | w = gets.chomp
cnt = 0
until (s = gets.chomp) == "END_OF_TEXT"
a = s.split
a.each do |t|
cnt += 1 if t == w
end
end
puts cnt | w = gets.chomp.downcase
cnt = 0
until (s = gets.chomp) == "END_OF_TEXT"
a = s.split
a.each do |t|
cnt += 1 if t.downcase == w
end
end
puts cnt | [
"call.add",
"control_flow.branch.if.condition.change"
] | 222,167 | 222,168 | u324171823 | ruby |
p02419 | w=gets.chomp.downcase
ww=[]
while line=gets
x=line.downcase.split(" ")
x.each{|xx|
ww << xx if xx.include?(w)
}
end
puts ww.size | w=gets.chomp.downcase
ww=[]
while line=gets
x=line.downcase.split(" ")
x.each{|xx|
ww << xx if xx==w
}
end
puts ww.size | [
"control_flow.branch.if.condition.change",
"call.remove"
] | 222,169 | 222,170 | u565102293 | ruby |
p02419 | str1 = gets.chomp.downcase
num = 0
ary = []
ARGF.each do |line|
break if line.chomp == "END_OF_TEXT"
ary << line.chomp.split
ary = ary.flatten
ary.count.times do |i|
if str1 == ary[i]
num += 1
end
end
ary = []
end
puts num | str1 = gets.chomp.downcase
num = 0
ary = []
ARGF.each do |line|
break if line.chomp == "END_OF_TEXT"
ary << line.chomp.split.map(&:downcase)
ary = ary.flatten
ary.count.times do |i|
if str1 == ary[i]
num += 1
end
end
ary = []
end
puts num | [
"call.add"
] | 222,171 | 222,172 | u330842660 | ruby |
p02419 |
str = gets.chomp
arr = []
while true
value = gets.chomp.split(" ")
arr << value
break if value[0] == "END_OF_TEXT"
end
ans = 0
arr.each do |value|
value.each do |val2|
if val2 == str
ans += 1
end
end
end
p ans |
str = gets.chomp
arr = []
while true
value = gets.chomp.split(" ")
arr << value
break if value[0] == "END_OF_TEXT"
end
ans = 0
arr.each do |value|
value.each do |val2|
if val2.capitalize == str.capitalize
ans += 1
end
end
end
p ans | [
"control_flow.branch.if.condition.change",
"call.add"
] | 222,175 | 222,176 | u046695668 | ruby |
p02419 | w = STDIN.gets.chomp()
text = []
while true
line = STDIN.gets.chomp()
if line == "END_OF_TEXT" then
break
else
text << line
end
end
# puts w
# puts text
count = 0
for i in 0..text.length - 1 do
line = text[i]
# puts line
words = line.split(" ")
# puts words
for j in 0..words.length - 1 do
if words[j] == w then
count += 1
end
end
end
puts count | w = STDIN.gets.chomp()
text = []
while true
line = STDIN.gets.chomp()
if line == "END_OF_TEXT" then
break
else
line = line.downcase
text << line
end
end
# puts w
# puts text
count = 0
for i in 0..text.length - 1 do
line = text[i]
# puts line
words = line.split(" ")
# puts words
for j in 0..words.length - 1 do
if words[j] == w then
count += 1
end
end
end
puts count | [
"assignment.add"
] | 222,177 | 222,178 | u938745275 | ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.