为啥本地跑飞快,交上去就T捏
查看原帖
为啥本地跑飞快,交上去就T捏
989997
DGL__DGL_AFO楼主2024/4/20 16:26
#include<bits/stdc++.h>
#include<bits/stdc++.h>
using namespace std;
int a,b;
int res;
int ans;
int main()
{
	cin>>a>>b;
	//a=1;b=2;
	srand(time(0));
	while(res<=100000000)
	{
		res++;
		ans=rand();
		if(ans-a==b)
		{
			cout<<ans;
			return 0;
		}
	}
	
	
	return 0;
}

a=1,b=2;

本地:

3
--------------------------------
Process exited after 0.1829 seconds with return value 0
请按任意键继续. . .

洛谷

2024/4/20 16:26
加载中...