Share Code Quickly

What is Harigami?

Harigami is a simple source code sharing service. You can share source code by an URL which is issued after submission.
You can also run your source code online such as Python, Ruby, JavaScript and so on.
For free.Use for code review.
Preferences
anonymous No title
Python
//@version=3
strategy("pivot reverse", overlay=true)

//pivot
len=4
len2=20
pL = input(len,minval=1,title="left")
pR = input(len2,minval=1,title="right")
SL     = input(true,title="line")
maxLvlLen        = input(20,minval=0, title="line")
pvthi = pivothigh(pL,pR)
pvtlo = pivotlow(pL,pR)
swh = pivothigh(pL, pR)
swl = pivotlow(pL, pR)

//entry
swh_cond = not na(swh)

hprice = 0.0
hprice := swh_cond ? swh : hprice[1]

le = false
le := swh_cond ? true : (le[1] and high > hprice ? false : le[1])

if (le)
    strategy.entry("BUY", strategy.long, comment="L", stop=hprice + syminfo.mintick)

swl_cond = not na(swl)

lprice = 0.0
lprice := swl_cond ? swl : lprice[1]


se = false
se := swl_cond ? true : (se[1] and low < lprice ? false : se[1])

if (se)
    strategy.entry("SEL", strategy.short, comment="S", stop=lprice - syminfo.mintick)

//coler&etc.

counthi = 0.0 
counthi := pvthi[1] ? 0 : nz(counthi[1])+1
countlo = 0.0
countlo := pvtlo[1] ? 0 : nz(countlo[1])+1
pvthis = 0.0
pvthis := pvthi[1] ? high[pR+1] : pvthis[1]
pvtlos = 0.0
pvtlos := pvtlo[1] ? low[pR+1] :  pvtlos[1]
hipc = (pvthis != pvthis[1]) ? na : blue
lopc = (pvtlos != pvtlos[1]) ? na: red
h2l= (pvthis+pvtlos)/2
plot(SL and (maxLvlLen==0 or counthi<maxLvlLen)? pvthis : na, color=hipc, transp=30, linewidth=1, offset=-pR-1, title="H-line", trackprice=false)
plot(SL and (maxLvlLen==0 or countlo<maxLvlLen)? pvtlos : na, color=lopc, transp=30, linewidth=1, offset=-pR-1, title="L-line", trackprice=false)
anonymous No title
Python
//@version=3
strategy("CB", overlay=true)
len=37
//DCC
i2 = input(len, "DCC", type=integer, minval=3)
eh = highest(high,i2)
el = lowest(low,i2)
r = eh - el
k = (close - el) / r
upBound = highest(high, i2)
downBound = lowest(low, i2)

//ENTRY
if (not na(close[i2]))
    strategy.entry("CBL", strategy.long, stop=upBound + syminfo.mintick, comment="L")
    strategy.entry("ChS", strategy.short, stop=downBound - syminfo.mintick, comment="S")


//COLOR
P1 = plot(eh,color=aqua)
P2 = plot(el,color=aqua)
fill(P1 , P2 ,color=aqua)
anonymous ABC124 A
Python
A, B = map(int, input().split())

num = max(A, B)

if A == B:
    print(num + num)
else:
    print(num + num - 1)
anonymous ABC125 B
Python
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

sum = 0

for i in range(N):
    if V[i] - C[i] > 0:
        sum += V[i] - C[i]

print(sum)
anonymous ABC125 A
Python
A, B, T = map(int, input().split())

sum = 0
for s in range(1, T+1):
    if s % A == 0:
        sum += B

print(sum)
anonymous ABC126 B
Python
S = input()

aa = S[0:2]
bb = S[2:4]


def isYY(yy):
    if 0 <= int(yy) and int(yy) <= 99:
        return True
    else:
        return False


def isMM(mm):
    if 1 <= int(mm) and int(mm) <= 12:
        return True
    else:
        return False


ans = []
if isYY(aa) and isMM(bb):
    # YYMM
    ans.append('YYMM')
if isMM(aa) and isYY(bb):
    # MMYY
    ans.append('MMYY')

if len(ans) >= 2:
    print('AMBIGUOUS')
elif len(ans) == 1:
    print(ans[0])
else:
    print('NA')
anonymous ABC127 B
Python
r, D, x2 = map(int, input().split())

for _ in range(0, 10):
    nx = r * x2 - D
    print(nx)
    x2 = nx
anonymous ABC127
Python
A, B = map(int, input().split())

if A >= 13:
    print(B)
elif 6 <= A and A <= 12:
    print(int(B/2))
elif A <= 5:
    print(0)
anonymous No title
Ruby
nil
anonymous No title
Python
from operator import itemgetter

N = int(input())
ins = [list(input().split()) for _ in range(N)]

res = []
for i, row in enumerate(ins):
    row = [i+1] + [row[0]] + [int(row[1])]
    res.append(row)

res.sort(key=itemgetter(2), reverse=True)
res.sort(key=itemgetter(1))

for i in res:
    print(i[0])