ABC 398BC解

B题

题面翻译

qwq

思路

其实就是统计加判断
注意满堂彩的定义

点击查看代码
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 7;

int read()
{
    int x = 0, w = 1;
	char ch = getchar();
    while(ch > '9' || ch < '0')
	{
		if(ch == '-')
		{
			w = -1;
			ch = getchar();
		}
	}
    while(ch <= '9' && ch >= '0')
	{
    	x = x * 10 + ch - '0';
		ch = getchar();
	}
    return x * w;
}

long long Qmi(int a, int b, int p)
{
	if(b == 0)
	{
		return 1%p;
	}

	if(b == 1)
	{
		return a%p;
	}

	long long ans = Qmi(a, b/2, p);

	ans = ans*ans%p;

	if(b % 2)
	{
		ans = ans*a%p;
	}

	return ans % p;
}

bool isprime(long long x)
{
	if(x <= 1)
	{
		return false;
	}
	if(x == 2)
	{
		return true;
	}
	if(x % 2 == 0)
	{
		return false;
	}
	for(int i = 3;  i <= sqrt(x);  i += 2)
	{
	   if(x % i == 0)
	   {
	   		return false;
	   }
	}
	return true;
}

/*
int dictionary(const string& s1, const string& s2)
{

    int i = 0, j = 0;
    while (i < s1.length() && j < s2.length())
	{
        if(s1[i] < s2[j])
		{
			return -1;
		}
        if(s1[i] > s2[j])
		{
			return 1;
		}
        i++;
        j++;
    }

    if (i < s1.length())
	{
		return 1;
	}
    if (j < s2.length())
	{
		return -1;
	}

    return 0;
}
*/

int t[15];

int main()
{
	//freopen("qwq.in", "r", stdin);
	//freopen("qwq.out", "w", stdout);
	
	for(int i = 1;  i <= 7;  i++)
	{
		int qwq;
		cin>>qwq;
		t[qwq]++;
	}
	
	for(int i = 1;  i <= 13;  i++)
	{
		for(int j = i + 1;  j <= 13;  j++)
		{
			if((t[i] >= 3 && t[j] >= 2) || (t[j] >= 3 && t[i] >= 2))
			{
				cout<<"Yes"<<endl;
				return 0;
			}
		}
	}
	
	cout<<"No"<<endl;
	
	return 0;
}

C题

vector写法

posted @ 2025-03-28 19:32  include_qwq  阅读(27)  评论(0)    收藏  举报