倒计时64天

1.B-关鸡_2024牛客寒假算法基础集训营1 (nowcoder.com)

#include 
using namespace std;
const int N = 1e5 + 5;
const int inf = 0x3f3f3f3f;
#define int long long
typedef pair pii;
void solve()
{
    setse;
    int n,ans1=2,ans2=2;
    cin>>n;
    for(int i=0;i>x>>y;
        se.insert({x,y});
        if(y<=0)ans1=1;
        if(y>=0)ans2=1;
    }
    for(auto[x,y]:se)
    {
        for(int i=-1;i<=1;i++)
        {
            if(se.count({x^3,y+i}))
            {
                if(y<0)ans1=0;
                if(y>0)ans2=0;
            }
        }
    }
    int ans=3-se.count({1,1})-se.count({1,-1})-se.count({2,0});
    cout<>t;
    while(t--)
    {
        solve();
    }
	return 0;
}

2.C-按闹分配_2024牛客寒假算法基础集训营1 (nowcoder.com)

#include
using namespace std;
#define int long long
const int N=1e5+5;
const int inf=0x3f3f3f3f;
void solve()
{
	int n,q,t,a[N],b[N],cn=0;
    cin>>n>>q>>t;
    for(int i=0;i>a[i];
    sort(a,a+n);
    for(int i=0;i>m;
        int r=m/t;
        if(r>=n)cout<

3.G-why买外卖_2024牛客寒假算法基础集训营1 (nowcoder.com)

#include
using namespace std;
#define int long long
const int N=1e5+5;
const int inf=0x3f3f3f3f;
struct node{
    int x,y;
}a[N];
bool cmp(node aa,node bb)
{
    return aa.x>t;
    while(t--)
    {
        int n,m,max1=-inf;
        cin>>n>>m;
        for(int i=0;i>a[i].x>>a[i].y;
        }
        sort(a,a+n,cmp);
        for(int i=0;i

4.E-本题又主要考察了贪心_2024牛客寒假算法基础集训营1 (nowcoder.com)

#include
using namespace std;
#define int long long
const int N=3e4+5;
const int inf=0x3f3f3f3f;
int n,m,a[11],u[11],v[11],ans;
void dfs(int x)
{
    if(x==m+1)
    {
        int t=0;
        for(int i=2;i<=n;i++)
        {
            if(a[1]>n>>m;
    for(int i=1;i<=n;i++)cin>>a[i];
    for(int i=1;i<=m;i++)cin>>u[i]>>v[i];
    ans=n+1;
    dfs(1);
    cout<>t;
    while(t--)
        solve();
	return 0;
}

..........................心情不好.............╥﹏╥...............................待续.......

你可能感兴趣的:(c++)