2 solutions

  • 2
    @ 2024-1-27 9:13:29
    #include<bits/stdc++.h>
    using namespace std;
    double n;
    double t1,t2;
    int main(){
    	cin>>n;
    	t1=n/1.2;
    	t2=n/3+27+23;
    	if(t1<t2) cout<<"Walk"<<endl;
    	else if(t1>t2) cout<<"Bike"<<endl;
    	else cout<<"All"<<endl;
    	return 0;
    }
    

    Water

    • 2
      @ 2023-9-17 10:49:16
      #include <iostream>
      #define int double
      using namespace std;
      int n;
      signed main(){
      	cin>>n;
      	int ans1=n/3.0+50;  //bike
      	int ans2=n/1.2;  //walk
      	if(ans1<ans2) cout<<"Bike"<<endl;
      	else if(ans1>ans2) cout<<"Walk"<<endl;
      	else cout<<"All"<<endl;
      	return 0;
      }
      
      • 1

      Information

      ID
      537
      Time
      1000ms
      Memory
      256MiB
      Difficulty
      2
      Tags
      # Submissions
      58
      Accepted
      38
      Uploaded By