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

ARC071 E - TrBBnsformBBtion

解法 どんな文字列でも"A"or"B"or""の3種類のどれかにすることができる。そのため無限にある文字列を"A"にできる文字列、"B"にできる文字列、""にできる文字列の3つのグループに分けることができる。"A"にできる文字列は逆に"A"から作ることができる。"B"、"…

CODE THANKS FESTIVAL 2017(Parallel)

A - Time Penalty 最大値出力。 #include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <cmath> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #include <stdlib.h> #include <stdio.h> #include <bitset> #include <cstring> #incl…</cstring></bitset></stdio.h></stdlib.h></vector></string></stack></sstream></set></queue></cmath></map></iostream></cstdio></algorithm>

ARC070 D - No Need

解説 wa = a_iを含む良い集合の和の最小値とすると、 wa - a_i ≧ K <=> a_i は不必要 wa - a_i < K <=> a_i は必要 となる。 全てのカードiについて、カードiを含まないカードで作れる和をdpで調べる。 dp[j][k] = カードjまで調べたときに和kを作れるかどう…