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

The_Five_Books_Overview_Presentation_2024
The_Five_Books_Overview_Presentation_2024The_Five_Books_Overview_Presentation_2024
The_Five_Books_Overview_Presentation_2024koheioishi1
 
TokyoTechGraduateExaminationPresentation
TokyoTechGraduateExaminationPresentationTokyoTechGraduateExaminationPresentation
TokyoTechGraduateExaminationPresentationYukiTerazawa
 
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
 
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
 
ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学
ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学
ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学ssusere0a682
 
東京工業大学 環境・社会理工学院 建築学系 大学院入学入試・進学説明会2024_v2
東京工業大学 環境・社会理工学院 建築学系 大学院入学入試・進学説明会2024_v2東京工業大学 環境・社会理工学院 建築学系 大学院入学入試・進学説明会2024_v2
東京工業大学 環境・社会理工学院 建築学系 大学院入学入試・進学説明会2024_v2Tokyo Institute of Technology
 

Recently uploaded (6)

The_Five_Books_Overview_Presentation_2024
The_Five_Books_Overview_Presentation_2024The_Five_Books_Overview_Presentation_2024
The_Five_Books_Overview_Presentation_2024
 
TokyoTechGraduateExaminationPresentation
TokyoTechGraduateExaminationPresentationTokyoTechGraduateExaminationPresentation
TokyoTechGraduateExaminationPresentation
 
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
 
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
 
ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学
ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学
ゲーム理論 BASIC 演習105 -n人囚人のジレンマモデル- #ゲーム理論 #gametheory #数学
 
東京工業大学 環境・社会理工学院 建築学系 大学院入学入試・進学説明会2024_v2
東京工業大学 環境・社会理工学院 建築学系 大学院入学入試・進学説明会2024_v2東京工業大学 環境・社会理工学院 建築学系 大学院入学入試・進学説明会2024_v2
東京工業大学 環境・社会理工学院 建築学系 大学院入学入試・進学説明会2024_v2
 

B potatoes