SlideShare a Scribd company logo
1 of 5
Download to read offline
B: Potatoes
原案: OKA
解説: kawabys
問題概要
● N面の畑があり、各畑にはそれぞれ1からNまでの番号が付けられている。
● M個の芋を持っている。
● 芋を畑iに植えた場合、1年後には畑iに植えた芋1つにつきai
個の芋を収穫できる。
ただし、畑iには最大でもbi
個の芋しか植えることができない。
● K面までの畑しか管理することができない。
● 1年後に所有することができる芋の数の最大値を求める。
解法
● N面の畑からK面選び、選んだ畑からai
が高い順に植えられるだけ芋を植える。一
個の芋を使ってたくさん芋が増えたほうがいい。
O(N^K) (1<=N<=15 , 1<=K<=3 なので大丈夫)
for文の3重ループを書くことができれば実装できる。
結果
● Online
○ First Submission: anta(7 min)
○ First AC: anta(7 min)
● Onsite
○ First Submission: soujirou(20 min)
○ First AC: soujirou(20 min)
ジャッジ解
haji c++ 37行
kawabys c++ 19行
arrows c++ 37行
moti c++ 48行
uku c++ 41行
kzyKT c++ 25行
sate c++ 45行

More Related Content

Viewers also liked

Greenworks by Clorox
Greenworks by CloroxGreenworks by Clorox
Greenworks by Cloroxstellajspark
 
An introduction to payroll administration
An introduction to payroll administrationAn introduction to payroll administration
An introduction to payroll administrationNitin Maheshwari
 
Oracle HCM Email notification
Oracle HCM Email notificationOracle HCM Email notification
Oracle HCM Email notificationFeras Ahmad
 
Topology optimization to guide the architecture of a BIW structure, challenge...
Topology optimization to guide the architecture of a BIW structure, challenge...Topology optimization to guide the architecture of a BIW structure, challenge...
Topology optimization to guide the architecture of a BIW structure, challenge...Altair
 
Condition monitoring in thermal power plant
Condition monitoring in thermal power plantCondition monitoring in thermal power plant
Condition monitoring in thermal power plantSHIVAJI CHOUDHURY
 
DFMEA: Reduce Design Errors, Time and Cost
DFMEA: Reduce Design Errors, Time and CostDFMEA: Reduce Design Errors, Time and Cost
DFMEA: Reduce Design Errors, Time and CostRicardo Gonzalez Luna
 
Fundamentals of Power System protection by Y.G.Paithankar and S.R.Bhide
Fundamentals of Power System protection by Y.G.Paithankar and S.R.BhideFundamentals of Power System protection by Y.G.Paithankar and S.R.Bhide
Fundamentals of Power System protection by Y.G.Paithankar and S.R.BhideSourabh Ghosh
 
Testing & Improving Performance in IBM Cognos BI, Plus Automated Cognos Testi...
Testing & Improving Performance in IBM Cognos BI, Plus Automated Cognos Testi...Testing & Improving Performance in IBM Cognos BI, Plus Automated Cognos Testi...
Testing & Improving Performance in IBM Cognos BI, Plus Automated Cognos Testi...Senturus
 
Ipsos MORI Political Monitor: August 2016
Ipsos MORI Political Monitor: August 2016Ipsos MORI Political Monitor: August 2016
Ipsos MORI Political Monitor: August 2016Ipsos UK
 
Dielectric Spectroscopy in Time and Frequency Domain
Dielectric Spectroscopy in Time and Frequency DomainDielectric Spectroscopy in Time and Frequency Domain
Dielectric Spectroscopy in Time and Frequency DomainGirish Gupta
 
Ethical Dilemmas in Business
Ethical Dilemmas in BusinessEthical Dilemmas in Business
Ethical Dilemmas in BusinessShahzad Khan
 

Viewers also liked (14)

Transformer Design
Transformer DesignTransformer Design
Transformer Design
 
Greenworks by Clorox
Greenworks by CloroxGreenworks by Clorox
Greenworks by Clorox
 
An introduction to payroll administration
An introduction to payroll administrationAn introduction to payroll administration
An introduction to payroll administration
 
Allocacoc - European PoP up franchise plan
Allocacoc - European PoP up franchise planAllocacoc - European PoP up franchise plan
Allocacoc - European PoP up franchise plan
 
Oracle HCM Email notification
Oracle HCM Email notificationOracle HCM Email notification
Oracle HCM Email notification
 
AKS
AKSAKS
AKS
 
Topology optimization to guide the architecture of a BIW structure, challenge...
Topology optimization to guide the architecture of a BIW structure, challenge...Topology optimization to guide the architecture of a BIW structure, challenge...
Topology optimization to guide the architecture of a BIW structure, challenge...
 
Condition monitoring in thermal power plant
Condition monitoring in thermal power plantCondition monitoring in thermal power plant
Condition monitoring in thermal power plant
 
DFMEA: Reduce Design Errors, Time and Cost
DFMEA: Reduce Design Errors, Time and CostDFMEA: Reduce Design Errors, Time and Cost
DFMEA: Reduce Design Errors, Time and Cost
 
Fundamentals of Power System protection by Y.G.Paithankar and S.R.Bhide
Fundamentals of Power System protection by Y.G.Paithankar and S.R.BhideFundamentals of Power System protection by Y.G.Paithankar and S.R.Bhide
Fundamentals of Power System protection by Y.G.Paithankar and S.R.Bhide
 
Testing & Improving Performance in IBM Cognos BI, Plus Automated Cognos Testi...
Testing & Improving Performance in IBM Cognos BI, Plus Automated Cognos Testi...Testing & Improving Performance in IBM Cognos BI, Plus Automated Cognos Testi...
Testing & Improving Performance in IBM Cognos BI, Plus Automated Cognos Testi...
 
Ipsos MORI Political Monitor: August 2016
Ipsos MORI Political Monitor: August 2016Ipsos MORI Political Monitor: August 2016
Ipsos MORI Political Monitor: August 2016
 
Dielectric Spectroscopy in Time and Frequency Domain
Dielectric Spectroscopy in Time and Frequency DomainDielectric Spectroscopy in Time and Frequency Domain
Dielectric Spectroscopy in Time and Frequency Domain
 
Ethical Dilemmas in Business
Ethical Dilemmas in BusinessEthical Dilemmas in Business
Ethical Dilemmas in Business
 

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米沢 事前講座2スライド(スタッフ共有用)『両雄の強さの秘密』についてのスライド
リアル戦国探究in米沢 事前講座2スライド(スタッフ共有用)『両雄の強さの秘密』についてのスライドリアル戦国探究in米沢 事前講座2スライド(スタッフ共有用)『両雄の強さの秘密』についてのスライド
リアル戦国探究in米沢 事前講座2スライド(スタッフ共有用)『両雄の強さの秘密』についてのスライドKen Fukui
 
リアル戦国探究in米沢 事前講座1スライド(スタッフ共有用)『川中島の謎』についてのスライド
リアル戦国探究in米沢 事前講座1スライド(スタッフ共有用)『川中島の謎』についてのスライドリアル戦国探究in米沢 事前講座1スライド(スタッフ共有用)『川中島の謎』についてのスライド
リアル戦国探究in米沢 事前講座1スライド(スタッフ共有用)『川中島の謎』についてのスライドKen Fukui
 
【ゲーム理論入門】ChatGPTが作成した ゲーム理論の問題を解く #3 Slide
【ゲーム理論入門】ChatGPTが作成した ゲーム理論の問題を解く #3 Slide【ゲーム理論入門】ChatGPTが作成した ゲーム理論の問題を解く #3 Slide
【ゲーム理論入門】ChatGPTが作成した ゲーム理論の問題を解く #3 Slidessusere0a682
 
リアル戦国探究in米沢 当日講座1(スタッフ共有用)『兵は詐をもって立つ』についてのスライド
リアル戦国探究in米沢 当日講座1(スタッフ共有用)『兵は詐をもって立つ』についてのスライドリアル戦国探究in米沢 当日講座1(スタッフ共有用)『兵は詐をもって立つ』についてのスライド
リアル戦国探究in米沢 当日講座1(スタッフ共有用)『兵は詐をもって立つ』についてのスライドKen Fukui
 
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
 
リアル戦国探究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
 

Recently uploaded (8)

リアル戦国探究in米沢 当日講座2スライド(スタッフ共有用)『人を致すも人に致されず』についてのスライド
リアル戦国探究in米沢 当日講座2スライド(スタッフ共有用)『人を致すも人に致されず』についてのスライドリアル戦国探究in米沢 当日講座2スライド(スタッフ共有用)『人を致すも人に致されず』についてのスライド
リアル戦国探究in米沢 当日講座2スライド(スタッフ共有用)『人を致すも人に致されず』についてのスライド
 
リアル戦国探究in米沢 事前講座2スライド(スタッフ共有用)『両雄の強さの秘密』についてのスライド
リアル戦国探究in米沢 事前講座2スライド(スタッフ共有用)『両雄の強さの秘密』についてのスライドリアル戦国探究in米沢 事前講座2スライド(スタッフ共有用)『両雄の強さの秘密』についてのスライド
リアル戦国探究in米沢 事前講座2スライド(スタッフ共有用)『両雄の強さの秘密』についてのスライド
 
リアル戦国探究in米沢 事前講座1スライド(スタッフ共有用)『川中島の謎』についてのスライド
リアル戦国探究in米沢 事前講座1スライド(スタッフ共有用)『川中島の謎』についてのスライドリアル戦国探究in米沢 事前講座1スライド(スタッフ共有用)『川中島の謎』についてのスライド
リアル戦国探究in米沢 事前講座1スライド(スタッフ共有用)『川中島の謎』についてのスライド
 
【ゲーム理論入門】ChatGPTが作成した ゲーム理論の問題を解く #3 Slide
【ゲーム理論入門】ChatGPTが作成した ゲーム理論の問題を解く #3 Slide【ゲーム理論入門】ChatGPTが作成した ゲーム理論の問題を解く #3 Slide
【ゲーム理論入門】ChatGPTが作成した ゲーム理論の問題を解く #3 Slide
 
リアル戦国探究in米沢 当日講座1(スタッフ共有用)『兵は詐をもって立つ』についてのスライド
リアル戦国探究in米沢 当日講座1(スタッフ共有用)『兵は詐をもって立つ』についてのスライドリアル戦国探究in米沢 当日講座1(スタッフ共有用)『兵は詐をもって立つ』についてのスライド
リアル戦国探究in米沢 当日講座1(スタッフ共有用)『兵は詐をもって立つ』についてのスライド
 
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
 
リアル戦国探究in米沢 当日講座3スライド(スタッフ共有用)『糧は三度はさいせず』についてのスライド
リアル戦国探究in米沢 当日講座3スライド(スタッフ共有用)『糧は三度はさいせず』についてのスライドリアル戦国探究in米沢 当日講座3スライド(スタッフ共有用)『糧は三度はさいせず』についてのスライド
リアル戦国探究in米沢 当日講座3スライド(スタッフ共有用)『糧は三度はさいせず』についてのスライド
 
ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学
ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学
ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学
 

B potatoes