1 条题解

  • 0
    @ 2026-5-31 16:21:52
    #include<bits/stdc++.h>
    using namespace std;
    const int N=2e5+10;
    char st[N];
    signed main()
    {
    	int n,a,b,c,d;cin>>n>>a>>b>>c>>d;
    	scanf("%s",st+1);
    	for(int i=a;i<c;i++)if(st[i]=='#'&&st[i+1]=='#')
    	{
    		cout<<"No";
    		return 0;
    	}
    	for(int i=b;i<d;i++)if(st[i]=='#'&&st[i+1]=='#')
    	{
    		cout<<"No";
    		return 0;
    	}
    	if(c>d)
    	{
    		for(int i=b-1;i<d;i++)if(st[i]=='.'&&st[i+1]=='.'&&st[i+2]=='.')
    		{
    			cout<<"Yes";
    			return 0;
    		}
    		cout<<"No";
    		return 0;
    	}
    	cout<<"Yes";
    	return 0;
    }
    • 1

    信息

    ID
    8602
    时间
    2000ms
    内存
    1024MiB
    难度
    6
    标签
    递交数
    33
    已通过
    12
    上传者