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 |
|---|---|---|---|---|---|---|---|
p02659 | require 'bigdecimal'
puts gets.chomp.split.map{|e|BigDecimal(e)}.inject(&:*).ceil | require 'bigdecimal'
puts gets.chomp.split.map{|e|BigDecimal(e)}.inject(&:*).floor | [
"misc.opposites",
"identifier.change",
"call.arguments.change",
"io.output.change"
] | 378,676 | 378,677 | u926099741 | ruby |
p02659 | require 'bigdecimal'
require 'bigdecimal/util'
a,b = gets.split
x = a.to_d
y = b.to_d
puts (a * b).to_i | require 'bigdecimal'
require 'bigdecimal/util'
a,b = gets.split
x = a.to_d
y = b.to_d
puts (y * x).to_i | [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 378,775 | 378,776 | u962609087 | ruby |
p02659 | a,b=gets
puts (a.to_r*b.to_r).to_i | a,b=gets.split
puts (a.to_r*b.to_r).to_i | [
"call.add"
] | 378,860 | 378,861 | u756898888 | ruby |
p02659 | a,b=gets
(a.to_r*b.to_r).to_i | a,b=gets.split
puts (a.to_r*b.to_r).to_i | [
"call.add",
"io.output.change"
] | 378,862 | 378,861 | u756898888 | ruby |
p02659 | #!/usr/bin/env ruby
a, b = gets.chomp.split(' ')
a = a.to_i
b = (b.to_f * 100 + 0.1).to_i
puts ((a * b)/100.0).floor
| #!/usr/bin/env ruby
a, b = gets.chomp.split(' ')
a = a.to_i
b = (b.to_f * 100 + 0.1).to_i
puts ((a * b)/100).floor
| [
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 378,863 | 378,864 | u113481706 | ruby |
p02659 | #!/usr/bin/env ruby
a, b = gets.chomp.split(' ')
a = a.to_i
b = (b.to_f * 100).to_i
puts ((a * b)/100.0).floor
| #!/usr/bin/env ruby
a, b = gets.chomp.split(' ')
a = a.to_i
b = (b.to_f * 100 + 0.1).to_i
puts ((a * b)/100).floor
| [
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 378,865 | 378,864 | u113481706 | ruby |
p02659 | a, b = gets.to_s.split.map{|t| t.to_f }
puts((a.to_i * (b*1000) / 1000).floor) | a, b = gets.to_s.split.map{|t| t.to_f }
puts((a.to_i * (b*1000).round / 1000).floor) | [
"call.add"
] | 379,009 | 379,010 | u693378622 | ruby |
p02659 | a, b = gets.to_s.split.map{|t| t.to_f }
puts (a * (b*100).round / 100).floor | a, b = gets.to_s.split.map{|t| t.to_f }
puts (a.to_i * (b*100).round / 100) | [
"call.add",
"call.remove"
] | 379,011 | 379,012 | u693378622 | ruby |
p02659 | A, B = gets.split(" ").map(&:to_f)
puts (A * B).floor | A, B = gets.split(" ").map(&:to_r)
puts (A * B).floor | [
"assignment.value.change",
"call.arguments.change"
] | 379,054 | 379,055 | u729911058 | ruby |
p02659 | A, B = gets.split(" ").map(&:to_i)
puts (A * B).floor | A, B = gets.split(" ").map(&:to_r)
puts (A * B).floor | [
"assignment.value.change",
"call.arguments.change"
] | 379,056 | 379,055 | u729911058 | ruby |
p02659 | require 'bigdecimal'
i = gets.chomp.split(" ")
puts (i[0].to_d * i[1].to_d).floor | require 'bigdecimal'
require 'bigdecimal/util'
i = gets.chomp.split(" ")
puts (i[0].to_d * i[1].to_d).floor | [
"call.add"
] | 379,682 | 379,683 | u312004378 | ruby |
p02659 | require 'bigdecimal'
a,b = gets.split
p (BigDecimal(a)*BigDecimal(b)).ceil
| require 'bigdecimal'
a,b = gets.split
p (BigDecimal(a)*BigDecimal(b)).floor
| [
"misc.opposites",
"identifier.change",
"call.arguments.change"
] | 379,967 | 379,968 | u712322283 | ruby |
p02659 | arr = gets.chomp.split(" ")
print (arr[0].to_i * arr[1].to_f).to_i
| arr = gets.chomp.split(" ")
print (arr[0].to_i * arr[1].to_r).to_i | [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 381,390 | 381,389 | u059126963 | ruby |
p02659 | arr = gets.chomp.split(" ")
print (arr[0].to_i * arr[1].to_f.round(2)).to_i | arr = gets.chomp.split(" ")
print (arr[0].to_i * arr[1].to_r).to_i | [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"call.remove"
] | 381,391 | 381,389 | u059126963 | ruby |
p02659 | arr = gets.chomp.split(" ")
print (arr[0].to_i * arr[1].to_f).to_i | arr = gets.chomp.split(" ")
print (arr[0].to_i * arr[1].to_r).to_i | [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 381,392 | 381,389 | u059126963 | ruby |
p02659 | arr = gets.chomp.split(" ")
print (arr[0].to_f * arr[1].to_f).to_i | arr = gets.chomp.split(" ")
print (arr[0].to_i * arr[1].to_r).to_i | [
"call.function.change",
"type_conversion.to_integer.change",
"type_conversion.to_number.change",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 381,393 | 381,389 | u059126963 | ruby |
p02659 | require 'bigdecimal'
a1,b1 = gets.strip.split(" ")
a = a1.to_i
b = b1.to_d
c = a*b
if a == 0
puts 0
elsif b ==0
puts 0
else
puts (c.to_i)
end
| require 'bigdecimal'
require 'bigdecimal/util'
a1,b1 = gets.strip.split(" ")
a = a1.to_i
b = b1.to_d
c = a*b
if a == 0
puts 0
elsif b ==0
puts 0
else
puts (c.to_i)
end
| [
"call.add"
] | 381,591 | 381,592 | u262392777 | ruby |
p02659 | x, y = gets.chomp.split
puts (x.to_i * y.to_f).to_i | x, y = gets.chomp.split
puts (x.to_i * Rational(y)).to_i | [
"call.add",
"call.arguments.change",
"expression.operation.binary.change"
] | 381,724 | 381,725 | u605918955 | ruby |
p02659 | a,b=gets.split(" ")
a=a.to_f
b=b.to_s.delete(".").to_i
puts (a * b /100).floor
#puts a * b
| a,b=gets.split(" ")
a=a.to_i
b=b.to_s.delete(".").to_i
puts (a * b /100) | [
"call.function.change",
"type_conversion.to_integer.change",
"type_conversion.to_number.change",
"call.remove"
] | 382,033 | 382,034 | u387173453 | ruby |
p02659 | n = gets.split
a = n.first.to_i
b = n.last.to_s.delete(".").to_i
puts (a*b).floor/10 | n = gets.split
a = n.first.to_i
b = n.last.to_s.delete(".").to_i
puts (a*b).floor/100 | [
"literal.number.integer.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 382,262 | 382,263 | u138597672 | ruby |
p02659 | ### SNIPPET
# n = gets.split.map(&:to_i)
# array = n.times.map { gets.split.map(&:to_i) }
# [].all?(&:even?)
# a = [*1..m].repeated_combination(n).to_a
# [1,2,3,4,5].select { |num| num.even? } # => [2, 4]
# ["a","a","b"].group_by(&:itself).map{|k,v| [k, v.count]}.to_h #=> {"a"=>2, "b"=>1}
# 切り捨て: .floor(2).to_f ,切り上げ: .ceil(2).to_f,四捨五入: round(2)
# 3.upto(6) do |i|, 6.downto(3) do |i|
# 公約数125.gcd(100)、公倍数125.lcm(100)
# PI = Math::PI
# 高さ = a * Math.sin(w / 180.0 * Math::PI), 底辺 = a * Math.cos(w / 180.0 * Math::PI)
# def chmax(a, b) a > b ? a : b end
# INF = Float::INFINITY
# def chmin(a, b) a < b ? a : b end
t = gets.split
a = t[0].to_i
b = t[1].to_f
puts (a.rationalize*b.rationalize).to_f.floor | ### SNIPPET
# n = gets.split.map(&:to_i)
# array = n.times.map { gets.split.map(&:to_i) }
# [].all?(&:even?)
# a = [*1..m].repeated_combination(n).to_a
# [1,2,3,4,5].select { |num| num.even? } # => [2, 4]
# ["a","a","b"].group_by(&:itself).map{|k,v| [k, v.count]}.to_h #=> {"a"=>2, "b"=>1}
# 切り捨て: .floor(2).to_f ,切り上げ: .ceil(2).to_f,四捨五入: round(2)
# 3.upto(6) do |i|, 6.downto(3) do |i|
# 公約数125.gcd(100)、公倍数125.lcm(100)
# PI = Math::PI
# 高さ = a * Math.sin(w / 180.0 * Math::PI), 底辺 = a * Math.cos(w / 180.0 * Math::PI)
# def chmax(a, b) a > b ? a : b end
# INF = Float::INFINITY
# def chmin(a, b) a < b ? a : b end
t = gets.split
a = t[0].to_i
b = t[1].to_f
puts (a.rationalize*b.rationalize).floor | [
"call.remove"
] | 382,365 | 382,366 | u219902564 | ruby |
p02659 | array = gets.split(' ')
a = array[0].to_i
b = array[1].to_f
sum = a * b
sum = sum.to_i
puts sum | array = gets.split(' ')
a = array[0].to_i
b = array[1].to_r
sum = a * b
sum = sum.to_i
puts sum | [
"assignment.value.change",
"identifier.change"
] | 382,367 | 382,368 | u811178439 | ruby |
p02659 | a,b = gets.chomp.split
puts (a.to_i * b.to_f).floor | a,b = gets.chomp.split
puts (a.to_i * b.to_r).floor | [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 382,667 | 382,668 | u525844030 | ruby |
p02659 | a, b = gets.chomp.split(" ")
a = a.to_i
b = b.to_f
puts (a * b).to_i | a, b = gets.chomp.split(" ")
a = a.to_r
b = b.to_r
puts (a * b).to_i | [
"assignment.value.change",
"identifier.change"
] | 383,083 | 383,084 | u016444909 | ruby |
p02659 | a, b = gets.split
a = a.to_i
b = b.to_f
puts (a * b).to_i | a, b = gets.split
a = a.to_i
b = b.to_r
puts (a * b).to_i | [
"assignment.value.change",
"identifier.change"
] | 383,406 | 383,407 | u420073655 | ruby |
p02660 | require 'prime'
n = gets.chomp.to_i
arr = n.prime_division #24 => [[2,3],[3,1]]
ans = 0
arr.each do |div, index|
cnt = 1
while index >= cnt
ans += 1
index -= 1
cnt += 1
end
end
print ans
| require 'prime'
n = gets.chomp.to_i
arr = n.prime_division #24 => [[2,3],[3,1]]
ans = 0
arr.each do |div, index|
cnt = 1
while index >= cnt
ans += 1
index -= cnt
cnt += 1
end
end
print ans
| [
"identifier.replace.add",
"literal.replace.remove"
] | 383,880 | 383,881 | u896269838 | ruby |
p02660 | require 'prime'
n=gets.to_i
ans=0
n.prime_division.each do |k,v|
p k
p v
i=1
while v>=i
v-=i
i+=1
end
ans+=i-1
end
p ans
| require 'prime'
n=gets.to_i
ans=0
n.prime_division.each do |k,v|
#p k
# p v
i=1
while v>=i
v-=i
i+=1
end
ans+=i-1
end
p ans
| [
"call.remove"
] | 383,999 | 384,000 | u590472228 | ruby |
p02660 | require 'prime'
N = gets.to_i
factors = N.prime_division
S = {}
S[0] = 0
1.upto(N) do |i|
s = S[i] = S[i-1] + i
break if s > N
end
T = S.invert
c = 0
factors.each do |(_, n)|
j = n
while T[j].nil?
j += 1
end
c += T[j]
end
p c
| require 'prime'
N = gets.to_i
factors = N.prime_division
S = {}
S[0] = 0
1.upto(N) do |i|
s = S[i] = S[i-1] + i
break if s > N
end
T = S.invert
c = 0
factors.each do |(_, n)|
j = n
while T[j].nil?
j -= 1
end
c += T[j]
end
p c
| [
"expression.operator.change"
] | 385,005 | 385,006 | u110341137 | ruby |
p02660 | #exec({'RUBY_THREAD_VM_STACK_SIZE'=>'100000000'},'/usr/bin/ruby', $0) if !ENV['RUBY_THREAD_VM_STACK_SIZE']
require 'prime'
def inpf() a=gets.chomp.split(" ").map(&:to_f)end
def inps() a=gets.chomp.split(" ")end
def copy(a) Marshal.load(Marshal.dump(a)) end
def kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end
def na(n,d=0) Array.new(n,d)end
def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end
def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end
def inp() a=gets.chomp.split(" ").map(&:to_i)end
def r_up(a, b) (a+b-1)/b end
def sum(a) a.inject(:+) end
def big(a,b) return (a>b)? a:b end
def small(a,b) return (a<b)? a:b end
t = inp[0].prime_division
ans = 0
t.each do |a|
n = 1
while n <= a[1]
ans += 1
a[1] -= 1
n += 1
end
end
p ans
| #exec({'RUBY_THREAD_VM_STACK_SIZE'=>'100000000'},'/usr/bin/ruby', $0) if !ENV['RUBY_THREAD_VM_STACK_SIZE']
require 'prime'
def inpf() a=gets.chomp.split(" ").map(&:to_f)end
def inps() a=gets.chomp.split(" ")end
def copy(a) Marshal.load(Marshal.dump(a)) end
def kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end
def na(n,d=0) Array.new(n,d)end
def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end
def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end
def inp() a=gets.chomp.split(" ").map(&:to_i)end
def r_up(a, b) (a+b-1)/b end
def sum(a) a.inject(:+) end
def big(a,b) return (a>b)? a:b end
def small(a,b) return (a<b)? a:b end
t = inp[0].prime_division
ans = 0
t.each do |a|
n = 1
while n <= a[1]
ans += 1
a[1] -= n
n += 1
end
end
p ans
| [
"identifier.replace.add",
"literal.replace.remove"
] | 385,573 | 385,574 | u145123922 | ruby |
p02661 | n = gets.to_i
a, b = Array.new(n) { gets.split.map(&:to_i) }.transpose
a.sort!
b.sort!
med_a = n.even? ? (a[n / 2] + a[n / 2 - 1]) / 2.0 : a[n / 2]
med_b = n.even? ? (b[n / 2] + b[n / 2 - 1]) / 2.0 : b[n / 2]
puts n.even? ? (med_b - med_a * 2 + 1).to_i : med_b - med_a + 1 | n = gets.to_i
a, b = Array.new(n) { gets.split.map(&:to_i) }.transpose
a.sort!
b.sort!
med_a = n.even? ? (a[n / 2] + a[n / 2 - 1]) / 2.0 : a[n / 2]
med_b = n.even? ? (b[n / 2] + b[n / 2 - 1]) / 2.0 : b[n / 2]
puts n.even? ? ((med_b - med_a) * 2 + 1).to_i : med_b - med_a + 1 | [
"call.arguments.change"
] | 385,865 | 385,866 | u104886851 | ruby |
p02661 | N=gets.to_i
A,B=$<.map{|e|e.split.map &:to_i}.transpose.map &:sort
h=N/2
p 1+(N.odd?? B[h]-A[h]:B[h]+A[h]-B[h-=1]-A[h]) | N=gets.to_i
A,B=$<.map{|e|e.split.map &:to_i}.transpose.map &:sort
h=N/2
p 1+(N.odd?? B[h]-A[h]:B[h]-A[h]+B[h-=1]-A[h]) | [
"misc.opposites",
"expression.operator.arithmetic.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 386,073 | 386,074 | u647875062 | ruby |
p02662 | n, s = gets.split(" ").map(&:to_i)
alist = gets.split(" ").map(&:to_i)
m = 998244353
dp = Array.new(n+1) { Array.new(s+1, 0)}
dp[0][0] = 1
for i in 0..n-1 do
for j in 0..s do
dp[i+1][j] = (dp[i+1][j] + dp[i][j] << 1) % m
if j + alist[i] <= s then
dp[i+1][j + alist[i]] = (dp[i+1][j + alist[i]] + dp[i][j]) % m
end
end
end
print dp[n][s] | n, s = gets.split(" ").map(&:to_i)
alist = gets.split(" ").map(&:to_i)
m = 998244353
dp = Array.new(n+1) { Array.new(s+1, 0)}
dp[0][0] = 1
for i in 0..n-1 do
for j in 0..s do
dp[i+1][j] = (dp[i+1][j] + (dp[i][j] << 1)) % m
if j + alist[i] <= s then
dp[i+1][j + alist[i]] = (dp[i+1][j + alist[i]] + dp[i][j]) % m
end
end
end
print dp[n][s] | [] | 386,767 | 386,766 | u014800961 | ruby |
p02662 | n, s = gets.split(" ").map(&:to_i)
alist = gets.split(" ").map(&:to_i)
m = 998244353
dp = Array.new(n+1) { Array.new(s+1, 0)}
dp[0][0] = 1
for i in 0..n-1 do
for j in 0..s do
dp[i+1][j] = (dp[i+1][j]+ dp[i][j] << 1) % m
if j + alist[i] <= s then
dp[i+1][j + alist[i]] = (dp[i+1][j + alist[i]] + dp[i][j]) % m
end
end
end
print dp[n][s] | n, s = gets.split(" ").map(&:to_i)
alist = gets.split(" ").map(&:to_i)
m = 998244353
dp = Array.new(n+1) { Array.new(s+1, 0)}
dp[0][0] = 1
for i in 0..n-1 do
for j in 0..s do
dp[i+1][j] = (dp[i+1][j] + (dp[i][j] << 1)) % m
if j + alist[i] <= s then
dp[i+1][j + alist[i]] = (dp[i+1][j + alist[i]] + dp[i][j]) % m
end
end
end
print dp[n][s] | [] | 386,768 | 386,766 | u014800961 | ruby |
p02662 | n, s = gets.split(" ").map(&:to_i)
alist = gets.split(" ").map(&:to_i)
m = 998244353
dp = Array.new(n+1) { Array.new(s+1, 0)}
dp[0][0] = 1
for i in 0..n-1 do
for j in 0..s do
dp[i+1][j] += (dp[i+1][j]+ dp[i][j] << 1) % m
if j + alist[i] <= s then
dp[i+1][j + alist[i]] += (dp[i+1][j + alist[i]] + dp[i][j]) % m
end
end
end
print dp[n][s] | n, s = gets.split(" ").map(&:to_i)
alist = gets.split(" ").map(&:to_i)
m = 998244353
dp = Array.new(n+1) { Array.new(s+1, 0)}
dp[0][0] = 1
for i in 0..n-1 do
for j in 0..s do
dp[i+1][j] = (dp[i+1][j] + (dp[i][j] << 1)) % m
if j + alist[i] <= s then
dp[i+1][j + alist[i]] = (dp[i+1][j + alist[i]] + dp[i][j]) % m
end
end
end
print dp[n][s] | [
"assignment.value.change"
] | 386,769 | 386,766 | u014800961 | ruby |
p02662 | eval"N,S,*A="+`dd`.split*?,
d=1,*[0]*S*2
A.map{|a|S.downto(0){|i|d[a+i]+=t=d[i]
d[i]=2*t%998244353}}
p d[S] | eval"N,S,*A="+`dd`.split*?,
d=1,*[0]*7e3
A.map{|a|S.downto(0){|i|d[a+i]+=t=d[i]
d[i]=2*t%998244353}}
p d[S]%998244353 | [
"assignment.value.change",
"expression.operation.binary.change",
"expression.operation.binary.remove"
] | 386,811 | 386,810 | u657913472 | ruby |
p02663 | h1, m1, h2, m2, k = gets.split.map(&:to_i)
tatal_min = (h2 - h1) * 60 + (m2 - m1)
ans = total_min - k
puts ans | h1, m1, h2, m2, k = gets.split.map(&:to_i)
total_min = (h2 - h1) * 60 + (m2 - m1)
ans = total_min - k
puts ans
| [
"assignment.variable.change",
"identifier.change"
] | 387,124 | 387,125 | u657749689 | ruby |
p02663 | h1, m1, h2, m2, k = gets.strip.split.map(&:to_i)
p (h2-h1)*60+m2-m2-k | h1, m1, h2, m2, k = gets.strip.split.map(&:to_i)
p (h2-h1)*60+m2-m1-k | [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 387,128 | 387,129 | u188673878 | ruby |
p02663 | lines=gets.split(' ')
line=[]
lines.each do |b|
line <<b.to_i
end
p line
H1=line[0]
M1=line[1]
H2=line[2]
M2=line[3]
K=line[4]
sleep=60*H2+M2
wake=60*H1+M1
p sleep-wake-K
| lines=gets.split(' ')
line=[]
lines.each do |b|
line <<b.to_i
end
H1=line[0]
M1=line[1]
H2=line[2]
M2=line[3]
K=line[4]
sleep=60*H2+M2
wake=60*H1+M1
p sleep-wake-K
| [] | 387,172 | 387,173 | u857765095 | ruby |
p02663 | h1,h2,m1,m2,k = gets.chomp.split.map(&:to_i)
ji = m1 - h1
fun = m2 + h2
puts (ji*60 + fun) - k | h1,h2,m1,m2,k = gets.chomp.split.map(&:to_i)
ji = m1 - h1
fun = m2 - h2
puts (ji*60 + fun) - k | [
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 387,734 | 387,735 | u689027433 | ruby |
p02663 | h_1,m_1,h_2,m_2,k = gets.split.map(&:to_i)
time = h_2*60+m_2 - h_1*60 - m_2
puts time-k | h_1,m_1,h_2,m_2,k = gets.split.map(&:to_i)
time = h_2*60+m_2 - h_1*60 - m_1
puts time-k | [
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 387,746 | 387,747 | u307452818 | ruby |
p02663 | a,b,c,d,e=gets.split.map(&:to_i)
b += a*60
d += c*60
puts [d-b-c, 0].max | a,b,c,d,e=gets.split.map(&:to_i)
b += a*60
d += c*60
puts [d-b-e, 0].max | [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 387,789 | 387,790 | u056944756 | ruby |
p02663 | a,b,c,d,e=gets.split.map(&:to_i)
b += a*60
d += c*60
puts [d-b-c, 0].min | a,b,c,d,e=gets.split.map(&:to_i)
b += a*60
d += c*60
puts [d-b-e, 0].max | [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change",
"misc.opposites"
] | 387,791 | 387,790 | u056944756 | ruby |
p02664 | t = gets.chomp
puts t.gsub!("?","D") | t = gets.chomp
puts t.gsub("?","D") | [
"identifier.change",
"call.arguments.change",
"io.output.change"
] | 387,822 | 387,823 | u032624914 | ruby |
p02664 | s = gets
s.gsub('?','D')
puts s | s = gets
s = s.gsub('?','D')
puts s
| [
"assignment.add"
] | 387,824 | 387,825 | u054798759 | ruby |
p02663 | h1, m1, h2, m2, k = gets.split.map(&:to_i)
time1 = (h2 - h1) * 60 + (m2 - m1)
time2 = m2 - m1
if h1 == h2
if time2 > k
puts time2 - k
elsif time2 < k
puts 0
end
elsif h1 != h2
if time1 > k
puts time1 - k
elsif time1 < k
puts 0
end
end | h1, m1, h2, m2, k = gets.split.map(&:to_i)
time1 = (h2 - h1) * 60 + (m2 - m1)
time2 = m2 - m1
if h1 == h2
if time2 > k
puts time2 - k
elsif time2 <= k
puts 0
end
elsif h1 != h2
if time1 > k
puts time1 - k
elsif time1 <= k
puts 0
end
end | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 388,032 | 388,033 | u684458716 | ruby |
p02663 | h1, m1, h2, m2, k = gets.split.map(&:to_i)
time1 = (h2 - h1) * 60 - (m2 - m1)
time2 = m2 - m1
if h1 == h2
if time2 > k
puts time2 - k
elsif time2 < k
puts 0
end
elsif h1 != h2
if time1 > k
puts time1 - k
elsif time1 < k
puts 0
end
end | h1, m1, h2, m2, k = gets.split.map(&:to_i)
time1 = (h2 - h1) * 60 + (m2 - m1)
time2 = m2 - m1
if h1 == h2
if time2 > k
puts time2 - k
elsif time2 <= k
puts 0
end
elsif h1 != h2
if time1 > k
puts time1 - k
elsif time1 <= k
puts 0
end
end | [
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 388,034 | 388,033 | u684458716 | ruby |
p02664 | t = gets.rstrip
puts t.gsub!("?", "D")
| t = gets.rstrip
puts t.gsub("?", "D")
| [
"identifier.change",
"call.arguments.change",
"io.output.change"
] | 388,099 | 388,100 | u084335038 | ruby |
p02664 | if m.count("?")>0
n=m.count("?")
end
s=[]
count=0
sum=0
v=0
for i in 0..m.length
if m[i]=="?"
m[i]="D"
end
end
puts m |
m=gets.chomp
if m.count("?")>0
n=m.count("?")
end
s=[]
count=0
sum=0
v=0
for i in 0..m.length
if m[i]=="?"
m[i]="D"
end
end
puts m | [
"assignment.add"
] | 388,177 | 388,178 | u590472228 | ruby |
p02664 | s=gets.chomp
put s.tr('?','D') | s=gets.chomp
puts s.tr('?', 'D') | [
"misc.typo",
"identifier.change"
] | 388,499 | 388,500 | u796654386 | ruby |
p02675 | x = gets.to_i
x %= 10
if x > 10
x %= 10
end
case x
when 0,2,4,5,7,9
puts "hon"
when 1,6,8
puts "pon"
when 3
puts "bon"
end
| x = gets.to_i
x %= 10
if x > 10
x %= 10
end
case x
when 2,4,5,7,9
puts "hon"
when 0,1,6,8
puts "pon"
when 3
puts "bon"
end
| [] | 390,587 | 390,588 | u529683866 | ruby |
p02675 | x = gets.to_i
x %= 10
if x > 10
x %= 10
end
case x
when 2,4,5,7,9
puts "hon"
when 0,1,6,8
puts "pon"
when 3
puts "hon"
end
| x = gets.to_i
x %= 10
if x > 10
x %= 10
end
case x
when 2,4,5,7,9
puts "hon"
when 0,1,6,8
puts "pon"
when 3
puts "bon"
end
| [
"literal.string.change",
"call.arguments.change"
] | 390,589 | 390,588 | u529683866 | ruby |
p02675 | x = gets.to_i
x %= 10
if x >= 10
x %= 10
end
case x
when 2,4,5,7,9
puts "hon"
when 0,1,6,8
puts "pon"
when 3
puts "hon"
end
| x = gets.to_i
x %= 10
if x > 10
x %= 10
end
case x
when 2,4,5,7,9
puts "hon"
when 0,1,6,8
puts "pon"
when 3
puts "bon"
end
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"literal.string.change",
"call.arguments.change"
] | 390,590 | 390,588 | u529683866 | ruby |
p02675 | x = gets.to_i
x %= 10
if x >= 10
x %= 10
end
case x
when 2,4,5,7,9
puts "hon"
when 1,6,8
puts "pon"
else
puts "hon"
end | x = gets.to_i
x %= 10
if x > 10
x %= 10
end
case x
when 2,4,5,7,9
puts "hon"
when 0,1,6,8
puts "pon"
when 3
puts "bon"
end
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"literal.string.change",
"call.arguments.change"
] | 390,591 | 390,588 | u529683866 | ruby |
p02675 | n = gets.to_i
s = n % 10
if s == 2 || s == 4 || s == 7 || s == 9
puts "hon"
elsif s == 0 || s == 1 || s == 6 || s == 8
puts "pon"
else
puts "bon"
end | n = gets.to_i
s = n % 10
if s == 2 || s == 4 || s == 5 || s == 7 || s == 9
puts "hon"
elsif s == 0 || s == 1 || s == 6 || s == 8
puts "pon"
else
puts "bon"
end | [
"control_flow.branch.if.condition.change"
] | 390,822 | 390,823 | u931779296 | ruby |
p02675 | val = gets.split.first.to_i
val = val % 10
case val
when 2, 4, 5, 7, 9 then
p 'hon'
when 0, 1, 6, 8 then
p 'pon'
else
p 'bon'
end | val = gets.split.first.to_i
val = val % 10
case val
when 2, 4, 5, 7, 9 then
print 'hon'
when 0, 1, 6, 8 then
print 'pon'
else
print 'bon'
end | [
"call.function.change",
"io.output.change"
] | 390,843 | 390,844 | u305883349 | ruby |
p02675 | n = gets[-1]
if [2, 4, 5, 7, 9].include?(n)
puts "hon"
elsif n == 3
puts "bon"
else
puts "pon"
end
| n = gets[-2].to_i
if [2, 4, 5, 7, 9].include?(n)
puts "hon"
elsif n == 3
puts "bon"
else
puts "pon"
end
| [
"literal.number.integer.change",
"assignment.value.change",
"variable_access.subscript.index.change",
"call.add"
] | 391,286 | 391,287 | u122428774 | ruby |
p02675 | num = gets.chomp.to_i % 10
case num
when 2,4,5,7,9
puts 'hon'
when 3 then
puts 'bon'
when 0,1,6,8 then
puts 'pon'
end
| num = gets.chomp.to_i
num2 = num % 10
case num2
when 2,4,5,7,9
puts 'hon'
when 3 then
puts 'bon'
when 0,1,6,8 then
puts 'pon'
end
| [
"identifier.change"
] | 391,343 | 391,344 | u216070723 | ruby |
p02675 | num = gets.chomp.to_i % 10
case num
when 2,4,5,7,9
puts 'hon'
when 3 then
puts 'bon'
when 0,1,6,8 then
puts 'pon'
end
| num = gets.chomp.to_i
num2 = num % 10
case num2
when 2,4,5,7,9
puts 'hon'
when 3 then
puts 'bon'
when 0,1,6,8 then
puts 'pon'
end
| [
"identifier.change"
] | 391,345 | 391,344 | u216070723 | ruby |
p02675 | num = gets.chomp.to_s.last.to_i
if [2,4,5,7,9].include?(num)
puts 'hon'
elsif num == 3
puts 'bon'
else
puts 'pon'
end | num = gets.chomp[-1].to_i
if [2,4,5,7,9].include?(num)
puts 'hon'
elsif num == 3
puts 'bon'
else
puts 'pon'
end | [] | 391,389 | 391,390 | u159942474 | ruby |
p02675 | num = gets.to_i % 10
if num == 3
p 'bon'
elsif [0, 1, 6, 8].include?(num)
p 'pon'
else
p 'hon'
end
| num = gets.to_i % 10
if num == 3
print 'bon'
elsif [0, 1, 6, 8].include?(num)
print 'pon'
else
print 'hon'
end
| [
"call.function.change",
"io.output.change"
] | 391,499 | 391,500 | u438160186 | ruby |
p02675 | num = gets.chomp!.to_i % 10
if num == 3
p 'bon'
elsif [0, 1, 6, 8].include?(num)
p 'pon'
else
p 'hon'
end
| num = gets.to_i % 10
if num == 3
print 'bon'
elsif [0, 1, 6, 8].include?(num)
print 'pon'
else
print 'hon'
end
| [
"call.remove",
"call.function.change",
"io.output.change"
] | 391,501 | 391,500 | u438160186 | ruby |
p02675 | num = gets.to_i % 10
if num == 3
p 'bon'
elsif [0, 1, 6, 8].include?(num)
p 'pon'
else
p 'hon'
end
| num = gets.to_i % 10
if num == 3
puts 'bon'
elsif [0, 1, 6, 8].include?(num)
puts 'pon'
else
puts 'hon'
end
| [
"call.function.change",
"io.output.change"
] | 391,499 | 391,502 | u438160186 | ruby |
p02675 | num = gets.chomp!.to_i % 10
if num == 3
p 'bon'
elsif [0, 1, 6, 8].include?(num)
p 'pon'
else
p 'hon'
end
| num = gets.to_i % 10
if num == 3
puts 'bon'
elsif [0, 1, 6, 8].include?(num)
puts 'pon'
else
puts 'hon'
end
| [
"call.remove",
"call.function.change",
"io.output.change"
] | 391,501 | 391,502 | u438160186 | ruby |
p02675 | n = gets.chomp.chars.map(&:to_i)
if n[-1] == 3
p 'bon'
elsif n[-1] == 0 || n[-1] ==1 || n[-1] ==6 || n[-1] == 8
p 'pon'
else
p 'hon'
end | n = gets.chomp.chars.map(&:to_i)
if n[-1] == 3
puts 'bon'
elsif n[-1] == 0 || n[-1] == 1 || n[-1] == 6 || n[-1] == 8
puts 'pon'
else
puts 'hon'
end
| [
"call.function.change",
"io.output.change"
] | 391,649 | 391,650 | u774573868 | ruby |
p02675 | n = gets.to_i.modulo(10)
case n
when 2,4,5,7,9
p 'hon'
when 0,1,6,8
p 'pon'
else
p 'bon'
end | n = gets.to_i.modulo(10)
case n
when 2,4,5,7,9
print 'hon'
when 0,1,6,8
print 'pon'
else
print 'bon'
end | [
"call.function.change",
"io.output.change"
] | 391,703 | 391,704 | u011809316 | ruby |
p02675 |
n = gets.to_i
n = n % 10
case n
when 2,4,5,6,9
puts "hon"
when 0,1,6,8
puts "pon"
when 3
puts "bon"
end |
n = gets.to_i
n = n % 10
case n
when 2,4,5,7,9
puts "hon"
when 0,1,6,8
puts "pon"
when 3
puts "bon"
end | [
"literal.number.integer.change"
] | 391,834 | 391,835 | u014800961 | ruby |
p02675 | n = gets.split('').map(&:to_i)
if n[-1] == 2 || n[-1] == 4 || n[-1] == 5 || n[-1] == 7 || n[-1] == 9 then
p "hon"
elsif n[-1] == 0 || n[-1] == 1 || n[-1] == 6 || n[-1] == 8 then
p "pon"
else
p "bon"
end | n = gets.chomp.split('').map(&:to_i)
if n[-1] == 2 || n[-1] == 4 || n[-1] == 5 || n[-1] == 7 || n[-1] == 9 then
puts "hon"
elsif n[-1] == 0 || n[-1] == 1 || n[-1] == 6 || n[-1] == 8 then
puts "pon"
#pとputsは違う。pは"出力に""がつく。putsは""がつかない。
else
puts "bon"
end
| [
"call.add",
"call.function.change",
"io.output.change"
] | 391,886 | 391,887 | u684458716 | ruby |
p02675 | n = gets.strip.split('').map(&:to_i)
if n[-1] == 2 || n[-1] == 4 || n[-1] == 5 || n[-1] == 7 || n[-1] == 9 then
p "hon"
elsif n[-1] == 0 || n[-1] == 1 || n[-1] == 6 || n[-1] == 8 then
p "pon"
else
p "bon"
end | n = gets.chomp.split('').map(&:to_i)
if n[-1] == 2 || n[-1] == 4 || n[-1] == 5 || n[-1] == 7 || n[-1] == 9 then
puts "hon"
elsif n[-1] == 0 || n[-1] == 1 || n[-1] == 6 || n[-1] == 8 then
puts "pon"
#pとputsは違う。pは"出力に""がつく。putsは""がつかない。
else
puts "bon"
end
| [
"assignment.value.change",
"identifier.change",
"call.function.change",
"io.output.change"
] | 391,888 | 391,887 | u684458716 | ruby |
p02675 | n = gets.chomp.split('').map(&:to_i)
if n[-1] == 2 || n[-1] == 4 || n[-1] == 5 || n[-1] == 7 || n[-1] == 9 then
p "hon"
elsif n[-1] == 0 || n[-1] == 1 || n[-1] == 6 || n[-1] == 8 then
p "pon"
else
p "bon"
end | n = gets.chomp.split('').map(&:to_i)
if n[-1] == 2 || n[-1] == 4 || n[-1] == 5 || n[-1] == 7 || n[-1] == 9 then
puts "hon"
elsif n[-1] == 0 || n[-1] == 1 || n[-1] == 6 || n[-1] == 8 then
puts "pon"
#pとputsは違う。pは"出力に""がつく。putsは""がつかない。
else
puts "bon"
end
| [
"call.function.change",
"io.output.change"
] | 391,889 | 391,887 | u684458716 | ruby |
p02675 | n = gets.strip.split('').map(&:to_i)
if n[-1] == 2 || n[-1] == 4 || n[-1] == 5 || n[-1] == 7 || n[-1] == 9 then
p "hon"
elsif n[-1] == 0 || n[-1] == 1 || n[-1] == 6 || n[-1] == 8 then
p "pon"
else
p "bon"
end | n = gets.chomp.split('').map(&:to_i)
if n[-1] == 2 || n[-1] == 4 || n[-1] == 5 || n[-1] == 7 || n[-1] == 9 then
puts "hon"
elsif n[-1] == 0 || n[-1] == 1 || n[-1] == 6 || n[-1] == 8 then
puts "pon"
#pとputsは違う。pは"出力に""がつく。putsは""がつかない。
else
puts "bon"
end
| [
"assignment.value.change",
"identifier.change",
"call.function.change",
"io.output.change"
] | 391,890 | 391,887 | u684458716 | ruby |
p02675 | n = gets.split('').map(&:to_i)
if n[-1] == 2 || n[-1] == 4 || n[-1] == 5 || n[-1] == 7 || n[-1] == 9 then
p "hon"
elsif n[-1] == 0 || n[-1] == 1 || n[-1] == 6 || n[-1] == 8 then
p "pon"
else
p "bon"
end | n = gets.chomp.split('').map(&:to_i)
if n[-1] == 2 || n[-1] == 4 || n[-1] == 5 || n[-1] == 7 || n[-1] == 9 then
puts "hon"
elsif n[-1] == 0 || n[-1] == 1 || n[-1] == 6 || n[-1] == 8 then
puts "pon"
#pとputsは違う。pは"出力に""がつく。putsは""がつかない。
else
puts "bon"
end
| [
"call.add",
"call.function.change",
"io.output.change"
] | 391,891 | 391,887 | u684458716 | ruby |
p02675 | n = gets.chomp.split('').map(&:to_i)
if n[-1] == 2 || n[-1] == 4 || n[-1] == 5 || n[-1] == 7 || n[-1] == 9
p "hon"
elsif n[-1] == 0 || n[-1] == 1 || n[-1] == 6 || n[-1] == 8
p "pon"
else
p "bon"
end | n = gets.chomp.split('').map(&:to_i)
if n[-1] == 2 || n[-1] == 4 || n[-1] == 5 || n[-1] == 7 || n[-1] == 9 then
puts "hon"
elsif n[-1] == 0 || n[-1] == 1 || n[-1] == 6 || n[-1] == 8 then
puts "pon"
#pとputsは違う。pは"出力に""がつく。putsは""がつかない。
else
puts "bon"
end
| [
"io.output.change",
"call.add",
"call.function.change"
] | 391,893 | 391,887 | u684458716 | ruby |
p02675 | n=gets.chars[-1].to_i
if n==3
puts "bon"
elsif n==0 || n==1 || n==6 || n==8
puts "pon"
else
puts "hon"
end | n=gets.chomp.chars[-1].to_i
if n==3
puts "bon"
elsif n==0 || n==1 || n==6 || n==8
puts "pon"
else
puts "hon"
end | [
"call.add"
] | 391,969 | 391,970 | u128694188 | ruby |
p02675 | n = gets.chomp.split("").map(&:to_i)
puts n
if n.size == 3
if n[2] == 3 then
puts "bon"
elsif n[2] == 0 || n[2] == 1 || n[2] == 6 || n[2] == 8 then
puts "pon"
else
puts "hon"
end
elsif n.size == 2
if n[1] == 3 then
puts "bon"
elsif n[1] == 0 || n[1] == 1 || n[1] == 6 || n[1] == 8 then
puts "pon"
else
puts "hon"
end
else
if n[0] == 3 then
puts "bon"
elsif n[0] == 0 || n[0] == 1 || n[0] == 6 || n[0] == 8 then
puts "pon"
else
puts "hon"
end
end | n = gets.chomp.split("").map(&:to_i)
# puts n
if n.size == 3
if n[2] == 3 then
puts "bon"
elsif n[2] == 0 || n[2] == 1 || n[2] == 6 || n[2] == 8 then
puts "pon"
else
puts "hon"
end
elsif n.size == 2
if n[1] == 3 then
puts "bon"
elsif n[1] == 0 || n[1] == 1 || n[1] == 6 || n[1] == 8 then
puts "pon"
else
puts "hon"
end
else
if n[0] == 3 then
puts "bon"
elsif n[0] == 0 || n[0] == 1 || n[0] == 6 || n[0] == 8 then
puts "pon"
else
puts "hon"
end
end | [
"call.remove"
] | 391,992 | 391,993 | u713980442 | ruby |
p02675 | n = gets.chomp.split("").reverse
if n[-1] == "2" || n[-1] == "4" || n[-1] == "5" || n[-1] == "7" || n[-1] == "9"
puts "hon"
elsif n[-1] == "0" || n[-1] == "1" || n[-1] == "6" || n[-1] == "8"
puts "pon"
elsif n[-1] == "3"
puts "bon"
end | n = gets.chomp.split("")
if n[-1] == "2" || n[-1] == "4" || n[-1] == "5" || n[-1] == "7" || n[-1] == "9"
puts "hon"
elsif n[-1] == "0" || n[-1] == "1" || n[-1] == "6" || n[-1] == "8"
puts "pon"
elsif n[-1] == "3"
puts "bon"
end
| [
"call.remove"
] | 392,107 | 392,108 | u412789323 | ruby |
p02675 | N = gets.to_i
n=N%10
if n==3
'bon'
elsif n==0||n==1||n==6||n==8
'pon'
else
'hon'
end | N = gets.to_i
n=N%10
if n==3
puts 'bon'
elsif n==0||n==1||n==6||n==8
puts 'pon'
else
puts 'hon'
end | [
"io.output.change",
"call.add"
] | 392,384 | 392,385 | u663404111 | ruby |
p02675 | N=gets.to_i
n=N%10
if n==3
'bon'
elsif n==0||n==1||n==6||n==8
'pon'
else
'hon'
end
| N = gets.to_i
n=N%10
if n==3
puts 'bon'
elsif n==0||n==1||n==6||n==8
puts 'pon'
else
puts 'hon'
end | [
"io.output.change",
"call.add"
] | 392,386 | 392,385 | u663404111 | ruby |
p02675 | n = gets.split('').map(&:to_i)
if n[-1] == 2 || n[-1] == 4 || n[-1] == 5 || n[-1] == 7 || n[-1] == 9
puts 'hon'
elsif n[-1] == 0 || n[-1] == 1 || n[-1] == 6 || n[-1] == 8
puts 'pon'
elsif n[-1] == 3
puts 'bon'
end
| n = gets.chomp.split('').map(&:to_i)
if n[-1] == 2 || n[-1] == 4 || n[-1] == 5 || n[-1] == 7 || n[-1] == 9
puts 'hon'
elsif n[-1] == 0 || n[-1] == 1 || n[-1] == 6 || n[-1] == 8
puts 'pon'
elsif n[-1] == 3
puts 'bon'
end
| [
"call.add"
] | 392,599 | 392,600 | u238956837 | ruby |
p02675 | class InputLine
def self.to_s
gets.chomp
end
def self.to_i
InputLine.to_s.to_i
end
def self.to_f
InputLine.to_s.to_f
end
def self.to_sa
InputLine.to_s.split(' ')
end
def self.to_ia
InputLine.to_sa.map(&:to_i)
end
def self.to_fa
InputLine.to_sa.map(&:to_f)
end
end
def main(argv)
n = InputLine.to_i
case (n % 10)
when 2, 4, 5, 7, 9 then
puts 'bon'
when 0, 1, 6, 8 then
puts 'pon'
when 3 then
puts 'bon'
end
end
if self.to_s == 'main' then
main(ARGV)
end | class InputLine
def self.to_s
gets.chomp
end
def self.to_i
InputLine.to_s.to_i
end
def self.to_f
InputLine.to_s.to_f
end
def self.to_sa
InputLine.to_s.split(' ')
end
def self.to_ia
InputLine.to_sa.map(&:to_i)
end
def self.to_fa
InputLine.to_sa.map(&:to_f)
end
end
def main(argv)
n = InputLine.to_i
case (n % 10)
when 2, 4, 5, 7, 9 then
puts 'hon'
when 0, 1, 6, 8 then
puts 'pon'
when 3 then
puts 'bon'
end
end
if self.to_s == 'main' then
main(ARGV)
end | [
"literal.string.change",
"call.arguments.change"
] | 392,667 | 392,668 | u198355306 | ruby |
p02675 | n = gets.to_s.chomp
p n[-1]
if n[-1] == "3"
puts "bon"
elsif n[-1] == "0" || n[-1] == "1" || n[-1] == "6" || n[-1] == "8"
puts "pon"
else
puts "hon"
end | n = gets.to_s.chomp
# p n[-1]
if n[-1] == "3"
puts "bon"
elsif n[-1] == "0" || n[-1] == "1" || n[-1] == "6" || n[-1] == "8"
puts "pon"
else
puts "hon"
end | [
"call.remove"
] | 392,781 | 392,782 | u748406041 | ruby |
p02675 | n = gets.to_s
if n[-1] == "3"
puts "bon"
elsif n[-1] == "0" || n[-1] == "1" || n[-1] == "6" || n[-1] == "8"
puts "pon"
else
puts "hon"
end | n = gets.to_s.chomp
# p n[-1]
if n[-1] == "3"
puts "bon"
elsif n[-1] == "0" || n[-1] == "1" || n[-1] == "6" || n[-1] == "8"
puts "pon"
else
puts "hon"
end | [
"call.add"
] | 392,783 | 392,782 | u748406041 | ruby |
p02675 | hon = [2, 4, 5, 7, 9]
pon = [1, 6, 8]
n = gets.to_i
if hon.count(n % 10) > 0
puts "hon"
elsif pon.count(n % 10) > 0
puts "pon"
else
puts "bon"
end | hon = [2, 4, 5, 7, 9]
pon = [0, 1, 6, 8]
n = gets.to_i
if hon.count(n % 10) > 0
puts "hon"
elsif pon.count(n % 10) > 0
puts "pon"
else
puts "bon"
end | [
"literal.array.change"
] | 392,837 | 392,838 | u482840940 | ruby |
p02675 | #input of int(split by space)
def get_i()
return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
return bool ? y : n
end
#create of array
def array(size1,init=nil,size2=-1)
if size2==-1
return Array.new(size1){init}
else
return Array.new(size2){Array.new(size1){init}}
end
end
def max(a,b)
return a>b ? a : b
end
def min(a,b)
return a>b ? b : a
end
INF=Float::INFINITY
N=get_nsp
if N[-1]=="2" or N[-1]=="4" or N[-1]=="5" or N[-1]=="7" or N[-1]=="9"
puts "hon"
elsif N[-1]=="0" or N[-1]=="6" or N[-1]=="6" or N[-1]=="8"
puts "pon"
else
puts "bon"
end | #input of int(split by space)
def get_i()
return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
return bool ? y : n
end
#create of array
def array(size1,init=nil,size2=-1)
if size2==-1
return Array.new(size1){init}
else
return Array.new(size2){Array.new(size1){init}}
end
end
def max(a,b)
return a>b ? a : b
end
def min(a,b)
return a>b ? b : a
end
INF=Float::INFINITY
N=get_nsp
if N[-1]=="2" or N[-1]=="4" or N[-1]=="5" or N[-1]=="7" or N[-1]=="9"
puts "hon"
elsif N[-1]=="0" or N[-1]=="1" or N[-1]=="6" or N[-1]=="8"
puts "pon"
else
puts "bon"
end | [
"literal.string.change",
"control_flow.branch.if.condition.change"
] | 392,916 | 392,917 | u415400221 | ruby |
p02675 | n = gets.to_i
n = n % 10;
if (n == 2 || n == 4 || n == 7 || n == 9)
puts "hon"
elsif n == 0 || n == 1|| n == 6 || n == 8
puts "pon"
else
puts "bon"
end
| n = gets.to_i
n = n % 10;
if (n == 2 || n == 4 || n == 5 || n == 7 || n == 9)
puts "hon"
elsif n == 0 || n == 1|| n == 6 || n == 8
puts "pon"
else
puts "bon"
end
| [
"control_flow.branch.if.condition.change"
] | 392,942 | 392,943 | u926099741 | ruby |
p02675 | N = gets.chomp.split("")
t = N.last
t = t.to_i
if (t==2) or (t==4) or (t==4) or (t==7) or (t==9)
puts "hon"
elsif (t==0) or (t==1) or (t==6) or (t==8)
puts "pon"
else
puts "bon"
end | N = gets.chomp.split("")
t = N.last
t = t.to_i
if (t==2) or (t==4) or (t==5) or (t==7) or (t==9)
puts "hon"
elsif (t==0) or (t==1) or (t==6) or (t==8)
puts "pon"
else
puts "bon"
end | [
"literal.number.integer.change",
"control_flow.branch.if.condition.change"
] | 393,009 | 393,010 | u326288614 | ruby |
p02676 |
#標準入力
#整数一文字の場合
n = gets.to_i
s = gets.to_s
if s.length <= n then
puts s
else
s = s.slice(0..n-1) + "..."
puts s
end
| n = gets.to_i
s = gets.to_s.chomp
if s.length <= n then
puts s
else
s = s.slice(0..n-1) + "..."
puts s
end
| [
"call.add"
] | 393,227 | 393,228 | u663882298 | ruby |
p02676 | n = gets.to_i
s = gets.chomp
if s.length<=k
puts s
else
puts s[0...k]+"..."
end | k = gets.to_i
s = gets.chomp
if s.length<=k
puts s
else
puts s[0...k]+"..."
end | [
"assignment.variable.change",
"identifier.change"
] | 393,250 | 393,251 | u976045235 | ruby |
p02676 | k = gets.to_i
s = gets.to_s
length = s.size
if length < k
puts s
else
newstr = s[0,k]
puts "#{newstr}..."
end | k = gets.to_i
s = gets.to_s
length = s.size
if length-1 <= k
puts s
else
newstr = s[0,k]
puts "#{newstr}..."
end | [
"control_flow.branch.if.condition.change"
] | 393,305 | 393,306 | u793199351 | ruby |
p02676 | k = gets.to_i
s = gets.to_s
length = s.size
if length <= k
puts s
else
newstr = s[0,k]
puts "#{newstr}..."
end | k = gets.to_i
s = gets.to_s
length = s.size
if length-1 <= k
puts s
else
newstr = s[0,k]
puts "#{newstr}..."
end | [
"control_flow.branch.if.condition.change"
] | 393,307 | 393,306 | u793199351 | ruby |
p02676 | k = gets.to_i
s = gets
if s.length <= k
puts s
else
puts s[0..k-1] + '...'
end | k = gets.to_i
s = gets.chomp
if s.length <= k
puts s
else
puts s[0..k-1] + '...'
end | [
"call.add"
] | 393,339 | 393,340 | u299289108 | ruby |
p02676 | k = gets.to_i
s = gets
if s.length < k
puts s
else
puts s[0..k-1] + '...'
end | k = gets.to_i
s = gets.chomp
if s.length <= k
puts s
else
puts s[0..k-1] + '...'
end | [
"call.add",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 393,341 | 393,340 | u299289108 | ruby |
p02676 | k = gets.to_i
s = gets
if s.length < k
puts s
else
puts s[0..k] + '...'
end | k = gets.to_i
s = gets.chomp
if s.length <= k
puts s
else
puts s[0..k-1] + '...'
end | [
"call.add",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 393,342 | 393,340 | u299289108 | ruby |
p02676 | k = gets.to_i
s = gets
if s.length <= k
puts s
else
puts "#{s[0...k]}..."
end | k = gets.chomp.to_i
s = gets.chomp
if s.length <= k
puts s
else
puts "#{s[0...k]}..."
end | [
"call.add"
] | 393,361 | 393,362 | u409544378 | ruby |
p02676 | k = gets.to_s.to_i
s = gets.to_s
if s.length <= k
puts s
else
puts "#{s[0...k]}..."
end | k = gets.chomp.to_i
s = gets.chomp
if s.length <= k
puts s
else
puts "#{s[0...k]}..."
end | [
"assignment.value.change",
"identifier.change"
] | 393,363 | 393,362 | u409544378 | ruby |
p02676 | K = gets.to_i
s = gets
if s.length > K then
s = s[0..K-1] + "..."
end
puts s | K = gets.to_i
s = gets.chomp
if s.length > K then
s = s[0..K-1] + "..."
end
puts s | [
"call.add"
] | 393,467 | 393,468 | u009976559 | ruby |
p02676 | K = gets.to_i
S = gets.chomp
if S.length > K
puts S[0..K-1]
else
puts S[0..K-1] + '...'
end | K = gets.to_i
S = gets.chomp
if S.length <= K
puts S[0..K-1]
else
puts S[0..K-1] + '...'
end | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 393,507 | 393,508 | u224392861 | ruby |
p02676 | K = gets.to_i
S = gets.chomp
if S.length >= K
puts S[0..K-1]
else
puts S[0..K-1] + '...'
end | K = gets.to_i
S = gets.chomp
if S.length <= K
puts S[0..K-1]
else
puts S[0..K-1] + '...'
end | [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 393,509 | 393,508 | u224392861 | ruby |
p02676 | k = gets.to_i
s = gets
if s.length <= k
puts s
else
puts s.slice(0,k) + '...'
end | k = gets.to_i
s = gets.chomp
if s.length <= k
puts s
else
puts s.slice(0,k) + '...'
end | [
"call.add"
] | 393,555 | 393,556 | u244203620 | ruby |
p02676 | k = gets.to_i
s = gets
if s.length > k
puts s[0..(k-1)] + '...'
else
puts s[0..(k-1)]
end | k = gets.chomp.to_i
s = gets.chomp
if s.length > k
print s[0..(k-1)] + '...'
else
print s[0..(k-1)]
end | [
"call.add",
"identifier.change"
] | 393,584 | 393,585 | u305883349 | ruby |
p02676 | k = gets.to_i
s = gets
if s.length > k
print s[0..(k-1)] + '...'
else
print s[0..(k-1)]
end
| k = gets.chomp.to_i
s = gets.chomp
if s.length > k
print s[0..(k-1)] + '...'
else
print s[0..(k-1)]
end | [
"call.add"
] | 393,586 | 393,585 | u305883349 | ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.