Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
8019 admin 龟兔赛跑预测 C++ 解答错误 0 1 MS 256 KB 516 2025-03-23 14:38:20

Tests(0/10):


#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; }


测评信息: