请尝试用以下代码AC A+B Problem
  • 板块P1001 A+B Problem
  • 楼主Elaina_0
  • 当前回复10
  • 已保存回复11
  • 发布时间2024/6/14 15:12
  • 上次更新2024/6/14 19:53:44
查看原帖
请尝试用以下代码AC A+B Problem
1249322
Elaina_0楼主2024/6/14 15:12

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;

int random(){
	return rand(-p,p);
}

main(){
	srand(time(0));
	int a=rd,b=rd;
	int x=a+b,y;
	while(y!=x){
		y=random();
		cout<<y<<endl;
	}
	write(y);
	return 0;
}
2024/6/14 15:12
加载中...