2020-12-12から1日間の記事一覧

PythonでJOI難易度6を埋める #25

4 - JOIポスター (JOI Poster) 数学感がある問題.参考にした提出.細かい条件 from sys import stdin input = stdin.readline n, w, h = map(int, input().strip().split()) xy = [list(map(int, input().strip().split())) for _ in range(n)] ans = 0 for…

PythonでJOI難易度6を埋める #24

A - JOI紋章(JOI Emblem) 実装の面倒さで難易度6にいる.私は気合で場合分けしました() from sys import stdin input = stdin.readline m, n = map(int, input().strip().split()) flag = [input().strip() for _ in range(m)] crest = [input().strip() f…

PythonでJOI難易度6を埋める #23

B - IOI饅頭(IOI Manju) ]] := i番目の箱まで使えるときの,j個以上の饅頭を入れるために必要な金額の最小として,dpします.饅頭は高い方から売った方がいいので,降順でsortして,累積和を取っておきます. from sys import stdin input = stdin.readlin…