Orange Boy Can You Solve It Out? Ep.19.5
野兽成分更多的思考题
广西省人大音乐II
Electric Heritage
Haniyasushin Keiki loves crafting. She has n kinds of items. The i-th kind of item has name name_i. She also has m recipes. The i-th recipe needs len_i of different kinds of different items as input. The j-th item is {input_i}_j and needs {x_i}_j of them. Then the recipe will produce output_i of number y_i.
Note that the recipe is not bidirectional.
Kitcho Yachie now has k kinds of items. The i-th kind of item is has_i and has amount_i of it. She now wonders what is the maximum number of a certain kind of item dest she can make? You need to print the solution.
Example
Recipes:
1 log -> 4 plank
2 plank -> 4 stick
3 plank + 2 stick -> 1 pickaxe
Have:
1 log
4 plank
Dest:
pickaxe
Output:
2
1 log -> 4 plank
2 plank -> 4 stick
3 plank + 2 stick -> 1 pickaxe
3 plank + 2 stick -> 1 pickaxe
Constriants
Subtask 1(49%): len_i=y_i=1 always holds
Subtask 2(49%): ${x_i}j=1always holds
Subtask 3(1%):n,m\leq10For all data:\sum{j=1}^{len_i}{x_i}_j\leq9,y_i\leq9holds for each i,n\leq10^5,m\leq10^5$
把钱汇组长就是她!
版权声明:
作者:XGN
链接:https://blog.hellholestudios.top/archives/259
来源:Hell Hole Studios Blog
文章版权归作者所有,未经允许请勿转载。
共有 0 条评论