2 条题解

  • 1
    @ 2024-2-17 17:25:35
    #include<bits/stdc++.h>
    using namespace std;
    long long x,y;
    int main(){
    	cin>>x>>y;
        long long t=x*9;
        cout<<min(x,max(y,t)-t)<<" "<<min(y/10,x)<<endl;
    	return 0;
    }
    
    • 0
      @ 2025-2-12 15:13:23

      Sol

      对于第一问,考虑抽屉原理。

      对于第二问,考虑贪心。

      Code

      #include <bits/stdc++.h>
      using namespace std;
      int main()
      {
          int x, y;
          cin >> x >> y;
          cout << max(0LL, y - 9LL * x)
               << ' ' << y / 10 << endl;
          return 0;
      }
      
      • 1

      信息

      ID
      712
      时间
      1500ms
      内存
      256MiB
      难度
      1
      标签
      递交数
      336
      已通过
      67
      上传者