请用以下代码 AC A+B Problem
查看原帖
请用以下代码 AC A+B Problem
1249322
Elaina_0楼主2024/6/15 21:41

RT 别骂了

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rand(a,b) (1ll*rand()*rand()*rand()*rand()%((b)-(a)+1)+(a))
#define rd read()
inline int read(){
    int x=0,f=1;
    char ch=getchar();
    for(;!isdigit(ch);ch=getchar()) if(ch=='-') f=-1;
    for(;isdigit(ch);ch=getchar()) x=x*10+ch-'0';
    return x*f;
}
template<typename type>
inline void write(type x,bool mode=1){
    x<0?x=-x,putchar('-'):0;static short Stack[50],top(0);
    do Stack[++top]=x%10,x/=10; while(x);
    while(top) putchar(Stack[top--]|48);
    mode?putchar('\n'):putchar(' ');
}


int p=1000000000;


signed main(){
	srand(time(0));
	int a=rd,b=rd;
	int x=a+b,y;
	while(y!=x){
		y=rand(-p,p);
		cout<<y<<endl;
	}
	write(y);
	return 0;
}
2024/6/15 21:41
加载中...