Skip to content

Instantly share code, notes, and snippets.

@mingyc
Last active August 29, 2015 14:10
Show Gist options
  • Save mingyc/45a3705299288e5a3f6a to your computer and use it in GitHub Desktop.
Save mingyc/45a3705299288e5a3f6a to your computer and use it in GitHub Desktop.
エンジニアでも恋がしたい! https://paiza.jp/poh/enkoi
# https://paiza.jp/poh/enkoi
from sys import stdin
print sum(map(int, stdin.readlines()[1:]))
# https://paiza.jp/poh/enkoi-second/0221cff8?o=5dcfca6b
from sys import stdin
ans = 0
for line in stdin.readlines()[1:]:
T, S, P = map(int, line.split())
if T > S:
ans += (T-S)*P
print ans
# https://paiza.jp/poh/enkoi-third/6502495d?o=5dcfca6b
from sys import stdin
t, n = map(int, stdin.readline().split())
m = map(int, stdin.readlines())
cur_hit = max_hit = sum(m[:t])
for i in xrange(t, n):
cur_hit += m[i] - m[i-t]
max_hit = max(cur_hit, max_hit)
print max_hit
# Hawaii end: https://paiza.jp/poh/enkoi-ending/4f66f515?o=5dcfca6b
# bad end: https://paiza.jp/poh/enkoi-ending/ef9157bc?o=5dcfca6b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment