让我们说我们有一堆收音机,每个收音机一遍又一遍地播放同一首歌.是否可以同步所有收音机中的所有歌曲?我们能找到一个从一开始就听到所有歌曲的时间吗?
为简单起见,我们会说我们只有两个无线电.
我有以下公式:
c和z表示以秒为单位的歌曲长度.a和x表示歌曲中的当前位置(以秒为单位)S表示C和Z同步的时间.(当两首歌同时开始时)
例如 :
Song 1
a = 17 : the time before the song ends.
b = 8 : the rest of the song.
c = a + b which is the full song in seconds.
And
Song 2
x = 8 : the time before the song ends.
y = 9 : the rest of the song.
z = 8 + 9 which is the full song in seconds.
Song 1 : a + ( a …Run Code Online (Sandbox Code Playgroud)