4 条题解

  • 0
    @ 2024-12-28 22:37:03
    #include<iostream>
    using namespace std;
    signed main(){
    	int a,b;
    	cin>>a>>b;
    	if(a*10<b*18)cout<<"YES";
    	else cout<<"NO\n"<<a*10-b*18;
    }
    
    • 0
      @ 2024-12-28 16:05:19

      水题。计算判断即可 AC。

      #include<bits/stdc++.h>
      #define int long long
      #define INF 0x3f3f3f
      using namespace std;
      int x,y;
      signed main(){
      	cin>>x>>y;
      	if(x*10>y*18)cout<<"NO\n"<<x*10-y*18;
      	else cout<<"YES";
      	return 0;
      }
      
      • 0
        @ 2024-12-28 11:39:35

        秒杀。

        #include<bits/stdc++.h>
        using namespace std;
        int main()
        {
        	int a,b;
        	cin>>a>>b;
        	if(b*18>=a*10)
        	{
        		cout<<"YES";
        	}
        	else
        	{
        		cout<<"NO"<<endl<<a*10-b*18;
        	}
        	return 0;
        }
        
      • 0
        @ 2024-12-22 11:03:54

        C++ :

        #include<bits/stdc++.h>
        using namespace std;
        int main(){
        	int n,m;
        	cin>>n>>m;
        	if(n*10<=m*18) cout<<"YES";
        	else cout<<"NO\n"<<n*10-m*18;
        	return 0;
        }
        

        Python :

        # coding=utf-8
        a=input().split()
        x=int(a[0])
        y=int(a[1])
        if (x*10)<=(y*18) :
            print('YES')
        else :
            print('NO')
            print((x*10)-(y*18))
        
        • 1

        信息

        ID
        32
        时间
        1000ms
        内存
        128MiB
        难度
        4
        标签
        (无)
        递交数
        37
        已通过
        20
        上传者