HBC24818奇异图,图论,过关题目[USACO 2009 Jan B]Music Notes题解

素流年 算法基础篇 45 0
想要检验自己的编程水平?来试试全网最全C++题库,让您在挑战中不断进步。
FJ is going to teach his cows how to play a song. The song consists of N (1

FJ is going to teach his cows how to play a song. The song consists of N (1 <= N <= 100) notes, and the i-th note lasts for B_i B i ​ (1 <= B_i B i ​ <= 100) beats. The cows will begin playing the song at time 0; thus, they will play note 1 from time 0 to time B_1 B 1 ​ - 1, note 2 fromtime B_1 B 1 ​ to time B_1 B 1 ​ + B_2 B 2 ​ - 1, etc. The cows have lost interest in the song, as they feel that it is long and boring. Thus, to make sure his cows are paying attention, FJ asks them Q (1 <= Q <= 1,000) questions of the form, "During the beat at time T_i T i ​ (0 <= T_i T i ​ < length of song), which note should you be playing?" The cows need your help to answer these questions. By way of example, consider a song with these specifications: note 1 for length 2, note 2 for length 1, and note 3 for length 3: NOTES 1 1 2 3 3 3 +---+---+---+---+---+---+ TIME 0 1 2 3 4 5

HBC24818奇异图,图论,过关题目[USACO 2009 Jan B]Music Notes题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
成为编程大师,不再是梦想!全网最全C++题库,助您开启编程新篇章。

标签: HBC24818奇异图 图论 过关题目[USACO 2009 Jan B]Music Notes题解