QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#146985#6749. Targetkatarina001Judging//C++14457b2023-08-22 18:05:532023-08-22 18:05:54

Judging History

This is a historical verdict posted at 2023-08-22 18:05:54.

  • [2023-08-22 18:06:59]
  • 管理员手动重测该提交记录
  • Verdict: AC
  • Time: 1ms
  • Memory: 3752kb
  • [2023-08-22 18:05:54]
  • Judged
  • Verdict: Judging
  • Time: 0ms
  • Memory: 0kb
  • [2023-08-22 18:05:53]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
ll n,m;


int main() {
	long double a,b;
	cin>>a>>b;
	for(int i=1;i<=20;i++) cout<<1;
	long double t=0.5;
	vector<int> ans;
	long double x=0;
	int cnt=0;
	while(b-x>1e-6) {
		if(x+t<=b) x+=t,ans.push_back(2);
		else ans.push_back(1);
		t*=0.5;
		cnt++;
	}
//	printf("%.10Lf\n",x);

	for(int i=ans.size()-1;i>=0;i--) {
		cout<<ans[i];

	}


		
	
	return 0;
}