fork download
  1. #include<iostream>
  2. #include<string>
  3. #include<bits/stdc++.h>
  4. #define ll long long
  5. //#define p(n,os) pow(n,os)
  6. #define dd long double
  7. #define des(x1,y1,x2,y2) sqrt(pow(x1-x2,2)+pow(y1-y2,2))
  8. #define nl '\n'
  9. #define Mabrouk ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)
  10. using namespace std;
  11. void Mabrouk_Ata()
  12. {
  13. #ifndef ONLINE_JUDGE
  14. freopen("input.txt","r",stdin),freopen("output.txt","w",stdout);
  15. #endif
  16. }
  17. void test_case()
  18. {
  19.  
  20. string s1,s2,s3;
  21. getline(cin,s1);
  22. getline(cin,s2);
  23. dd x1,y1,z1,x2,y2,z2;
  24. for(int i=0;i<s1.size();i++)
  25. {
  26. if(i==7)
  27. z1=s1[i]-48;
  28. if(i==25)
  29. {
  30. while(s1[i]!=' ')
  31. {
  32. s3+=s1[i];
  33. i++;
  34. }
  35. //cout<<s3<<nl;
  36. stringstream c;
  37. c<<s3;
  38. c>>x1;
  39. s3.clear();
  40. }
  41. if(s1[i]<97&&i>25)
  42. {
  43. while(s1[i]!=' ')
  44. {
  45. s3+=s1[i];
  46. i++;
  47. }
  48. //cout<<s3<<nl;
  49. stringstream d;
  50. d<<s3;
  51. d>>y1;
  52. s3.clear();
  53. }
  54. }
  55. for(int i=0;i<s2.size();i++)
  56. {
  57. if(i==7)
  58. z2=s2[i]-48;
  59. if(i==25)
  60. {
  61. while(s2[i]!=' ')
  62. {
  63. s3+=s2[i];
  64. i++;
  65. }
  66. //cout<<s3<<nl;
  67. stringstream f;
  68. f<<s3;
  69. f>>x2;
  70. s3.clear();
  71. }
  72. if(s2[i]<97)
  73. {
  74. while(s2[i]!=' ')
  75. {
  76. s3+=s2[i];
  77. i++;
  78. }
  79. //cout<<s3<<nl;
  80. stringstream g;
  81. g<<s3;
  82. g>>y2;
  83. s3.clear();
  84. }
  85. }
  86. //cout<<z1<<" "<<x1<<" "<<y1<<nl;
  87. //cout<<z2<<" "<<x2<<" "<<y2<<nl;
  88. if((x1/(400-y1))>(x2/(400-y2)))
  89. {
  90. cout<<"Runner "<<z1<<" wins";
  91. }
  92. else
  93. {
  94. cout<<"Runner "<<z2<<" wins";
  95. }
  96. }
  97. int main()
  98. {
  99. //Mabrouk_Ata();
  100. Mabrouk;
  101. //cout<<fixed<<setprecision(0);
  102. ll t=1;
  103. //cin>>t;
  104. for(int i=1;i<=t;i++)
  105. {
  106. test_case();
  107. //cout<<nl;
  108. }
  109. return 0;
  110. }
  111. //runner 1 is traveling at 10.5 meters per second and has already covered 100.0 meters
Success #stdin #stdout 0.01s 5312KB
stdin
Standard input is empty
stdout
Runner 0 wins