SlideShare a Scribd company logo
1 of 20
Download to read offline
北大日立マラソン2nd やったこと
@yowa
1st のおさらい
● K×Kの盤面に 1~V の
数字を置く
● 得点表(項目数: E)の
ペアが隣接 → 加点
  得点表
(1, 2) -> 5点
(2, 6) -> 2点
(4, 7) -> 9点
(6, 7) -> 8点
1st のおさらい
● K×Kの盤面に 1~V の
数字を置く
● 得点表(項目数: E)の
ペアが隣接 → 加点
  得点表
(1, 2) -> 5点
(2, 6) -> 2点
(4, 7) -> 9点
(6, 7) -> 8点
総得点:
    11点
1st と 2nd の違い
● 同じ数字を、   
連結する複数マス
に置ける
● 得点表をフルコン
プするとボーナス
100,000点
  得点表
   (省略)
やったこと(基本アイデア)
● 左図のように   
斜めに並べれば、
K×Kの盤面で
(K+1)個の領域が
互いに隣り合う  
   (完全グラフ)
● V K+1≦ なら
これでフルコンプ
やったこと(基本アイデア)
● V > K+1 ならば  
いくつかの領域を
ぶった切って   
領域数を増やす
おおまかなアルゴリズム(1/4)
● K×Kの盤面を、V個の領域に分割する(前述の方法)
おおまかなアルゴリズム(2/4)
● K×Kの盤面を、V個の領域に分割する(前述の方法)
●
領域の形を固定したまま、どの領域にどの数字を
当てはめるか、焼きなましで決める
↑ここは、だいたい 1st と同じアルゴリズム
おおまかなアルゴリズム(2/4)
● K×Kの盤面を、V個の領域に分割する(前述の方法)
●
領域の形を固定したまま、どの領域にどの数字を
当てはめるか、焼きなましで決める
↑ここは、だいたい 1st と同じアルゴリズム
おおまかなアルゴリズム(3/4)
● K×Kの盤面を、V個の領域に分割する(前述の方法)
●
領域の形を固定したまま、どの領域にどの数字を
当てはめるか、焼きなましで決める
↑ここは、だいたい 1st と同じアルゴリズム
● 当てはめた数字を固定したまま、領域の形をちょっ
とずつ変形させ、スコア改善なら採用(山登り)
おおまかなアルゴリズム(4/4)
● K×Kの盤面を、V個の領域に分割する(前述の方法)
●
領域の形を固定したまま、どの領域にどの数字を
当てはめるか、焼きなましで決める
↑ここは、だいたい 1st と同じアルゴリズム
● 当てはめた数字を固定したまま、領域の形をちょっ
とずつ変形させ、スコア改善なら採用(山登り)
● (蛇足) スコアが減らない範囲で、各領域を狭める
実は使ったマス数でスコアにペナルティがある
そんなの誤差だよ、誤差
やったこと(焼きなまし)
● いったん各領域の形はさっきのに固定
– 領域同士が隣接してるかどうかの隣接グラフを  
あらかじめ計算しておく
● どの領域を何番に割り当てるか?
– 焼きなまし
– 2つの領域について、割り当てる番号を swap して   
よかったら採用(悪くても一定確率で採用)
やったこと(領域変形) (1/2)
● 「領域はそれぞれ連結でないといけない」という  
制約を守ったままの変形
– 除去するマスが領域グラフの関節点かどうか
– オレのアルゴリズムぢからでは、そんなの無理無理
やったこと(領域変形) (2/2)
● 各領域の形を木(tree)に限定
– 幸い初期領域は木(閉路どころか分岐すらない)
– 次数2以上なら関節点、次数1ならそうじゃない
● 周囲8マスだけ見れば関節点かどうかわかる!かんたん!
この5
→周囲に5が2マスある
→関節点
→変更すると領域切断
→変更不可
やったこと(領域変形) (2/2)
● 各領域の形を木(tree)に限定
– 幸い初期領域は木(閉路どころか分岐すらない)
– 次数2以上なら関節点、次数1ならそうじゃない
● 周囲8マスだけ見れば関節点かどうかわかる!かんたん!
この8
→周囲に8が1マスだけ
→関節点じゃない
→変更しておk
やったこと(領域変形) (2/2)
● 各領域の形を木(tree)に限定
– 幸い初期領域は木(閉路どころか分岐すらない)
– 次数2以上なら関節点、次数1ならそうじゃない
● 周囲8マスだけ見れば関節点かどうかわかる!かんたん!
この8
→2,7,1 に変更可
→3,5には変更不可
(周囲に2個ある
 →木じゃなくなる)
→4,6にも変更不可
(周囲に0個
  →飛び地になる)
やらなかったこと
● 積極的に得点表コンプボーナスを取りに行く
– さっきのやり方でコンプできたらラッキー程度
– 特に小規模なグラフ(V小、E小、K大)なら、それ専用の
アルゴリズムに切り替えてでも、ボーナス狙うべき
●
領域変形時の焼きなまし
– 山登りにとどめた
– やってはみたけど芳しくなかった
– 計算が重くて回数稼げないのと、この近傍の取り方だと
遷移確率の可逆性(?)みたいな(?)アレが適してない(?)
– 焼きなまし、わからん
よかったこと / よくなかったこと
● 序盤に「どんな形の領域にしたら完全グラフが埋め
込めるかな~?」と図を書きながらいろいろ考えた
のがたのしかったです。
● 解のvisualizeがけっこうキレイにできたのがよかっ
たです。(テキストでSVGをベタ出力だけどな)
●
まとめスライドに取り掛かるのが遅かったのがよく
なかったです
よかったこと / よくなかったこと
● 序盤に「どんな形の領域にしたら完全グラフが埋め
込めるかな~?」と図を書きながらいろいろ考えた
のがたのしかったです。
● 解のvisualizeがけっこうキレイにできたのがよかっ
たです。(テキストでSVGをベタ出力だけどな)
●
まとめスライドに取り掛かるのが遅かったのがよく
なかったです
おしまい
@yowa

More Related Content

Recently uploaded

Recently uploaded (12)

Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsUtilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native Integrations
 
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
 
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
 
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
 
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
 
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
 
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

AtCoder 北大日立マラソン 2nd 参加メモ (yowa)