求助
查看原帖
求助
676569
WoodReal12楼主2024/1/5 17:23
// LUOGU_RID: 141371725
#include <iostream>
#include <cmath>
using namespace std;
int x,y,z; 
int main(){
	cin>>x>>y>>z;
	if(x>=0){
		if(y>x||y<0)
			cout<<x<<endl;
		else{
			if(z>y)
				cout<<-1<<endl;
			else{
			    if(z>=0)
			        cout<<x<<endl;
			    else
			        cout<<2*abs(z)+x<<endl;
			}
		}
	}
	else{
		if(y<x||y>0)
			cout<<abs(x)<<endl;
		else{
			if(z<y)
				cout<<-1<<endl;
			else{
			    if(z<=0)
			        cout<<x<<endl;
			    else
			        cout<<2*abs(z)+abs(x)<<endl;
			}
				
		}
	}
	return 0;
}

有人能体会到WA*1(#19)的感觉吗?

2024/1/5 17:23
加载中...