标签:
歌曲下载速度ds = (q-1)/q
歌曲播放速度ps = 1
则当前已下载好s秒的情况下,歌曲播放进度追上下载进度是歌曲播放到的位置pp = s / (ps - ds) = s * (1 - (q-1)/q) = s*q;
code:
#include <iostream> #include <cstdio> #include <cstring> using namespace std; int main() { int T,startPlayTime,q; int downSpeed; int playSpeed = 1; int dx; while(cin >> T >> startPlayTime >> q){ int cnt = 0; dx = startPlayTime ; while(dx < T){ dx = dx * q; cnt ++; } cout << cnt << endl; } return 0; }
标签:
原文地址:http://www.cnblogs.com/zhangjialu2015/p/Codeforces.html