0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

atcoder_水色精進記録6_ABC099d

Posted at

Atcoder水色精進記録

ABC099
D - Good Grid
https://atcoder.jp/contests/abc099/tasks/abc099_d

アルゴリズム・データ構造

全探索

考察

N*NのGridなのでマス数
500*500=250,000 =2.5 * 10**5

%3での場合分けのため、3つのリストを作ることを考える。
各リストの長さは2.5*10**5/3→定数倍を無視して2.5*10**5
色の最大種類数は30のため、各リストに対して、全種類の色に対して、塗り替えた場合の違和感の総和を求めることは可能
違和感の総和をsortして、違和感が小さい物から選ぶ
→違和感が小さい色が重なった場合はどうなる?
→30種類なので、sortせずに、全探索でOK

提出

感想

なし

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?