dalao帮忙看看我在落谷上90但freopen无输出怎么破
查看原帖
dalao帮忙看看我在落谷上90但freopen无输出怎么破
113641
刘力萌楼主2019/11/16 17:04
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
unsigned long long n,k,m;
string s;
int main()
{
	freopen("aa.in","r",stdin);
	freopen("aa.out","w",stdout);
	scanf("%ull%ull",&n,&k);
	m=n;k++;
	while(m>=1){
		if(k%4==0)s[m]='0';
		if(k%4==1)s[m]='0';
		if(k%4==2)s[m]='1';
		if(k%4==3)s[m]='1';
		if((k&1)&&(k!=1))k=(k>>1)+1;
		else k>>=1;
		m--;
	}
	for(int i=1;i<=n;i++)
	cout<<s[i];
}
2019/11/16 17:04
加载中...