Datasets:

problem_id
stringlengths
6
6
buggy_code
stringlengths
8
526k
fixed_code
stringlengths
12
526k
labels
listlengths
0
15
buggy_submission_id
int64
1
1.54M
fixed_submission_id
int64
2
1.54M
user_id
stringlengths
10
10
language
stringclasses
8 values
p02400
r = gets.chomp.to_f area= 3.14*r**2.to_f zhou = 2*3.14*r.to_f print area," ",zhou
r = gets.chomp.to_f area= Math::PI*r**2.to_f zhou = 2*Math::PI*r.to_f print area," ",zhou
[ "assignment.value.change", "expression.operation.binary.change" ]
190,782
190,783
u412829970
ruby
p02400
include Math r = gets.chomp.to_f printf "%f%F\n",r*r*PI,2*r*PI
include Math r = gets.chomp.to_f printf "%f %f\n",r*r*PI,2*r*PI
[ "literal.string.change", "call.arguments.change" ]
190,803
190,801
u407138207
ruby
p02400
include Math r = gets.chomp.to_f printf "%f%F\n",r*r*PI,2*r*PI
include Math r = gets.chomp.to_f printf "%f %f\n",r*r*PI,2*r*PI
[ "literal.string.change", "call.arguments.change" ]
190,804
190,801
u407138207
ruby
p02400
include Math r = gets.chomp.to_f printf "%f%f\n",r*r*PI,2*r*PI
include Math r = gets.chomp.to_f printf "%f %f\n",r*r*PI,2*r*PI
[ "literal.string.change", "call.arguments.change" ]
190,805
190,801
u407138207
ruby
p02400
include Math r = gets.to_f len = 2 * PI * r eria = PI *r *r puts "#{erea} #{len}"
include Math r = gets.to_f len = 2 * PI * r area = PI * r * r puts "#{area} #{len}"
[ "assignment.variable.change", "identifier.change", "literal.string.change", "call.arguments.change" ]
190,806
190,807
u407138207
ruby
p02400
include Math r = gets.to_f len = 2 * PI * r area = PI *r *r puts "#{erea} #{len}"
include Math r = gets.to_f len = 2 * PI * r area = PI * r * r puts "#{area} #{len}"
[ "literal.string.change", "call.arguments.change" ]
190,808
190,807
u407138207
ruby
p02400
include Math r = gets.to_f puts "#{r*r*PI} #{PI*r*r}"
include Math r = gets.to_f puts "#{r*r*PI} #{2*r*PI}"
[ "literal.string.change", "call.arguments.change" ]
190,812
190,813
u407138207
ruby
p02400
r=gets.to_f p=3.1415 puts"#{r*r*p} #{2*r*p}"
r=gets.to_f p=3.14159265359 puts"#{r*r*p} #{2*r*p}"
[ "literal.number.float.change", "assignment.value.change" ]
190,828
190,829
u279605379
ruby
p02400
r=gets.to_f p=3.1415 puts"#{r*r*p} #{2*r*p}"
r=gets.to_f p=Math::PI puts"#{r*r*p} #{2*r*p}"
[ "assignment.value.change" ]
190,828
190,833
u279605379
ruby
p02400
r=gets.to_f p=3.141592653 puts"#{r*r*p} #{2*r*p}"
r=gets.to_f p=Math::PI puts"#{r*r*p} #{2*r*p}"
[ "assignment.value.change" ]
190,831
190,833
u279605379
ruby
p02400
r=gets.to_f p=3.1415 puts"#{r*r*p} #{2*r*p}"
r=gets.to_f p=-1.arg puts"#{r*r*p} #{2*r*p}"
[ "assignment.value.change", "call.add" ]
190,828
190,834
u279605379
ruby
p02400
r=gets.to_f p=3.141592653 puts"#{r*r*p} #{2*r*p}"
r=gets.to_f p=-1.arg puts"#{r*r*p} #{2*r*p}"
[ "assignment.value.change", "call.add" ]
190,831
190,834
u279605379
ruby
p02400
a=gets.split.map &:to_f pi=3.1415926535897932 puts [sprintf("%.6f", (a*a*pi)) , sprintf("%.6f", (a*2*pi))]*" "
a=gets.to_f pi=3.1415926535897932 puts [sprintf("%.6f", (a*a*pi)) , sprintf("%.6f", (a*2*pi))]*" "
[ "assignment.value.change", "identifier.change", "call.remove" ]
190,862
190,861
u274307745
ruby
p02400
a=gets.map &:to_f pi=3.1415926535897932 puts [sprintf("%.6f", (a*a*pi)) , sprintf("%.6f", (a*2*pi))]*" "
a=gets.to_f pi=3.1415926535897932 puts [sprintf("%.6f", (a*a*pi)) , sprintf("%.6f", (a*2*pi))]*" "
[ "assignment.value.change", "identifier.change" ]
190,863
190,861
u274307745
ruby
p02400
pi = 3.141592653 r = gets.to_f puts "#{(pi*r*r).round(6)} #{(2*pi*r).round(6)}"
pi = 3.1415926535898 r = gets.to_f puts "#{(pi*r*r).round(6)} #{(2*pi*r).round(6)}"
[ "literal.number.float.change", "assignment.value.change" ]
190,864
190,865
u350127362
ruby
p02400
pi = 3.141592653 r = gets.to_f.round(8) puts "#{(pi*r*r).round(6)} #{(2*pi*r).round(6)}"
pi = 3.1415926535898 r = gets.to_f puts "#{(pi*r*r).round(6)} #{(2*pi*r).round(6)}"
[ "literal.number.float.change", "assignment.value.change", "call.remove" ]
190,866
190,865
u350127362
ruby
p02400
r = gets.to_f printf("%.6f, %.6f\n", r*r*Math::PI, 2*r*Math::PI)
r = gets.to_f printf("%.6f %.6f", r*r*Math::PI, 2.0*r*Math::PI)
[ "literal.string.change", "call.arguments.change", "expression.operation.binary.change", "io.output.change" ]
190,874
190,875
u087014397
ruby
p02400
r = gets.to_f printf("%.6f, %.6f\n", r*r*Math::PI, 2.0*r*Math::PI)
r = gets.to_f printf("%.6f %.6f", r*r*Math::PI, 2.0*r*Math::PI)
[ "literal.string.change", "call.arguments.change" ]
190,876
190,875
u087014397
ruby
p02400
r = gets.to_f printf("%.6f, %.6f", r*r*Math::PI, 2.0*r*Math::PI)
r = gets.to_f printf("%.6f %.6f", r*r*Math::PI, 2.0*r*Math::PI)
[ "literal.string.change", "call.arguments.change" ]
190,877
190,875
u087014397
ruby
p02400
r = gets.to_f printf("%f, %f", r*r*Math::PI, 2.0*r*Math::PI)
r = gets.to_f printf("%.6f %.6f", r*r*Math::PI, 2.0*r*Math::PI)
[ "literal.string.change", "call.arguments.change" ]
190,878
190,875
u087014397
ruby
p02400
r = gets.to_f pi = Math::PI puts sprintf("%.6f %.6g", pi * r * r, 2.0 * pi * r)
r = gets.to_f pi = Math::PI puts sprintf("%.6f %.6f", pi * r * r, 2.0 * pi * r)
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
190,886
190,887
u534156032
ruby
p02402
ARGF.each_with_index do |line, i| unless i == 0 ary = line.split.map(&:to_i) puts "#{ary.min} #{ary.max} #{ary.inject}" end end
ARGF.each_with_index do |line, i| unless i == 0 ary = line.split.map(&:to_i) puts "#{ary.min} #{ary.max} #{ary.inject(:+)}" end end
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
195,394
195,395
u330842660
ruby
p02402
n = gets.to_i a = gets.split.map(&:to_i).sort for i in 1..n do sum += a[i] end puts "#{a[0]} #{a[n-1]} #{sum}"
sum = 0; n = gets.to_i a = gets.split.map(&:to_i).sort for i in 0...n do sum += a[i] end puts "#{a[0]} #{a[n-1]} #{sum}"
[ "literal.number.integer.change" ]
195,400
195,401
u061116826
ruby
p02402
gets a = gets.chop.split(" ").map{|str| str.to_i} puts a.max.to_s + " " + a.min.to_s + " " + a.inject(:+).to_s
gets a = gets.chop.split(" ").map{|str| str.to_i} puts a.min.to_s + " " + a.max.to_s + " " + a.inject(:+).to_s
[ "misc.opposites", "identifier.change", "call.arguments.change", "expression.operation.binary.change" ]
195,406
195,407
u098622705
ruby
p02402
gets; a = gets.split(" ").map(:to_i).sort; puts a.first.to_s + " " + a.last.to_s + " " + a.inject(:+).to_s;
gets; a = gets.split(" ").map(&:to_i).sort; puts a.first.to_s + " " + a.last.to_s + " " + a.inject(:+).to_s;
[ "call.arguments.change" ]
195,412
195,409
u328069918
ruby
p02402
n = gets.to_i num = gets.split.map(&:to_i) num.sort! print num[2]," ",num[n-1]," ",num.inject(:+)
n = gets.to_i num = gets.split.map(&:to_i) num.sort! print num[0]," ",num[n-1]," ",num.inject(:+),"\n"
[ "literal.number.integer.change", "variable_access.subscript.index.change", "call.arguments.change", "call.arguments.add" ]
195,414
195,415
u412829970
ruby
p02402
n = gets.to_i num = gets.split.map(&:to_i) num.sort! print num[2]," ",num[n-1]," ",num.inject(:+),"\n"
n = gets.to_i num = gets.split.map(&:to_i) num.sort! print num[0]," ",num[n-1]," ",num.inject(:+),"\n"
[ "literal.number.integer.change", "variable_access.subscript.index.change", "call.arguments.change" ]
195,416
195,415
u412829970
ruby
p02402
countNum = gets.to_i aryNums = gets.split.map(&:to_i); maxNum = aryNums[0]; minNum = aryNums[0]; sum = 0; for num in 0..4 do if maxNum < aryNums[num] then maxNum = aryNums[num]; end if minNum > aryNums[num] then minNum = aryNums[num]; end sum += aryNums[num]; end puts minNum.to_s + " " + maxNum.to_s + " " + sum.to_s
countNum = gets.to_i aryNums = gets.split.map(&:to_i); maxNum = aryNums[0]; minNum = aryNums[0]; sum = 0; for num in 0..countNum-1 do if maxNum < aryNums[num] then maxNum = aryNums[num]; end if minNum > aryNums[num] then minNum = aryNums[num]; end sum += aryNums[num]; end puts minNum.to_s + " " + maxNum.to_s + " " + sum.to_s
[ "identifier.replace.add", "literal.replace.remove" ]
195,418
195,419
u606593727
ruby
p02402
x = gets.chomp a = gets.splut.map(&:to_i) puts [a.min, a.max, a.inject(:+)].join" "
x = gets.chomp a = gets.split.map(&:to_i) puts [a.min, a.max, a.inject(:+)].join" "
[ "assignment.value.change", "identifier.change" ]
195,421
195,422
u407138207
ruby
p02402
a = gets.split.map(&:to_i) n = a.min x = a.max s = a.inject(:+) puts "#{n} #{x} #{s}"
gets arr = gets.split.map(&:to_i) n = arr.min x = arr.max s = arr.inject(:+) puts "#{n} #{x} #{s}"
[ "assignment.value.change", "identifier.change" ]
195,423
195,424
u407138207
ruby
p02402
a = gets.split.map(&:to_i) n = a.min x = a.max s = a.inject(:+) puts "#{n} #{x} #{s}"
gets arr = gets.split.map(&:to_i) n = arr.min x = arr.max s = arr.inject(:+) puts "#{n} #{x} #{s}"
[ "assignment.value.change", "identifier.change" ]
195,423
195,425
u407138207
ruby
p02402
n = gets.to_i datas = gets.split.map{|x| x.to_i} puts "#{datas.min}\n#{datas.max}\n#{datas.inject{|sum, i| sum + i}}"
n = gets.to_i datas = gets.split.map{|x| x.to_i} puts "#{datas.min} #{datas.max} #{datas.inject{|sum, i| sum + i}}"
[ "literal.string.change", "call.arguments.change" ]
195,436
195,437
u256874901
ruby
p02402
min=100;max=0;sum=0 n=gets.chomp.to_i str=gets.chomp num=Array.new number=str.split for i in 0..n-1 do num[i]=number[i].to_i end for i in 0..n-1 do if num[i]<min then min=num[i] end if num[i]>max then max=num[i] end sum+=num[i] end puts "#{min} #{max} #{sum}"
min=100000000;max=-100000000;sum=0 n=gets.chomp.to_i str=gets.chomp num=Array.new number=str.split for i in 0..n-1 do num[i]=number[i].to_i end for i in 0..n-1 do if num[i]<min then min=num[i] end if num[i]>max then max=num[i] end sum+=num[i] end puts "#{min} #{max} #{sum}"
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.unary.add" ]
195,440
195,441
u284204984
ruby
p02402
input = gets.split.map(&:to_i) print "#{input.sort.first} #{input.sort.reverse.first} #{input.inject(:+)}"
n = gets input = gets.split.map(&:to_i) puts "#{input.sort.first} #{input.sort.reverse.first} #{input.inject(:+)}"
[ "identifier.change" ]
195,442
195,443
u569541270
ruby
p02402
gets a=gets.split.map(&:to_i) min=a[0] max=a[0] sum=a[0] a.each{|i| if(i<min) min=i end if(i>max) max=i end sum+=i } printf("%d %d %d",min,max,sum)
gets a=gets.split.map(&:to_i) min=a[0] max=a[0] sum=0 a.each{|i| if(i<min) min=i end if(i>max) max=i end sum+=i } printf("%d %d %d\n",min,max,sum)
[ "literal.string.change", "call.arguments.change" ]
195,444
195,445
u067629267
ruby
p02402
gets a=gets.split.map(&:to_i) min=a[0] max=a[0] sum=a[0] a.each{|i| if(i<min) min=i end if(i>max) max=i end sum+=i } printf("%d %d %d\n",min,max,sum)
gets a=gets.split.map(&:to_i) min=a[0] max=a[0] sum=0 a.each{|i| if(i<min) min=i end if(i>max) max=i end sum+=i } printf("%d %d %d\n",min,max,sum)
[]
195,446
195,445
u067629267
ruby
p02402
gets a=gets.split.map(&:to_i) puts"#{a.min},#{a.max},#{a.inject{|i,j|i+j}}"
gets a=gets.split.map(&:to_i) puts"#{a.min} #{a.max} #{a.inject{|i,j|i+j}}"
[ "literal.string.change", "call.arguments.change" ]
195,447
195,448
u067629267
ruby
p02402
n = gets.chomp.to_i a = gets.chomp.split(" ").map{|x| x.to_i} min = 10000 max = 0 sum = 0 for i in 0..(n-1) do if a[i] < min min = a[i] end if max < a[i] max = a[i] end sum += a[i] end printf("%d %d %d\n",min, max, sum)
n = gets.chomp.to_i a = gets.chomp.split(" ").map{|x| x.to_i} min = 1000000 max = -1000000 sum = 0 for i in 0..(n-1) do if a[i] < min min = a[i] end if max < a[i] max = a[i] end sum += a[i] end printf("%d %d %d\n",min, max, sum)
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.unary.add" ]
195,451
195,452
u241079749
ruby
p02402
n = gets.chomp.to_i a = gets.chomp.split(" ").map{|x| x.to_i} min = 1000000 max = −1000000 sum = 0 for i in 0..(n-1) do if a[i] < min min = a[i] end if max < a[i] max = a[i] end sum += a[i] end printf("%d %d %d\n",min, max, sum)
n = gets.chomp.to_i a = gets.chomp.split(" ").map{|x| x.to_i} min = 1000000 max = -1000000 sum = 0 for i in 0..(n-1) do if a[i] < min min = a[i] end if max < a[i] max = a[i] end sum += a[i] end printf("%d %d %d\n",min, max, sum)
[ "expression.operation.unary.add" ]
195,453
195,452
u241079749
ruby
p02402
a = gets.split.map(&:to_i) puts "#{a.min} #{a.max} #{a.inject(&:+)}"
gets a = gets.split.map(&:to_i) puts "#{a.min} #{a.max} #{a.inject(&:+)}"
[]
195,456
195,457
u864617427
ruby
p02407
n = gets.to_i a = gets.split("").map(&:to_i) puts a.reverse.join("")
n = gets a = gets.split(" ").map(&:to_i) puts a.reverse.join(" ")
[ "call.remove", "literal.string.change", "assignment.value.change", "call.arguments.change", "io.output.change" ]
207,349
207,350
u456075975
ruby
p02407
n = gets a = gets.split("").map(&:to_i) puts a.reverse.join("")
n = gets a = gets.split(" ").map(&:to_i) puts a.reverse.join(" ")
[ "literal.string.change", "assignment.value.change", "call.arguments.change", "io.output.change" ]
207,351
207,350
u456075975
ruby
p02407
n = gets a = gets.split("").map(&:to_i) puts a.reverse.join("")
gets a = gets.split(" ").map(&:to_i) puts a.reverse.join(" ")
[ "literal.string.change", "assignment.value.change", "call.arguments.change", "io.output.change" ]
207,351
207,352
u456075975
ruby
p02407
a = gets.split(" ").map(&:to_i) puts a.reverse.join(" ")
gets a = gets.split(" ").map(&:to_i) puts a.reverse.join(" ")
[]
207,353
207,352
u456075975
ruby
p02407
n = gets puts gets.reverse.split.join(" ")
n = gets puts gets.split.reverse.join(" ")
[ "call.remove", "call.add" ]
207,354
207,355
u156659396
ruby
p02407
gets nums = gets.chomp.reverse puts num.join(' ')
gets nums = gets.chomp.split.reverse puts nums.join(' ')
[ "call.add", "identifier.change", "call.arguments.change", "io.output.change" ]
207,360
207,361
u765748067
ruby
p02407
gets nums = gets.chomp.split.reverse puts num.join(' ')
gets nums = gets.chomp.split.reverse puts nums.join(' ')
[ "identifier.change", "call.arguments.change", "io.output.change" ]
207,362
207,361
u765748067
ruby
p02407
n=gets.to_i mp=gets.split(' ').map(&:to_i).sort! n.downto(1){ |i| if i==1 then printf("%d\n",mp[i-1]) else printf("%d ",mp[i-1]) end }
n=gets.to_i mp=gets.split(' ').map(&:to_i) n.downto(1){ |i| if i==1 then printf("%d\n",mp[i-1]) else printf("%d ",mp[i-1]) end }
[ "call.remove" ]
207,379
207,380
u665389142
ruby
p02407
gets puts gets.split.map(:to_i).reverse.join(' ')
gets puts gets.split.map(&:to_i).reverse.join(' ')
[ "call.arguments.change" ]
207,381
207,382
u281180011
ruby
p02407
gets n = gets.split("").map{|v| v= v.to_i} puts n.reverse.join(" ")
gets n = gets.split(" ").map{|v| v=v.to_i} puts n.reverse.join(" ")
[ "literal.string.change", "assignment.value.change", "call.arguments.change" ]
207,389
207,390
u648595404
ruby
p02407
# -*- coding: utf-8 -*- # データの数を取得 n = STDIN.gets # 数列を取得 arr = STDIN.gets.split.map(&:to_i) # ここから変える puts arr.reverse puts arr.join(" ")
# -*- coding: utf-8 -*- # データの数を取得 n = STDIN.gets # 数列を取得 arr = STDIN.gets.split.map(&:to_i) # ここから変える puts arr.reverse.join(" ")
[ "call.remove" ]
207,393
207,394
u333589327
ruby
p02407
# -*- coding: utf-8 -*- # データの数を取得 n = STDIN.gets # 数列を取得 arr = STDIN.gets.split.map(&:to_i) # ここから変える arr.reverse.join(' ')
# -*- coding: utf-8 -*- # データの数を取得 n = STDIN.gets # 数列を取得 arr = STDIN.gets.split.map(&:to_i) # ここから変える puts arr.reverse.join(' ')
[ "io.output.change", "call.add" ]
207,395
207,396
u094835114
ruby
p02407
a = STDIN.gets p STDIN.gets.split.reverse.join(" ")
a = STDIN.gets puts STDIN.gets.split.reverse.join(" ")
[ "call.function.change", "io.output.change" ]
207,399
207,398
u225502267
ruby
p02407
a = gets.split.map(&:to_i) puts(a.reverse.join(" "))
gets a = gets.split.map(&:to_i) puts(a.reverse.join(" "))
[]
207,408
207,409
u407138207
ruby
p02407
n = gets.to_i a = gets p a.split.reverse.join " "
n = gets.to_i a = gets puts a.split.reverse.join " "
[ "call.function.change", "io.output.change" ]
207,410
207,411
u517018006
ruby
p02407
gets puts gets.spilit.map(&:to_i).reverse.join(" ")
gets puts gets.split.map(&:to_i).reverse.join(" ")
[ "identifier.change", "call.arguments.change" ]
207,428
207,429
u087014397
ruby
p02407
n = gets puts n.split.map(&:to_i).reverse.join(" ")
gets puts gets.split.map(&:to_i).reverse.join(" ")
[ "identifier.change", "call.arguments.change" ]
207,430
207,429
u087014397
ruby
p02407
n = gets.split.map(&:to_i) puts n.reverse.join(" ")
gets puts gets.split.map(&:to_i).reverse.join(" ")
[ "call.remove" ]
207,431
207,429
u087014397
ruby
p02408
n = gets.to_i h = {} n.times do s = gets h[s] = 1 end for m in ["S", "H", "C", "D"] do for i in 1..13 do puts "#{m} #{i}" if !h.has_key?(m+" "+i.to_s) end end
n = gets.to_i h = {} n.times do s = gets h[s.chomp] = 1 end for m in ["S", "H", "C", "D"] do for i in 1..13 do puts "#{m} #{i}" if !h.has_key?(m+" "+i.to_s) end end
[ "call.add" ]
208,247
208,248
u156659396
ruby
p02408
n = gets.to_i h = {} n.times do s = gets h[s] = 1 end for m in ["S", "H", "C", "D"] do for i in 1..13 do puts "#{m} #{i}" if !h.has_key?(m+" "+i.to_s) end end
n = gets.to_i h = {} n.times do s = gets h[s.chomp]=1 end for m in ["S", "H", "C", "D"] do for i in 1..13 do puts "#{m} #{i}" if !h.has_key?(m+" "+i.to_s) end end
[ "call.add" ]
208,247
208,249
u156659396
ruby
p02408
n = gets.to_i h = {} n.times do s = gets h[s.chomp] end for m in ["S", "H", "C", "D"] do for i in 1..13 do puts "#{m} #{i}" if !h.has_key?(m+" "+i.to_s) end end
n = gets.to_i h = {} n.times do s = gets h[s.chomp]=1 end for m in ["S", "H", "C", "D"] do for i in 1..13 do puts "#{m} #{i}" if !h.has_key?(m+" "+i.to_s) end end
[ "assignment.add" ]
208,250
208,249
u156659396
ruby
p02408
n = gets.to_i h = {} n.times do s = gets h[s.chomp] end for m in ["S", "H", "C", "D"] do for i in 1..13 do puts "#{m} #{i}" if !h.has_key?(m+" "+i.to_s) end end
n = gets.to_i h = {} n.times do s = gets h[s.chomp]=2 end for m in ["S", "H", "C", "D"] do for i in 1..13 do puts "#{m} #{i}" if !h.has_key?(m+" "+i.to_s) end end
[ "assignment.add" ]
208,250
208,255
u156659396
ruby
p02408
n = gets.to_i h = {} n.times do s = gets h[s] = 1 end for m in ["S", "H", "C", "D"] do for i in 1..13 do puts "#{m} #{i}" if !h.has_key?(m+" "+i.to_s) end end
n = gets.to_i h = {} n.times do s = gets h[s.chomp]=34 end for m in ["S", "H", "C", "D"] do for i in 1..13 do puts "#{m} #{i}" if !h.has_key?(m+" "+i.to_s) end end
[ "call.add", "literal.number.integer.change", "assignment.value.change" ]
208,247
208,256
u156659396
ruby
p02408
n = gets.to_i h = {} n.times do s = gets h[s.chomp] end for m in ["S", "H", "C", "D"] do for i in 1..13 do puts "#{m} #{i}" if !h.has_key?(m+" "+i.to_s) end end
n = gets.to_i h = {} n.times do s = gets h[s.chomp]=34 end for m in ["S", "H", "C", "D"] do for i in 1..13 do puts "#{m} #{i}" if !h.has_key?(m+" "+i.to_s) end end
[ "assignment.add" ]
208,250
208,256
u156659396
ruby
p02408
n = gets.to_i h = {} n.times do s = gets h[s] = 1 end for m in ["S", "H", "C", "D"] do for i in 1..13 do puts "#{m} #{i}" if !h.has_key?(m+" "+i.to_s) end end
n = gets.to_i h = {} n.times do s = gets h[s.chomp] =0 #すべとをまず与えにする 計算始めるために end for m in ["S", "H", "C", "D"] do #一般的なFOR分の使い方にin を使う for i in 1..13 do puts "#{m} #{i}" if !h.has_key?(m+" "+i.to_s)#データの中にキーがあるかどうかの確認 end end
[ "call.add", "literal.number.integer.change", "assignment.value.change" ]
208,247
208,261
u156659396
ruby
p02408
deck = {} %(S H C D).each do |suit| deck[suit] = [*1..13] end _ = gets ARGF.each_line do |line| suit, num = line.split deck[suit].delete(num.to_i) end deck.each do |suit, nums| nums.each do |num| puts "#{suit} #{num}" end end
deck = {} %w(S H C D).each do |suit| deck[suit] = [*1..13] end _ = gets ARGF.each_line do |line| suit, num = line.split deck[suit].delete(num.to_i) end deck.each do |suit, nums| nums.each do |num| puts "#{suit} #{num}" end end
[]
208,262
208,263
u024069892
ruby
p02408
marks = ["S", "H", "D", "C"] cards = [] marks.each do |m| (1..12).each do |n| cards << m + "\s" + n.to_s end end ARGF.each_line do |line| next unless marks.include?(line[0]) d_line = line.chomp cards.delete(d_line) end cards.each do |card| puts card end
marks = ["S", "H", "C", "D"] cards = [] marks.each do |m| (1..13).each do |n| cards << m + "\s" + n.to_s end end ARGF.each_line do |line| next unless marks.include?(line[0]) d_line = line.chomp cards.delete(d_line) end cards.each do |card| puts card end
[ "literal.string.change", "assignment.value.change", "literal.number.integer.change" ]
208,268
208,269
u209022771
ruby
p02408
class Card def initialize @cards = [] @cards = %w(S H C D).each do |mark| (1..13).each do |rank| @cards << "#{mark} #{rank}" end end end def delete(mark=nil, rank=nil) @cards.delete("#{mark} #{rank}") end def open puts @cards end end cards = Card.new gets ARGF.each_line do |line| # m = line.chomp # p m mark, rank = line.chomp.split cards.delete(mark, rank) end cards.open
class Card def initialize @cards = [] %w(S H C D).each do |mark| (1..13).each do |rank| @cards << "#{mark} #{rank}" end end end def delete(mark=nil, rank=nil) @cards.delete("#{mark} #{rank}") end def open puts @cards end end cards = Card.new ARGF.each do |line| mark, rank = line.chomp.split cards.delete(mark, rank) end cards.open
[ "identifier.change" ]
208,273
208,272
u102042957
ruby
p02408
arr = ['H', 'S', 'C', 'D'].map { |v| (1..13).map { |n| "#{v} #{n}" } }.flatten input = [] gets.to_i.times do input << gets.chomp end (arr - input).each do |v| puts v end
arr = ['S', 'H', 'C', 'D'].map { |v| (1..13).map { |n| "#{v} #{n}" } }.flatten input = [] gets.to_i.times do input << gets.chomp end (arr - input).each do |v| puts v end
[ "literal.string.change", "assignment.value.change" ]
208,274
208,275
u739433776
ruby
p02408
s = Array.new( 13, false ) h = Array.new( 13, false ) c = Array.new( 13, false ) d = Array.new( 13, false ) n = gets.to_i for i in ( 0 .. n ) pattern, num = gets.split( " " ) case pattern when "S" s[ num.to_i-1 ] = true when "H" h[ num.to_i-1 ] = true when "C" c[ num.to_i-1 ] = true when "D" d[ num.to_i-1 ] = true else end end for i in ( 0 ... 13 ) if !s[i] print( "S #{i+1}\n" ) end end for i in ( 0 ... 13 ) if !h[i] print( "H #{i+1}\n" ) end end for i in ( 0 ... 13 ) if !c[i] print( "C #{i+1}\n" ) end end for i in ( 0 ... 13 ) if !d[i] print( "D #{i+1}\n" ) end end
s = Array.new( 13, false ) h = Array.new( 13, false ) c = Array.new( 13, false ) d = Array.new( 13, false ) n = gets.to_i for i in ( 0 ... n ) pattern, num = gets.split( " " ) case pattern when "S" s[ num.to_i-1 ] = true when "H" h[ num.to_i-1 ] = true when "C" c[ num.to_i-1 ] = true when "D" d[ num.to_i-1 ] = true else end end for i in ( 0 ... 13 ) if !s[i] print( "S #{i+1}\n" ) end end for i in ( 0 ... 13 ) if !h[i] print( "H #{i+1}\n" ) end end for i in ( 0 ... 13 ) if !c[i] print( "C #{i+1}\n" ) end end for i in ( 0 ... 13 ) if !d[i] print( "D #{i+1}\n" ) end end
[]
208,276
208,277
u604774382
ruby
p02408
n = gets SUIT = ['S', 'H', 'C', 'D'] hash = {} SUIT.each do |s| hash[s] = [*1..12] end while line = gets suit, num = line.split num = num.to_i hash[suit].delete(num) end SUIT.each do |s| unless hash[s].empty? hash[s].each do |num| puts "#{s} #{num}" end end end
n = gets SUIT = ['S', 'H', 'C', 'D'] hash = {} SUIT.each do |s| hash[s] = [*1..13] end while line = gets suit, num = line.split num = num.to_i hash[suit].delete(num) end SUIT.each do |s| unless hash[s].empty? hash[s].each do |num| puts "#{s} #{num}" end end end
[ "literal.number.integer.change", "assignment.value.change" ]
208,288
208,289
u139670451
ruby
p02408
def Suit2Num(s) return 0 if s == "S" return 1 if s == "H" return 2 if s == "C" return 3 if s == "D" nil end def Num2Suit(n) return "S" if n == 0 return "H" if n == 1 return "C" if n == 2 return "D" if n == 3 nil end s = Array.new(4) 4.times { |i| s[i] = Array.new(13) } n = gets.to_i n.times { cs,cr = gets.chomp.split(" ") s[Suit(cs)][cr.to_i-1] = "Exsit" } 4.times { |i| 13.times { |j| puts "#{Num2Suit(i)} #{j+1}" if s[i][j] != "Exist" } }
def Suit2Num(s) return 0 if s == "S" return 1 if s == "H" return 2 if s == "C" return 3 if s == "D" nil end def Num2Suit(n) return "S" if n == 0 return "H" if n == 1 return "C" if n == 2 return "D" if n == 3 nil end s = Array.new(4) 4.times { |i| s[i] = Array.new(13) } n = gets.to_i n.times { cs,cn = gets.chomp.split(" ") s[Suit2Num(cs)][cn.to_i-1] = "Exist" } 4.times { |i| 13.times { |j| puts "#{Num2Suit(i)} #{j+1}" if s[i][j] != "Exist" } }
[ "assignment.variable.change", "identifier.change", "variable_access.subscript.index.change", "expression.operation.binary.change", "literal.string.change", "assignment.value.change" ]
208,290
208,291
u281257618
ruby
p02408
def Suit2Num(s) return 0 if s == "S" return 1 if s == "H" return 2 if s == "C" return 3 if s == "D" nil end def Num2Suit(n) return "S" if n == 0 return "H" if n == 1 return "C" if n == 2 return "D" if n == 3 nil end s = Array.new(4) 4.times { |i| s[i] = Array.new(13) } n = gets.to_i n.times { cs,cr = gets.chomp.split(" ") s[Suit2Num(cs)][cr.to_i-1] = "Exsit" } 4.times { |i| 13.times { |j| puts "#{Num2Suit(i)} #{j+1}" if s[i][j] != "Exist" } }
def Suit2Num(s) return 0 if s == "S" return 1 if s == "H" return 2 if s == "C" return 3 if s == "D" nil end def Num2Suit(n) return "S" if n == 0 return "H" if n == 1 return "C" if n == 2 return "D" if n == 3 nil end s = Array.new(4) 4.times { |i| s[i] = Array.new(13) } n = gets.to_i n.times { cs,cn = gets.chomp.split(" ") s[Suit2Num(cs)][cn.to_i-1] = "Exist" } 4.times { |i| 13.times { |j| puts "#{Num2Suit(i)} #{j+1}" if s[i][j] != "Exist" } }
[ "assignment.variable.change", "identifier.change", "variable_access.subscript.index.change", "expression.operation.binary.change", "literal.string.change", "assignment.value.change" ]
208,292
208,291
u281257618
ruby
p02408
n = gets.to_i allmk = ["S","H","D","C"] arr = Array.new(52) n.times{ card = STDIN.gets.split(" ") mk = allmk.index(card[0]) ## 入力したカードがどのマークか探し、何番目のマークかを出力 num = card[1].to_i-1 arr[mk*13+num] = 1 ## 52の配列のうち、カードが入力された配列番号に1を入力 } 0.upto(3){|i| 0.upto(12){|j| if arr[i*13+j] != 1 ## 1が配列番号に入力されていない場合 j += 1 print "#{allmk[i]} #{j}" print "\n" end } }
n = gets.to_i allmk = ["S","H","C","D"] arr = Array.new(52) n.times{ card = STDIN.gets.split(" ") mk = allmk.index(card[0]) ## 入力したカードがどのマークか探し、何番目のマークかを出力 num = card[1].to_i-1 arr[mk*13+num] = 1 ## 52の配列のうち、カードが入力された配列番号に1を入力 } 0.upto(3){|i| 0.upto(12){|j| if arr[i*13+j] != 1 ## 1が配列番号に入力されていない場合 j += 1 print "#{allmk[i]} #{j}" print "\n" end } }
[ "literal.string.change", "assignment.value.change" ]
208,295
208,296
u236620240
ruby
p02408
s = [1,2,3,4,5,6,7,8,9,10,11,12,13] h = [1,2,3,4,5,6,7,8,9,10,11,12,13] c = [1,2,3,4,5,6,7,8,9,10,11,12,13] d = [1,2,3,4,5,6,7,8,9,10,11,12,13] n = gets.to_i for i in 1..n mark, num = gets.split mark = mark.to_s num = num.to_i if mark == "S" s.delete(num) elsif mark == "H" h.delete(num) elsif mark == "C" c.delete(num) elsif mark == "D" d.delete(num) end end s.each { |x| puts "S #{x}" } h.each { |x| puts "H #{x}" } c.each { |x| puts "C #{x}" } s.each { |x| puts "D #{x}" }
s = [1,2,3,4,5,6,7,8,9,10,11,12,13] h = [1,2,3,4,5,6,7,8,9,10,11,12,13] c = [1,2,3,4,5,6,7,8,9,10,11,12,13] d = [1,2,3,4,5,6,7,8,9,10,11,12,13] n = gets.to_i for i in 1..n mark, num = gets.split mark = mark.to_s num = num.to_i if mark == "S" s.delete(num) elsif mark == "H" h.delete(num) elsif mark == "C" c.delete(num) elsif mark == "D" d.delete(num) end end s.each { |x| puts "S #{x}" } h.each { |x| puts "H #{x}" } c.each { |x| puts "C #{x}" } d.each { |x| puts "D #{x}" }
[ "identifier.change" ]
208,304
208,305
u216813029
ruby
p02408
arr = Array.new(4){Array.new(13)} for i in 0..3 for j in 0..12 arr[i][j] = true end end n = gets.to_i for i in 0..n suit, r = gets.split rank = r.to_i if suit == "S" arr[0][rank-1] = false elsif suit == "H" arr[1][rank-1] = false elsif suit == "C" arr[2][rank-1] = false else suit == "D" arr[3][rank-1] = false end end su = ["S", "H", "C", "D"] for i in 0..3 for j in 1..13 if arr[i][j-1] puts su[i] + " " + j.to_s end end end
arr = Array.new(4){Array.new(13)} for i in 0..3 for j in 0..12 arr[i][j] = true end end n = gets.to_i for i in 1..n suit, r = gets.split rank = r.to_i if suit == "S" arr[0][rank-1] = false elsif suit == "H" arr[1][rank-1] = false elsif suit == "C" arr[2][rank-1] = false else suit == "D" arr[3][rank-1] = false end end su = ["S", "H", "C", "D"] for i in 0..3 for j in 1..13 if arr[i][j-1] puts su[i] + " " + j.to_s end end end
[ "literal.number.integer.change" ]
208,312
208,313
u087014397
ruby
p02408
arr = Array.new(4){Array.new(13)} for i in 0..3 for j in 0..12 arr[i][j] = 1 end end n = gets.to_i for i in 0..n suit, r = gets.split rank = r.to_i if suit == "S" arr[0][rank-1] = nil elsif suit == "H" arr[1][rank-1] = nil elsif suit == "C" arr[2][rank-1] = nil elsif suit == "D" arr[3][rank-1] = nil end end su = ["S", "H", "C", "D"] for i in 0..3 for j in 1..13 if arr[i][j-1] != nil puts su[i] + " " + j.to_s end end end
arr = Array.new(4){Array.new(13)} for i in 0..3 for j in 0..12 arr[i][j] = 0 end end n = gets.to_i for i in 1..n suit, r = gets.split rank = r.to_i if suit == "S" arr[0][rank-1] = nil elsif suit == "H" arr[1][rank-1] = nil elsif suit == "C" arr[2][rank-1] = nil else suit == "D" arr[3][rank-1] = nil end end su = ["S", "H", "C", "D"] for i in 0..3 for j in 1..13 if arr[i][j-1] == 0 puts su[i] + " " + j.to_s end end end
[ "literal.number.integer.change", "assignment.value.change" ]
208,314
208,315
u087014397
ruby
p02408
n = gets.to_i cards = [] %W(S H C D).each do |suit| 1.upto(13) {|i| cards << "#{suit} #{i}"} end n.times {cards -= [gets]} puts cards
n = gets.to_i cards = [] %W(S H C D).each do |suit| 1.upto(13) {|i| cards << "#{suit} #{i}"} end n.times {cards -= [gets.chomp]} puts cards
[ "call.add" ]
208,320
208,319
u864617427
ruby
p02408
readlines.map(&:split) cards.shift picture = ["S","H","C","D"] number = [*1..13] 4.times do |timesloop| newarray = [] temparray = cards.select{|sel| sel[0] == picture[(timesloop)]} temparray = temparray.map{|a,b| b.to_i} newarray = number - temparray if newarray.count > 0 for put in newarray puts("#{picture[(timesloop)]} #{put}") end end end
cards = readlines.map(&:split) cards.shift picture = ["S","H","C","D"] number = [*1..13] 4.times do |timesloop| newarray = [] temparray = cards.select{|sel| sel[0] == picture[(timesloop)]} temparray = temparray.map{|a,b| b.to_i} newarray = number - temparray if newarray.count > 0 for put in newarray puts("#{picture[(timesloop)]} #{put}") end end end
[ "assignment.add" ]
208,321
208,322
u958508535
ruby
p02408
n = gets.to_i obj = {} obj['S'] = [false]*13 obj['H'] = [false]*13 obj['C'] = [false]*13 obj['D'] = [false]*13 n.times do |i| k, v = gets.split obj[k][v.to_i - 1] = true end obj.each do |key, val| (val.length - 1).times do |i| puts "#{key} #{i + 1}" unless val[i] end end
n = gets.to_i obj = {} obj['S'] = [false]*13 obj['H'] = [false]*13 obj['C'] = [false]*13 obj['D'] = [false]*13 n.times do |i| k, v = gets.split obj[k][v.to_i - 1] = true end obj.each do |key, val| val.length.times do |i| puts "#{key} #{i + 1}" unless val[i] end end
[]
208,325
208,326
u252204578
ruby
p02406
n = gets.to_i 1.upto(n) do |i| x = i if (x % 3 == 0) print " #{i}" next end while x <= 0 if x % 10 == 3 print " #{i}" break end x /= 10 end end puts
n = gets.to_i 1.upto(n) do |i| x = i if (x % 3 == 0) print " #{i}" next end while x > 0 if x % 10 == 3 print " #{i}" break end x /= 10 end end puts
[ "expression.operator.compare.change", "expression.operation.binary.change" ]
208,450
208,451
u750346935
ruby
p02406
n = gets.to_i for i in 1..n do x = i if x % 3 == 0 print(" ",i) else while x>0 do if x % 10 == 3 print(" ",i) end x /= 10 end end end puts
n = gets.to_i for i in 1..n do x = i if x % 3 == 0 print(" ",i) else while x>0 do if x % 10 == 3 print(" ",i) break end x /= 10 end end end puts
[ "control_flow.break.add" ]
208,468
208,469
u914140574
ruby
p02406
def call(n) for i in 1..n do if i%3==0 print " ",i else x = i while x > 0 do if x%10==3 break end x /= 10 end end end puts end n = gets.to_i call(n)
def call(n) for i in 1..n do if i%3==0 print " ",i else x = i while x > 0 do if x%10==3 print " ",i break end x /= 10 end end end puts end n = gets.to_i call(n)
[ "call.add" ]
208,483
208,484
u508732591
ruby
p02406
a = gets.chomp.to_i ans = "" for i in 1..a do if i %3 == 0 or i.to_s =~ /3/ then ans <<"#{i}" end end puts ans
a = gets.chomp.to_i ans = "" for i in 1..a do if i % 3 == 0 or i.to_s =~ /3/ then ans << " #{i}" end end puts ans
[ "call.arguments.change" ]
208,487
208,488
u407138207
ruby
p02406
a = gets.chomp.to_i ans = "" for i in 1..a do if i % 3 == 0 or i.to_s =~ /3/ then ans <<"#{i}" end end puts ans
a = gets.chomp.to_i ans = "" for i in 1..a do if i % 3 == 0 or i.to_s =~ /3/ then ans << " #{i}" end end puts ans
[ "call.arguments.change" ]
208,490
208,488
u407138207
ruby
p02406
n = gets.to_i for i in 3.n do print i % 3 ==0 ||i.to_s =~ /3/ ? "#{i}" : "" end
n = gets.to_i for i in 3..n do print i % 3 ==0 || i.to_s =~ /3/ ? " #{i}" : "" end puts
[ "literal.string.change", "call.arguments.change", "io.output.change", "call.add" ]
208,491
208,492
u407138207
ruby
p02406
n = gets.to_i for i in 3.n do print i % 3 ==0 || i.to_s =~ /3/ ? " #{i}" : "" end
n = gets.to_i for i in 3..n do print i % 3 ==0 || i.to_s =~ /3/ ? " #{i}" : "" end puts
[ "io.output.change", "call.add" ]
208,493
208,492
u407138207
ruby
p02406
n=gets.to_i for i in 1..n if i%3==0 printf(" %d",i) end if i.to_s.split("").include?("3") then printf(" %d",i) end end puts ""
n=gets.to_i for i in 1..n if i%3==0 printf(" %d",i) next end if i.to_s.split("").include?("3") then printf(" %d",i) end end puts ""
[]
208,507
208,508
u067629267
ruby
p02406
n = gets.chomp.to_i 3.upto(n) do |i| if i % 3 == 0 print " ", i else x = i loop do if x == 0; break; end if x % 10 == 3 print " ", i end x /= 10 end end if i == n; break; end end puts
n = gets.chomp.to_i 3.upto(n) do |i| if i % 3 == 0 print " ", i else x = i loop do if x == 0; break; end if x % 10 == 3 print " ", i break end x /= 10 end end if i == n; break; end end puts
[ "control_flow.break.add" ]
208,509
208,510
u219639974
ruby
p02409
d=Array.new(4*3*10,0) gets while gets b,f,r,v=$_.split.map &:to_i d[(b-1)*30+(f-1)*10+r-1]+=v end 4.times{|b| 3.times{|f|puts " "+d[b*30+f*10,10]*" "} puts ?#*20 }
d=Array.new(4*3*10,0) gets while gets b,f,r,v=$_.split.map &:to_i d[(b-1)*30+(f-1)*10+r-1]+=v end 4.times{|b| 3.times{|f|puts " "+d[b*30+f*10,10]*" "} puts ?#*20 if b<3 }
[]
209,740
209,741
u550290469
ruby
p02409
house = Array.new(4, 0) house.each_index do |i| house[i] = Array.new(3, 0) end house.each_index do |i| house[i].each_index do |j| house[i][j] = Array.new(10,0) end end gets.chomp.to_i.times do |i| a,b,c,d = gets.chomp.split.map(&:to_i) house[a-1][b-1][c-1] = d end house.each_index do |i| house[i].each do |j| puts " "+j*" " end puts "####################" if i < house.size - 1 end
house = Array.new(4, 0) house.each_index do |i| house[i] = Array.new(3, 0) end house.each_index do |i| house[i].each_index do |j| house[i][j] = Array.new(10,0) end end gets.chomp.to_i.times do |i| a,b,c,d = gets.chomp.split.map(&:to_i) house[a-1][b-1][c-1] += d end house.each_index do |i| house[i].each do |j| puts " "+j*" " end puts "####################" if i < house.size - 1 end
[ "assignment.value.change" ]
209,744
209,745
u742797815
ruby
p02409
BLDG = 4 FLOOR = 3 ROOM = 10 cnt = Array.new(BLDG) do Array.new(FLOOR) do Array.new(ROOM, 0) end end data = gets.chomp.to_i data.times do bldg, floor, room, people = gets.chomp.split.map(&:to_i) cnt[bldg - 1][floor - 1][room - 1] += people end BLDG.times do |i| puts "####################" if i != 0 FLOOR.times do |j| ROOM.times do |k| print " " + cnt[i][j][k] end puts "" end end
BLDG = 4 FLOOR = 3 ROOM = 10 cnt = Array.new(BLDG) do Array.new(FLOOR) do Array.new(ROOM, 0) end end data = gets.chomp.to_i data.times do bldg, floor, room, people = gets.chomp.split.map(&:to_i) cnt[bldg - 1][floor - 1][room - 1] += people end BLDG.times do |i| puts "####################" if i != 0 FLOOR.times do |j| ROOM.times do |k| print " " + cnt[i][j][k].to_s end puts "" end end
[ "call.add" ]
209,751
209,752
u641568203
ruby
p02409
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_6_C n = gets.to_i hash = {} for b in 1..4 for f in 1..3 for r in 1..10 key = b.to_s + "," + f.to_s + "," + r.to_s hash[key]=0 end end end n.times do b,f,r,v = gets.split.map(&:to_i) key = b.to_s + "," + f.to_s + "," + r.to_s hash[key]+=v end for b in 1..4 for f in 1..3 for r in 1..10 key = b.to_s + "," + f.to_s + "," + r.to_s v = hash[key] print " " + v.to_s end puts end puts "#"*20 end
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_6_C n = gets.to_i hash = {} for b in 1..4 for f in 1..3 for r in 1..10 key = b.to_s + "," + f.to_s + "," + r.to_s hash[key]=0 end end end n.times do b,f,r,v = gets.split.map(&:to_i) key = b.to_s + "," + f.to_s + "," + r.to_s hash[key]+=v end for b in 1..4 for f in 1..3 for r in 1..10 key = b.to_s + "," + f.to_s + "," + r.to_s v = hash[key] print " " + v.to_s end puts end puts "#"*20 if b < 4 end
[]
209,764
209,765
u307525591
ruby
p02409
hash = {} sep = "#"*20 (1..4).each do |b| (1..3).each do |f| (1..10).each do |r| hash["#{b}#{f}#{r}"]=0 end end end gets.chomp.to_i.times do b,f,r,v = gets.chomp.split.map(&:to_i) hash["#{b}#{f}#{r}"] += v end (1..4).each do |b| (1..3).each do |f| (1..10).each do |r| print " " + hash["#{b}#{f}#{r}"].to_s end puts end puts sep unless b.zero? end
hash = {} sep = "#"*20 (1..4).each do |b| (1..3).each do |f| (1..10).each do |r| hash["#{b}#{f}#{r}"]=0 end end end gets.chomp.to_i.times do b,f,r,v = gets.chomp.split.map(&:to_i) hash["#{b}#{f}#{r}"] += v end (1..4).each do |b| (1..3).each do |f| (1..10).each do |r| print " " + hash["#{b}#{f}#{r}"].to_s end puts end puts sep unless b > 3 end
[]
209,768
209,769
u458804662
ruby
p02409
num=STDIN.gets.to_i bld=Array.new(4){Array.new(3){Array.new(10)}} for ii in 0..3 for jj in 0..2 for kk in 0..9 bld[ii][jj][kk]=0 end end end for k in 0..num-1 b,f,r,v=STDIN.gets.chomp.split.map{|v|v.to_i} bld[b-1][f-1][r-1]=v end f=1 bld.each do |flr| flr.each do |room| room.each do |man| print " ",man end print "\n" end if f<4 then print "####################\n" end f=f+1 end
num=STDIN.gets.to_i bld=Array.new(4){Array.new(3){Array.new(10)}} for ii in 0..3 for jj in 0..2 for kk in 0..9 bld[ii][jj][kk]=0 end end end for k in 0..num-1 b,f,r,v=STDIN.gets.chomp.split.map{|v|v.to_i} bld[b-1][f-1][r-1]+=v end f=1 bld.each do |flr| flr.each do |room| room.each do |man| print " ",man end print "\n" end if f<4 then print "####################\n" end f=f+1 end
[ "assignment.value.change" ]
209,777
209,778
u665389142
ruby
p02409
f = gets.to_i k = Array.new(4){ Array.new(3){ Array.new(10, 0) } } for i in 0..f-1 do l, m, n, o = gets.split.map(&:to_i) k[l-1][m-1][n-1] = o end for i in 0..3 do for j in 0..2 do puts " #{k[i][j].join(" ")}" end puts "####################" unless i == 3 end
f = gets.to_i k = Array.new(4){ Array.new(3){ Array.new(10, 0) } } for i in 0..f-1 do l, m, n, o = gets.split.map(&:to_i) k[l-1][m-1][n-1] += o end for i in 0..3 do for j in 0..2 do puts " #{k[i][j].join(" ")}" end puts "####################" unless i == 3 end
[ "assignment.value.change" ]
209,782
209,783
u600321313
ruby
p02409
n = gets.to_i total = 0 x = Array.new(4) { Array.new(3) { Array.new(10) {0} } } n.times do b, f, r, v = gets.split.map(&:to_i) x[b-1][f-1][r-1] += v end 4.times do |i| 3.times do |j| puts x[i][j].join(" ") end puts "#"*20 if i < 4 end
n = gets.to_i total = 0 x = Array.new(4) { Array.new(3) { Array.new(10) {0} } } n.times do b, f, r, v = gets.split.map(&:to_i) x[b-1][f-1][r-1] += v end 4.times do |i| 3.times do |j| puts " " + x[i][j].join(" ") end puts "#"*20 if i < 3 end
[ "literal.number.integer.change", "control_flow.branch.if.condition.change" ]
209,807
209,808
u567512460
ruby
p02409
n = gets.to_i building = {} building["1"] = {"1" => [0,0,0,0,0,0,0,0,0,0], "2" => [0,0,0,0,0,0,0,0,0,0], "3" => [0,0,0,0,0,0,0,0,0,0]} building["2"] = {"1" => [0,0,0,0,0,0,0,0,0,0], "2" => [0,0,0,0,0,0,0,0,0,0], "3" => [0,0,0,0,0,0,0,0,0,0]} building["3"] = {"1" => [0,0,0,0,0,0,0,0,0,0], "2" => [0,0,0,0,0,0,0,0,0,0], "3" => [0,0,0,0,0,0,0,0,0,0]} building["4"] = {"1" => [0,0,0,0,0,0,0,0,0,0], "2" => [0,0,0,0,0,0,0,0,0,0], "3" => [0,0,0,0,0,0,0,0,0,0]} i = 0 while true do if i == n break end b, f, r, v = gets.split.map(&:to_i) building["#{b}"]["#{f}"][r - 1] = v i += 1 end building["1"].each do |key, val| val.each do |nop| print " #{nop}" end puts end puts "####################" building["2"].each do |key, val| val.each do |nop| print " #{nop}" end puts end puts "####################" building["3"].each do |key, val| val.each do |nop| print " #{nop}" end puts end puts "####################" building["4"].each do |key, val| val.each do |nop| print " #{nop}" end puts end
n = gets.to_i building = {} building["1"] = {"1" => [0,0,0,0,0,0,0,0,0,0], "2" => [0,0,0,0,0,0,0,0,0,0], "3" => [0,0,0,0,0,0,0,0,0,0]} building["2"] = {"1" => [0,0,0,0,0,0,0,0,0,0], "2" => [0,0,0,0,0,0,0,0,0,0], "3" => [0,0,0,0,0,0,0,0,0,0]} building["3"] = {"1" => [0,0,0,0,0,0,0,0,0,0], "2" => [0,0,0,0,0,0,0,0,0,0], "3" => [0,0,0,0,0,0,0,0,0,0]} building["4"] = {"1" => [0,0,0,0,0,0,0,0,0,0], "2" => [0,0,0,0,0,0,0,0,0,0], "3" => [0,0,0,0,0,0,0,0,0,0]} i = 0 while true do if i == n break end b, f, r, v = gets.split.map(&:to_i) building["#{b}"]["#{f}"][r - 1] += v i += 1 end building["1"].each do |key, val| val.each do |nop| print " #{nop}" end puts end puts "####################" building["2"].each do |key, val| val.each do |nop| print " #{nop}" end puts end puts "####################" building["3"].each do |key, val| val.each do |nop| print " #{nop}" end puts end puts "####################" building["4"].each do |key, val| val.each do |nop| print " #{nop}" end puts end
[ "assignment.value.change" ]
209,817
209,818
u854258289
ruby
p02409
house = Array.new(4){Array.new(3){Array.new(10,0)}} count = gets.to_i for i in 1..count do info = gets b,f,r,v = info.split(" ").map(&:to_i) house[b-1][f-1][r-1] = v end for i in 0..3 do for j in 0..2 do for k in 0..9 do print " " , house[i][j][k] end print "\n" end if i < 3 then puts "####################" end end
house = Array.new(4){Array.new(3){Array.new(10,0)}} count = gets.to_i for i in 1..count do info = gets b,f,r,v = info.split(" ").map(&:to_i) house[b-1][f-1][r-1] += v end for i in 0..3 do for j in 0..2 do for k in 0..9 do print " " , house[i][j][k] end print "\n" end if i < 3 then puts "####################" end end
[ "assignment.value.change" ]
209,822
209,823
u702839660
ruby
p02409
list = Array.new(4).map{Array.new(3).map{Array.new(10,0)}} n = gets.chomp.to_i n.times do b,f,r,v = gets.chomp.split(" ").map(&:to_i) list[b-1][f-1][r-1] = v end list.each_with_index do |b,i| b.each do |f| puts " " + f.join(" ") end puts "#"*20 if i != b.size end
list = Array.new(4).map{Array.new(3).map{Array.new(10,0)}} n = gets.chomp.to_i n.times do b,f,r,v = gets.chomp.split(" ").map(&:to_i) list[b-1][f-1][r-1] += v end list.each_with_index do |b,i| b.each do |f| puts " " + f.join(" ") end puts "#"*20 if i != b.size end
[ "assignment.value.change" ]
209,824
209,825
u759791460
ruby