2 条题解

  • 3
    @ 2025-2-3 12:11:46
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int n;
    	double t,e,x,y;
    	cin>>n;
    	cin>>t>>e;
    	x=e/t;
    	for(int i=1;i<n;i++)
    	{
    	 cin>>t>>e;
    	 y=e/t;
    	 if(x-y>0.05) cout<<"worse"<<endl;
    	 else if(y-x>0.05) cout<<"better"<<endl;
    	 else cout<<"same"<<endl; 
    	}
    	return 0;
    }
    
    • 1
      @ 2025-1-20 10:12:09

      #include <bits/stdc++.h>

      using namespace std;

      int main(){

      int n;
      
      cin>>n;
      
      int a[n],b[n];
      
      for(int i=0;i<n;i++){
      
      	cin>>a[i]>>b[i];
      
      }
      
      double x=b[0]/(a[0]\*1.0);
      
      for(int i=1;i<n;i++){
      
      	double y=b[i]/(a[i]/1.0);
      
      	if((y-x)>(0.05+0.0000000001)) cout<<"better"<<endl;
      
      	else if((x-y)>(0.05+0.0000000001)) cout<<"worse"<<endl;
      
      	else cout<<"same"<<endl;
      
      }
      
      return 0;
      

      }

      • 1

      信息

      ID
      63
      时间
      1000ms
      内存
      128MiB
      难度
      5
      标签
      (无)
      递交数
      104
      已通过
      40
      上传者