Skip to content

Instantly share code, notes, and snippets.

@lae
Created June 22, 2015 06:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lae/f860f38f9e2a3aa137c5 to your computer and use it in GitHub Desktop.
Save lae/f860f38f9e2a3aa137c5 to your computer and use it in GitHub Desktop.
paiza's online hackathon vol 5 (https://paiza.jp/poh/enshura)
# coding: utf-8
# Let's challenge in my favorite language!!
width, height = [int(i) for i in str(input()).split()]
table = [[0 for y in range(height)] for x in range(width)]
for line in range(height):
for i, v in enumerate([int(i) for i in str(input()).split()]):
table[i][line] = v
for col in range(width):
for row in reversed(range(height)):
while table[col][row] == 2:
table[col].pop(row)
table[col].insert(0, 0)
for row in range(height):
print(" ".join([str(table[col][row]) for col in range(width)]))
# coding: utf-8
# Let's challenge in my favorite language!!
c = str(input())
print("".join([c[i] for i in range(0, len(c)) if i%2 == 0]))
# coding: utf-8
# Let's challenge in my favorite language!!
total_lines = int(input())
sales = [0]*7
for day in range(0, total_lines):
sales[day%7] += int(input())
print("\n".join([str(day_sales) for day_sales in sales]))
-- Let's challenge in my favorite language!!
main = putStrLn "RENA"
-- or
main = putStrLn "MINAMI"
-- lol
# coding: utf-8
# Let's challenge in my favorite language!!
width, height, selection_count = [int(i) for i in str(input()).split()]
table = []
selections = []
selected_coords = set()
for line in range(0, height):
table.append([int(i) for i in str(input()).split()])
for line in range(0, selection_count):
selections.append([int(i)-1 for i in str(input()).split()])
for s in selections:
for row in range(s[0], s[2]+1):
for col in range(s[1], s[3]+1):
selected_coords.add((col, row))
print(sum([table[c][r] for c,r in selected_coords]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment