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 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])
anonymous No title
Python
stdin = list(map(int, input().split()))

print(int((stdin[0]*3+stdin[1]) / 2))
anonymous No title
Python
# wrong
class MyDataParallel(nn.DataParallel):
    def __getattr__(self, name):
        return getattr(self.module, name)

# correct
class MyDataParallel(DataParallel):
    def __getattr__(self, name):
        if name is not 'module':
            try:
                return getattr(self.module, name)
            except AttributeError:
                pass
        print(name)
        return super(nn.DataParallel, self).__getattr__(name)