Soumettre la recherche
Mettre en ligne
Abc#004d
•
Télécharger en tant que PPTX, PDF
•
0 j'aime
•
349 vues
kataware
Suivre
This is solution for atcoder begginers contest #004-d merble
Lire moins
Lire la suite
Technologie
Affichage du diaporama
Signaler
Partager
Affichage du diaporama
Signaler
Partager
1 sur 14
Télécharger maintenant
Recommandé
ACPC2016Day3:C問題
ACPC2016Day3:C問題
HCPC: 北海道大学競技プログラミングサークル
0614
0614
RIKEN Center for Integrative Medical Science Center (IMS-RCAI)
釣り
釣り
理玖 川崎
AtCoder Beginner Contest 004 解説
AtCoder Beginner Contest 004 解説
AtCoder Inc.
セキュリティ関連OSSツール紹介
セキュリティ関連OSSツール紹介
kataware
コンパイラ(Lexとyaccを使う)
コンパイラ(Lexとyaccを使う)
kataware
名古屋セキュリティ勉強会LT~学内CTFの話~
名古屋セキュリティ勉強会LT~学内CTFの話~
kataware
Isolation forest
Isolation forest
kataware
Recommandé
ACPC2016Day3:C問題
ACPC2016Day3:C問題
HCPC: 北海道大学競技プログラミングサークル
0614
0614
RIKEN Center for Integrative Medical Science Center (IMS-RCAI)
釣り
釣り
理玖 川崎
AtCoder Beginner Contest 004 解説
AtCoder Beginner Contest 004 解説
AtCoder Inc.
セキュリティ関連OSSツール紹介
セキュリティ関連OSSツール紹介
kataware
コンパイラ(Lexとyaccを使う)
コンパイラ(Lexとyaccを使う)
kataware
名古屋セキュリティ勉強会LT~学内CTFの話~
名古屋セキュリティ勉強会LT~学内CTFの話~
kataware
Isolation forest
Isolation forest
kataware
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Contenu connexe
En vedette
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
En vedette
(20)
2024 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 ChatGPT
Product 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 Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO 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)
How 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 Insights
Trends 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 summary
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
Google'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
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The 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...
Abc#004d
1.
ABC#004-D マーブル
2.
自己紹介 * @_ktwr * ctf初心者、競プロ雑魚 *
得意言語はpython()
3.
本日の資料 * Maharaにあるよ!! * ダウンロードしてOfficeで見るのが面倒くさい方に →Slide
Share 後であげます。
4.
問題 -100 0 100 ...
... -100 0 100 ... ...
5.
まずはじめに 最終的なマーブルの始まる位置と終わる位置がわかれば 移動量は求められる!! -101 -100 -2
0 1 98 100 101 ... ... 1 0 2 1 0 1 1 0 1 移動量=(1)+(2+1+1)+(1+1)=6
6.
解き方 * 赤・緑・青の順番に並ぶのはわかってる →ならば緑の開始位置を決めれば 自動的に赤・青の開始位置が決まる * 緑の位置を適当にずらして探索を行う。
7.
解き方 * マーブルの数は300までという指定から 緑の動かす範囲を適当に決める 自分は-500〜500で指定 * マーブルの始まる位置,マーブルの個数, 基準となる位置から距離を計算する関数の作成
8.
前述関数について x c x+N-1 * 開始位置がx,マーブルの個数がN,基準点がcとすると ...
... となるのでこの距離を求めてあげれば良い
9.
続き * ただ途中で正負が入れ替わる可能性を考える必要あり -180 -100 -50 ...
... -100 0 40 ... ...
10.
続き //距離を求める関数 int calc(int x,int
y){ return (x+y)*(y-x+1)/2; } long long dis(int N,int n, int cen){ int x = n -cen; return abs(calc(min(0,x),min(0,x+N-1)))+abs(calc(max(0,x),max(0,x+N-1))); }
11.
動的計画法 * 左から赤、緑、青のマーブルが順にならぶ * 赤が残ってるなら緑、青は置けない。 緑が残ってるなら青は置けない。 *
2次元配列dpを用意する dp[今いる箱の位置][マーブルの個数] * これでマーブルの個数が0になるまで行う * 自分は箱の個数を1000個と想定した
12.
続き for(int i =0;i<1001;i++){ for(int
j =0; j<=N;j++){ int cost=0; if(j <= r) cost = abs(400-i); else if( j <= r+g )cost = abs(500-i); else cost = abs(600-i); if(!j) dp[i][j]=0; else if(i+1 < j) dp[i][j]=mi; else if(!i && j == 1)dp[i][j] =cost; else{ int x = dp[i-1][j-1] + cost; int y = dp[i-1][j]; dp[i][j]=min(x,y); }}}
13.
続き * 最後にどのスタート位置からの距離が最小か調べる for(int i=0;i
< 1001;i++){ mi = min(mi,dp[i][N]); }
14.
補足 * 公式解説より最小費用流という方法もあるそうです http://www.slideshare.net/chokudai/abc004
Télécharger maintenant