Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

保存一下

Posted by yygy at 2023-05-17 23:07:20 on Problem 3423
#include <cstdio>
#include <string>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <map>
#include <queue>
#include <string>
#include <algorithm>
#include <iostream>
#include <math.h>
using namespace std;
typedef __int64 lld;

const int INF=1000000000;
const lld MOD=110000;
const int MAX=110000;
const double EPS=1.0e-8;

std::string format;
char buf[50010];

bool ReadLine(std::string& str)
{
	if(!cin.getline(buf, 50010))
	{
		return false;
	}
	//printf("input=");
	//puts(buf);
	str=std::string(buf);
	//cout<<"output"<<" "<<str<<endl;

	return true;
}

bool AllDigits(const std::string& str)
{
	if(str.empty())
	{
		return false;
	}
	for(int i=0;i<str.size();i++)
	{
		if(!isdigit(str[i]))
		{
			return false;
		}
	}

	return true;
}

std::string GetNum(const std::string& str)
{
	std::string result=str;
	std::reverse(result.begin(), result.end());
	while(result.size()>1 && result.end()[-1]=='0')
	{
		result.erase(result.end()-1);
	}

	std::reverse(result.begin(),result.end());

	return result;
}

int pos[2048];

int main()
{
	//freopen("D:\\517Coding\\format.txt", "r", stdin);
	int n;
	while(cin>>n)
	{
		int m;
		for(int i=0;i<n;i++)
		{
			scanf("%d",&pos[i]);
		}
		int s,f,l;
		cin>>s>>f>>l;

		
		for(int i=0;i<l;i++)
		{
			int p=i+f;
			bool flag=false;
			for(int j=0;j<n;j++)
			{
				if(fabs(p-pos[i])<s)
				{
					flag=true;
					break;
				}
			}

			if(i)putchar(' ');
			printf("%d", flag);
		}

		cout<<endl;

	}
    return 0;
} 
//end //提示:自动阅卷结束唯一标识,请勿删除或增加。

/*

*/

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator