View abc012-a.rb
a, b = gets.chomp.split(" ").map(&:to_i)
puts "#{b} #{a}"
View abc010-a.rb
s = gets.chomp
puts s + "pp"
View abc056-a.rb
a, b = gets.chomp.split(" ")
if a == "H" then
if b == "H" then
ret = "H"
else
ret = "D"
end
else
if b == "H" then
ret = "D"
View file0.txt
from __future__ import with_statement, print_function
from ij import IJ
from ij.gui import Overlay, Line, TextRoi
import java.lang.Boolean as JBool
from java.awt import Font
imp = IJ.getImage()
selection = Line(1200, 2500, 2500, 2500)
textroi = TextRoi(selection.x1, selection.y1, "text", Font("Consolas", Font.PLAIN, 300))
overlay = Overlay()
View textroi.py
from __future__ import with_statement, print_function
from ij import IJ
from ij.gui import Overlay, Line, TextRoi
import java.lang.Boolean as JBool
from java.awt import Font
imp = IJ.getImage()
selection = Line(1200, 2500, 2500, 2500)
textroi = TextRoi(selection.x1, selection.y1, "text", Font("Consolas", Font.PLAIN, 300))
overlay = Overlay()
View arc060-c.rb
# http://arc060.contest.atcoder.jp/data/arc/060/editorial.pdf
# TLE 200
n, a = gets.chomp.split(" ").map(&:to_i)
x = gets.chomp.split(" ").map(&:to_i)
xmax = (x + [a]).max
dp = Array.new(n+1){Array.new(n+1){Array.new(n*xmax + 1, 0)}}
(0..n).each do |j|
(0..n).each do |k|
(0..(n*xmax)).each do |s|
if j == 0 && k == 0 && s == 0 then
View arc066-c.rb
n = gets.chomp.to_i
a = gets.chomp.split(" ").map(&:to_i).sort
if n.even? then
ref = ((1..(n-1)).step(2).to_a * 2).sort
ans = 2**(n/2) % (10**9 + 7)
else
ref = ((2..(n-1)).step(2).to_a * 2 + [0]).sort
ans = 2**((n-1)/2) % (10**9 + 7)
end
if a == ref then
View yahoo_procon2017_qual-a.rb
h = Hash.new(0)
gets.chomp.split("").each do |s|
h[s] += 1
end
if h["y"] == 1 && h["a"] == 1 && h["h"] == 1 && h["o"] == 2 then
puts "YES"
else
puts "NO"
end
View abc055-a.rb
n = gets.chomp.to_i
x = 800 * n
y = (n / 15) * 200
puts x - y
View imageJ-Frame-open-button.py
from javax.swing import JButton, JFrame
from ij.io import Opener
from ij import IJ, ImagePlus
import sys
class MyFrame(JFrame):
def __init__(self):
JFrame.__init__(self, "Hello Jython")
button = JButton("Open", actionPerformed=self.openPushed)
self.add(button)