提交时间:2025-03-23 14:38:59

运行 ID: 8020

#include <bits/stdc++.h> using namespace std; int main(){ int v1,v2,t,s,l; cin>>v1>>v2>>t>>s>>l; int lcr = 0,lct = 0,tr = 0,tt = 0; while (lcr < l && lct < l){ if (lcr - lct >= t){ tt += s; lcr = tr * v1; lct = tt * v2; } else{ tt++; tr++; lcr = tr * v1; lct = tt * v2; } } if (lcr == lct) { cout<<"D"<<endl<<tt<<endl; } else if (lcr > lct){ cout<<"R"<<endl<<tt<<endl; } else if (lcr < lct){ cout<<"T"<<endl<<l / v2<<endl; } return 0; }