提交时间:2025-03-23 14:37:26

运行 ID: 8018

#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<<tt<<endl; } return 0; }