蒟蒻求指点
  • 板块灌水区
  • 楼主BDFZ_lzq
  • 当前回复1
  • 已保存回复1
  • 发布时间2024/10/31 22:57
  • 上次更新2024/11/1 14:45:38
查看原帖
蒟蒻求指点
1050712
BDFZ_lzq楼主2024/10/31 22:57

求指导马蜂

#include<bits/stdc++.h>
using namespace std;
struct ticket
{
	long long time,money;
	bool b;
}t[114514];
int main()
{
	long long n,head=0,tail=0,op,m,tm,x;
	long long sum=0;
	cin>>n;
	for(int y=0;y<n;y++)
	{
		cin>>op;
		if(op==0)
		{
			cin>>m>>tm;
			t[tail].money=m;
			t[tail].time=tm;
			t[tail].b=0;
			tail++;
			sum+=m;
		}
		else
		{
			cin>>m>>tm;
			for(int z=head;;z++)
			{
				if(tm-t[z].time<=45)
				{
					head=z;
					break;
				}
				if(z==tail)
				{
					head=tail;
					break;
				}
			}
			x=-1;
			for(int z=head;z<=tail;z++)
			{
				if(m<=t[z].money&&t[z].b==0&&tm-t[z].time<=45)
				{
					x=z;
					break;
				}
			}
			if(x==-1)
			{
				sum+=m;
			}
			else
			{
				t[x].b=1;
			}
		}
//		cout<<sum<<" "<<m<<endl;
	}
	cout<<sum;
	return 0;
}

只有大比赛的时候才能考好怎么办

rt,学校的CSP-J模拟赛爆60,平均分105

平时只能切橙题,但是赛时勉强能切绿题

而且每次考完都要红温(39度左右),是什么情况(生物牢师:肾上腺素)

考试大概几等

CSP-J : [280320][280-320]

CSP-S : [140180][140-180]

地区:福建

年级:初一

2024/10/31 22:57
加载中...