SlideShare a Scribd company logo
1 of 7
Download to read offline
H: Hogemon Get
原案: OKA
   解説: がっちょ君
問題概要
・N( 3 ≤ N ≤ 30 )個の町とM( N-1 ≤ M ≤ min(N*(N-1)/2, 300) )本の道が与えられる。
・町iではボールをdi
個入手可能である。
・ある町で再びボールを入手するには、最後にその町でボールを入手してから15分以上
経過していなければならない。
・町は何度でも訪れることができる。
・町1から町NにR( 10 ≤ R ≤ 1000 )分以内で移動するときに入手できるボールの最大
値を求めよ。
想定誤解法
・DP(動的計画法)
 dp[i][j] := i分の時点で町jにいるときのボールの最大値。
 このdpの定義だと、最後にボールをとった町がわからないうえ、その町に行くときに15
分以上経過しているかどうかもわからない。
 よって、遷移の計算が不可能。
想定解法1
・DP(動的計画法)
dp[i][j][k] := i分の時点で町jにいて、最後にボールをとった町が町kのときのボールの
最大値。
O(R*N^3)となる。R≤1000 , N ≤ 30なので間に合う。
あらかじめ、ワーシャルフロイドしておくと実装が楽になる。
 最後にボールをとった町kに行って、今いる町jに戻ってくるという遷移をうまく実装する
ことが大切。
想定解法2
・DP(動的計画法)
dp[i][j][k] := 合計 i個のボールを持って町jにいて、最後にボールをとった町が町kのと
きの経過時間の最小値。
最終的に得られるボールの総和をXとおくと、制約より X ≤ 2000 であることがわか
る。
O(X*N^3)となる。X≤2000 , N ≤ 30なので間に合う。
結果
● Onsite
○ First Submission: ( min)
○ First AC: ( min)
● Online
○ First Submission: rickytheta (85 min)
○ First AC: rickytheta (98 min)
● Success Rate (Accepted / Submission)
○ 18.18%
ジャッジ解
haji c++ 53行
dohatsu c++ 66行
kzyKT c++ 49行
Gacho c++ 49行
uku c++ 62行
arrows c++ 82行

More Related Content

Viewers also liked

literature review of Titanium alloys and linear friction welding
literature review of Titanium alloys and linear friction weldingliterature review of Titanium alloys and linear friction welding
literature review of Titanium alloys and linear friction weldingYinaGuo
 
Atticus Sip and Study Book
Atticus Sip and Study BookAtticus Sip and Study Book
Atticus Sip and Study BookMackenzie Zirbel
 
IBM Cognos - IBM informations-integration för IBM Cognos användare
IBM Cognos - IBM informations-integration för IBM Cognos användareIBM Cognos - IBM informations-integration för IBM Cognos användare
IBM Cognos - IBM informations-integration för IBM Cognos användareIBM Sverige
 
Optimization Culture Arena at Volvo Car Group
Optimization Culture Arena at Volvo Car GroupOptimization Culture Arena at Volvo Car Group
Optimization Culture Arena at Volvo Car GroupAltair
 
Ipsos MORI Political Monitor: September 2016
Ipsos MORI Political Monitor: September 2016Ipsos MORI Political Monitor: September 2016
Ipsos MORI Political Monitor: September 2016Ipsos UK
 
Mentoring and coaching uwi jan2016
Mentoring and coaching uwi jan2016Mentoring and coaching uwi jan2016
Mentoring and coaching uwi jan2016Leahcim Semaj
 
emotional intelligence
 emotional intelligence emotional intelligence
emotional intelligenceRajpal Aulakh
 
Setup Oracle EBS R12 Performance Management
Setup Oracle EBS R12 Performance ManagementSetup Oracle EBS R12 Performance Management
Setup Oracle EBS R12 Performance ManagementFeras Ahmad
 
METal International - Hacking Steve Jobs
METal International - Hacking Steve JobsMETal International - Hacking Steve Jobs
METal International - Hacking Steve JobsDr. Mark Goulston
 
Laboratorium Inovasi Menuju Pelayanan Prima
Laboratorium Inovasi Menuju Pelayanan PrimaLaboratorium Inovasi Menuju Pelayanan Prima
Laboratorium Inovasi Menuju Pelayanan PrimaTri Widodo W. UTOMO
 

Viewers also liked (10)

literature review of Titanium alloys and linear friction welding
literature review of Titanium alloys and linear friction weldingliterature review of Titanium alloys and linear friction welding
literature review of Titanium alloys and linear friction welding
 
Atticus Sip and Study Book
Atticus Sip and Study BookAtticus Sip and Study Book
Atticus Sip and Study Book
 
IBM Cognos - IBM informations-integration för IBM Cognos användare
IBM Cognos - IBM informations-integration för IBM Cognos användareIBM Cognos - IBM informations-integration för IBM Cognos användare
IBM Cognos - IBM informations-integration för IBM Cognos användare
 
Optimization Culture Arena at Volvo Car Group
Optimization Culture Arena at Volvo Car GroupOptimization Culture Arena at Volvo Car Group
Optimization Culture Arena at Volvo Car Group
 
Ipsos MORI Political Monitor: September 2016
Ipsos MORI Political Monitor: September 2016Ipsos MORI Political Monitor: September 2016
Ipsos MORI Political Monitor: September 2016
 
Mentoring and coaching uwi jan2016
Mentoring and coaching uwi jan2016Mentoring and coaching uwi jan2016
Mentoring and coaching uwi jan2016
 
emotional intelligence
 emotional intelligence emotional intelligence
emotional intelligence
 
Setup Oracle EBS R12 Performance Management
Setup Oracle EBS R12 Performance ManagementSetup Oracle EBS R12 Performance Management
Setup Oracle EBS R12 Performance Management
 
METal International - Hacking Steve Jobs
METal International - Hacking Steve JobsMETal International - Hacking Steve Jobs
METal International - Hacking Steve Jobs
 
Laboratorium Inovasi Menuju Pelayanan Prima
Laboratorium Inovasi Menuju Pelayanan PrimaLaboratorium Inovasi Menuju Pelayanan Prima
Laboratorium Inovasi Menuju Pelayanan Prima
 

More from Takumi Yamashita (20)

Deposited Ranges
Deposited RangesDeposited Ranges
Deposited Ranges
 
RUPC2017:F解説
RUPC2017:F解説RUPC2017:F解説
RUPC2017:F解説
 
RUPC2017:L解説
RUPC2017:L解説RUPC2017:L解説
RUPC2017:L解説
 
RUPC2017:J解説
RUPC2017:J解説RUPC2017:J解説
RUPC2017:J解説
 
RUPC2017:G解説
RUPC2017:G解説RUPC2017:G解説
RUPC2017:G解説
 
RUPC2017:Dの解説
RUPC2017:Dの解説RUPC2017:Dの解説
RUPC2017:Dの解説
 
RUPC2017:Bの解説
RUPC2017:Bの解説RUPC2017:Bの解説
RUPC2017:Bの解説
 
RUPC2017:Cの解説
RUPC2017:Cの解説RUPC2017:Cの解説
RUPC2017:Cの解説
 
RUPC2017:I解説
RUPC2017:I解説RUPC2017:I解説
RUPC2017:I解説
 
RUPC2017:全体の講評
RUPC2017:全体の講評RUPC2017:全体の講評
RUPC2017:全体の講評
 
RUPC2017:Aの解説
RUPC2017:Aの解説RUPC2017:Aの解説
RUPC2017:Aの解説
 
RUPC2017:Hの解説
RUPC2017:Hの解説RUPC2017:Hの解説
RUPC2017:Hの解説
 
RUPC2017:K解説
RUPC2017:K解説RUPC2017:K解説
RUPC2017:K解説
 
RUPC2017:E解説
RUPC2017:E解説RUPC2017:E解説
RUPC2017:E解説
 
RUPC2017:M問題
RUPC2017:M問題RUPC2017:M問題
RUPC2017:M問題
 
0: 全体の講評
0: 全体の講評0: 全体の講評
0: 全体の講評
 
M : 解説
M : 解説M : 解説
M : 解説
 
L : 解説
L : 解説L : 解説
L : 解説
 
K : 解説
K : 解説K : 解説
K : 解説
 
I : Traffic Tree
I : Traffic TreeI : Traffic Tree
I : Traffic Tree
 

Recently uploaded

リアル戦国探究in米沢 事前講座2スライド(スタッフ共有用)『両雄の強さの秘密』についてのスライド
リアル戦国探究in米沢 事前講座2スライド(スタッフ共有用)『両雄の強さの秘密』についてのスライドリアル戦国探究in米沢 事前講座2スライド(スタッフ共有用)『両雄の強さの秘密』についてのスライド
リアル戦国探究in米沢 事前講座2スライド(スタッフ共有用)『両雄の強さの秘密』についてのスライドKen Fukui
 
リアル戦国探究in米沢 当日講座3スライド(スタッフ共有用)『糧は三度はさいせず』についてのスライド
リアル戦国探究in米沢 当日講座3スライド(スタッフ共有用)『糧は三度はさいせず』についてのスライドリアル戦国探究in米沢 当日講座3スライド(スタッフ共有用)『糧は三度はさいせず』についてのスライド
リアル戦国探究in米沢 当日講座3スライド(スタッフ共有用)『糧は三度はさいせず』についてのスライドKen Fukui
 
ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学
ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学
ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学ssusere0a682
 
リアル戦国探究in米沢 当日講座2スライド(スタッフ共有用)『人を致すも人に致されず』についてのスライド
リアル戦国探究in米沢 当日講座2スライド(スタッフ共有用)『人を致すも人に致されず』についてのスライドリアル戦国探究in米沢 当日講座2スライド(スタッフ共有用)『人を致すも人に致されず』についてのスライド
リアル戦国探究in米沢 当日講座2スライド(スタッフ共有用)『人を致すも人に致されず』についてのスライドKen Fukui
 
リアル戦国探究in米沢 当日講座1(スタッフ共有用)『兵は詐をもって立つ』についてのスライド
リアル戦国探究in米沢 当日講座1(スタッフ共有用)『兵は詐をもって立つ』についてのスライドリアル戦国探究in米沢 当日講座1(スタッフ共有用)『兵は詐をもって立つ』についてのスライド
リアル戦国探究in米沢 当日講座1(スタッフ共有用)『兵は詐をもって立つ』についてのスライドKen Fukui
 
リアル戦国探究in米沢 事前講座1スライド(スタッフ共有用)『川中島の謎』についてのスライド
リアル戦国探究in米沢 事前講座1スライド(スタッフ共有用)『川中島の謎』についてのスライドリアル戦国探究in米沢 事前講座1スライド(スタッフ共有用)『川中島の謎』についてのスライド
リアル戦国探究in米沢 事前講座1スライド(スタッフ共有用)『川中島の謎』についてのスライドKen Fukui
 
UniProject Workshop Make a Discord Bot with JavaScript
UniProject Workshop Make a Discord Bot with JavaScriptUniProject Workshop Make a Discord Bot with JavaScript
UniProject Workshop Make a Discord Bot with JavaScriptyuitoakatsukijp
 
TEAMIN Service overview for customer_20240422.pdf
TEAMIN Service overview for customer_20240422.pdfTEAMIN Service overview for customer_20240422.pdf
TEAMIN Service overview for customer_20240422.pdfyukisuga3
 

Recently uploaded (8)

リアル戦国探究in米沢 事前講座2スライド(スタッフ共有用)『両雄の強さの秘密』についてのスライド
リアル戦国探究in米沢 事前講座2スライド(スタッフ共有用)『両雄の強さの秘密』についてのスライドリアル戦国探究in米沢 事前講座2スライド(スタッフ共有用)『両雄の強さの秘密』についてのスライド
リアル戦国探究in米沢 事前講座2スライド(スタッフ共有用)『両雄の強さの秘密』についてのスライド
 
リアル戦国探究in米沢 当日講座3スライド(スタッフ共有用)『糧は三度はさいせず』についてのスライド
リアル戦国探究in米沢 当日講座3スライド(スタッフ共有用)『糧は三度はさいせず』についてのスライドリアル戦国探究in米沢 当日講座3スライド(スタッフ共有用)『糧は三度はさいせず』についてのスライド
リアル戦国探究in米沢 当日講座3スライド(スタッフ共有用)『糧は三度はさいせず』についてのスライド
 
ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学
ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学
ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学
 
リアル戦国探究in米沢 当日講座2スライド(スタッフ共有用)『人を致すも人に致されず』についてのスライド
リアル戦国探究in米沢 当日講座2スライド(スタッフ共有用)『人を致すも人に致されず』についてのスライドリアル戦国探究in米沢 当日講座2スライド(スタッフ共有用)『人を致すも人に致されず』についてのスライド
リアル戦国探究in米沢 当日講座2スライド(スタッフ共有用)『人を致すも人に致されず』についてのスライド
 
リアル戦国探究in米沢 当日講座1(スタッフ共有用)『兵は詐をもって立つ』についてのスライド
リアル戦国探究in米沢 当日講座1(スタッフ共有用)『兵は詐をもって立つ』についてのスライドリアル戦国探究in米沢 当日講座1(スタッフ共有用)『兵は詐をもって立つ』についてのスライド
リアル戦国探究in米沢 当日講座1(スタッフ共有用)『兵は詐をもって立つ』についてのスライド
 
リアル戦国探究in米沢 事前講座1スライド(スタッフ共有用)『川中島の謎』についてのスライド
リアル戦国探究in米沢 事前講座1スライド(スタッフ共有用)『川中島の謎』についてのスライドリアル戦国探究in米沢 事前講座1スライド(スタッフ共有用)『川中島の謎』についてのスライド
リアル戦国探究in米沢 事前講座1スライド(スタッフ共有用)『川中島の謎』についてのスライド
 
UniProject Workshop Make a Discord Bot with JavaScript
UniProject Workshop Make a Discord Bot with JavaScriptUniProject Workshop Make a Discord Bot with JavaScript
UniProject Workshop Make a Discord Bot with JavaScript
 
TEAMIN Service overview for customer_20240422.pdf
TEAMIN Service overview for customer_20240422.pdfTEAMIN Service overview for customer_20240422.pdf
TEAMIN Service overview for customer_20240422.pdf
 

H : hegemony get