¥È¥Ã¥× «Á°¤ÎÆüµ­(2006-06-26) ºÇ¿· ¼¡¤ÎÆüµ­(2006-06-28)» ÊÔ½¸

¤Ï¤¸¤á¤Æ¤Î¤Ë¤­

¤³¤³¤Î°ÌÃÖÉÕ¤±

2004|11|
2005|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|03|04|05|06|07|08|09|10|11|12|
2013|01|02|03|04|05|06|07|08|09|10|11|12|
2014|01|02|03|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|08|09|10|11|12|
2016|01|02|03|04|05|06|07|08|09|10|11|12|
2017|01|02|03|04|05|06|07|08|09|10|11|12|
2018|01|02|03|04|05|06|07|08|09|10|11|12|
2019|01|02|03|04|05|06|07|08|09|10|11|12|
2020|01|02|03|04|05|06|07|08|09|10|11|12|
2021|01|02|03|04|05|06|07|08|09|10|11|12|
2022|01|02|03|04|05|06|07|08|09|10|11|12|
2023|01|02|03|04|05|06|07|08|09|10|11|12|
2024|01|02|03|04|05|06|07|08|09|10|11|

ToDo:


2006-06-27

_ 1Æü1Ruby

¤¬¥Û¥ó¥È¤«¤É¤¦¤«¥Á¥§¥Ã¥¯¤·¤è¤¦¡£

ºòÆü¤Ï gopku.rb

s = ''
`cpp #{ARGV[0]}`.split(/\n/).each do |l|
  next if l =~ /^#/
  s += l.sub(/^ */, '').chomp
end

File.open('out', 'w') do |o|
  o.print s
end

p s.size
system("xclip < out")

PKU ¤Ë Submit ¤¹¤ë¤¿¤á¤Ë C ¤Î¥³¡¼¥É¤ò¥³¥á¥ó¥È½üµî¡¦¶õÇòºï½ü¤·¤Æ ¥³¥Ô¡¼¥Ð¥Ã¥Õ¥¡¤Ë¤Ä¤Ã¤³¤à¡£

º£Æü¤Ï prod.rb

|000>+|001>+|010>+|100>+|111> ¤¬ 4¹à¤Ç½ñ¤±¤Ê¤¤¤³¤È¤ò ¾ÚÌÀ¤·¤¿¤¤¤é¤·¤¤¤ó¤ÇÈ¿Îãõ¤·¤Ç ´Êñ¤Ê¥±¡¼¥¹¤À¤±¥Á¥§¥Ã¥¯¡£ ¤Þ¤¡·ë²Ì¸«¤Ä¤«¤é¤ó¤«¤Ã¤¿¡£

def get(s, i)
  s & (1 << i) != 0 ? 1 : 0
end

def st(s, t)
  if (t == 0)
    s.to_s
  else
    ['0+1','0-1'][s]
  end
end

def state_str(s, t)
  r = ''
  for i in 0...12
    r += '(' + st(get(s, i), get(t, i % 3)) + ')'
  end
  r
end

def addterms(as, *ts)
  r = []
  ts.each do |t|
    as.each do |a|
      b = t.dup
      e = a.dup
      if e =~ /^-/
        e.sub!(/^-/, '')
        if b =~ /^-/
          b.sub!(/^-/, '')
        else
          b = '-' + b
        end
      end
      r.push(b+e)
    end
  end
  r
end

def addminus(t, m)
  if m == 1
    if t =~ /^-/
      t.sub(/^-/, '')
    else
      '-' + t
    end
  else
    t
  end
end

for m in 0...16
  p m

  for t in 0...8
    for s in 0...4096
      st = Hash.new(0)
      for i in 0...4
        a = []
        minus = get(m, i)

        if get(t, 0) == 0
          a.push(addminus(get(s, i*3).to_s, minus))
        else
          if get(s, i*3) == 0
            a.push(addminus('0', minus))
            a.push(addminus('1', minus))
          else
            a.push(addminus('0', minus))
            a.push(addminus('-1', minus))
          end
        end

        if get(t, 1) == 0
          a = addterms(a, get(s, i*3+1).to_s)
        else
          if get(s, i*3+1) == 0
            a = addterms(a, '0', '1')
          else
            a = addterms(a, '0', '-1')
          end
        end

        if get(t, 2) == 0
          a = addterms(a, get(s, i*3+2).to_s)
        else
          if get(s, i*3+2) == 0
            a = addterms(a, '0', '1')
          else
            a = addterms(a, '0', '-1')
          end
        end

        a.each do |at|
          e = at.dup
          if e =~ /^-/
            e.sub!(/^-/, '')
            st[e] -= 1
          else
            st[e] += 1
          end
        end

      end

      if st.key?('000') && st.key?('111') && st.key?('001') && st.key?('010') && st.key?('100') && st.size == 5
        p state_str(s, t)
        p st
      end
    end
  end
end

(21:35)

¤ªÌ¾Á°:
E-mail:
¥³¥á¥ó¥È:
¿ÍÀ¸¡¢±§Ãè¡¢¤¹¤Ù¤Æ¤ÎÅú¤¨
ËÜÆü¤Î¥ê¥ó¥¯¸µ

Á° 2006ǯ
6·î
¼¡
Æü ·î ²Ð ¿å ÌÚ ¶â ÅÚ
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30
1.shinh(2014-05-24 03:56) 2.YT(2014-05-24 03:56) 3.niha(2014-05-24 03:56)
search / home / index

Á´¤Æ¥ê¥ó¥¯¥Õ¥ê¡¼¤Ç¤¹¡£ ¥³¡¼¥ÉÊҤϼ«Í³¤Ë»ÈÍѤ·¤Æ¤¤¤¿¤À¤¤¤Æ¹½¤¤¤Þ¤»¤ó¡£ ¤½¤Î¾¤Î¤â¤Î¤ÏGPL°·¤¤¤Ç¤¢¤ì¤Ð¤¢¤é¤æ¤ë»ÈÍѤ˴ؤ·¤Æʸ¶ç¤Ï¸À¤¤¤Þ¤»¤ó¡£ ¤Ê¤Ë¤«¤¢¤ì¤Ð²¼µ­¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ø¡£

shinichiro.hamaji _at_ gmail.com / shinichiro.h