QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#583734#9381. 502 Bad Gatewaybeast_ancestorWA 0ms3652kbC++11756b2024-09-22 21:42:302024-09-22 21:42:31

Judging History

你现在查看的是最新测评结果

  • [2024-09-24 14:55:37]
  • hack成功,自动添加数据
  • (/hack/886)
  • [2024-09-22 21:42:31]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3652kb
  • [2024-09-22 21:42:30]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define rep(i,l,r) for(int i=l;i<=r;i++)
#define lop(i,r,l) for(int i=r;i>=l;i--)
#define inf 0x3f3f3f3f
#define mk(a,b) make_pair(a,b)
#define pb(x) push_back(x)
#define deb(x,s) cout<<s<<": "<<x<<endl;
#define ios ios::sync_with_stdio(false);cin.tie(nullptr),cout.tie(nullptr);
#define i8 __int128
typedef long long ll;
typedef double db;
typedef long double ldb;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int N=1e5+10;
void solve(){
	ll n;
	cin>>n;
	if(n==1) cout<<"1 1"<<'\n';
	else{
		n++;
		ll a=2;
		ll g=__gcd(n,a);
		n/=g,a/=g;
		cout<<n<<" "<<a<<'\n';
	}
}
int main(){
	ios
	int T;
	T=1;
//	cin>>T;
	while(T--){
		solve();
	}
	return 0;
}
/*

*/

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3652kb

input:

3
1
2
3

output:

2 1

result:

wrong answer 1st lines differ - expected: '1 1', found: '2 1'