2 条题解

  • 0
    @ 2024-12-14 22:35:43

    因为看错题忘了每次还要藏一份导致一直0,比较崩溃( 反应过来已经晚了 重新敲一遍只花了五六分钟(再也不敢眼瞎了

    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n,m,t,p,ans;
    	cin>>n>>m;
    	for(int i=n+m;;i+=n)
    	{
    		t=i;
    		for(int j=1;j<=n;j++)
    		{
    			t=t-t/n-m;
    			if(t%n==m)
    			{
    				p=0;
    			}
    			else if(t%n!=m)
    			{
    				p=1;
    				break;
    			}
    		}
    		if(p==0)
    		{
    			ans=i;
    			break;
    		}
    	}
    	cout<<ans;
    	return 0;
    }
    

    信息

    ID
    799
    时间
    1000ms
    内存
    256MiB
    难度
    9
    标签
    (无)
    递交数
    24
    已通过
    4
    上传者