Last active
August 29, 2015 14:10
-
-
Save mingyc/45a3705299288e5a3f6a to your computer and use it in GitHub Desktop.
エンジニアでも恋がしたい! https://paiza.jp/poh/enkoi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://paiza.jp/poh/enkoi | |
from sys import stdin | |
print sum(map(int, stdin.readlines()[1:])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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