社区讨论

为啥本地跑飞快,交上去就T捏

P1001A+B Problem参与者 15已保存回复 25

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
25 条
当前快照
1 份
快照标识符
@lv7u634f
此快照首次捕获于
2024/04/20 16:27
2 年前
此快照最后确认于
2024/04/27 00:56
2 年前
查看原帖
CPP
#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;
本地:
CPP
3
--------------------------------
Process exited after 0.1829 seconds with return value 0
请按任意键继续. . .

回复

25 条回复,欢迎继续交流。

正在加载回复...