1 条题解

  • 1
    @ 2025-6-8 17:24:11
    #include <iostream>
    using namespace std;
    int ans;
    int f(int x,int y)
    {
    	if(x==0 or y==0)return ans;
    	if(x<=y)
    	{
    		ans++;
    		return f(x,y-x);	
    	}
    	if(x>y)
    	{
    		ans++;
    		return f(x-y,y);
    	}
    }
    int main()
    {
    	int a,b;
    	cin >> a >> b;
    	cout << f(a,b);
    	return 0;
     } 
    

    一个90分的代码 2025.6.8

    • @ 2025-6-8 17:24:44

      不信的可以自己测一下

信息

ID
1813
时间
1000ms
内存
256MiB
难度
10
标签
递交数
2
已通过
1
上传者