水一下
查看原帖
水一下
739145
封禁用户楼主2024/7/18 23:40

入门题?

还没题解?

钠,脑洞大开......

AC记录(点击查看)

附AC代码(应该都能看懂,不加注释了)

#include<bits/stdc++.h>
#include<algorithm>
#include<bitset>
#include<cctype>
#include<cmath>
#include<complex>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string.h>
#include<ctime>
#include<deque>
#include<list>
#include<map>
#include<iostream>
#include<queue>
#include<set>
#include<stack>
#include<utility>
#include<vector>
using namespace std; 
#define IOS ios::sync_with_stdio(0),cin.tie(),cout.tie();
inline long long read();
vector<unsigned long long > x;
void work(){
	x.push_back(    abs( read() )     ) ;
	if( signbit( read() )  ) 
	  if(x.back()) cout<<"-"<<x.back(),x.pop_back();
	  else cout<<x.back(),x.pop_back();
	else cout<< x.back(),x.pop_back();
}
signed main(){ work();}
inline long long read()
{
	char cc=getchar();	long long f=1; long long ans=0;
	while(cc<'0' or cc>'9'){
		if(cc=='-') f=-1;
		cc=getchar();
	}
	while(cc>='0' and cc<='9'){
		ans=(ans*10)+(cc-'0');
		cc=getchar();
	}
	return f*ans;
}

爽

2024/7/18 23:40
加载中...