1. 程式人生 > >ssl提高組週四備考賽【2018.11.1】

ssl提高組週四備考賽【2018.11.1】

前言

呆學校呆4天依舊不想複習期中,期中考涼透了。


成績

R a n k Rank
P e r s o n Person
S c o r e Score
A A B B C C
1 1 2014 l y k 2014lyk 200 200 100 100 70 70 30 30
2 2 2017 w y c 2017wyc 180 180 100 100 80 80 0 0
3 3 2017 x j q 2017xjq 170 170 100 100 70 70 0 0
4 4 2014 l x f 2014lxf 160 160 100 100 60 60 0 0
5 5 2017 l r z 2017lrz 130 130 30 30 100 100 0 0
5 5 2013 y h l 2013yhl 130 130 100 100 30 30 0 0
5 5 2015 z y f 2015zyf 130 130 100 100 30 30 0 0
8 8 2014 l x h 2014lxh 120 120 100 100 20 20 0 0
9 9 2017 h z b 2017hzb 110 110 30 30 80 80 0 0
10 10 2014 l x 2014lx 100 100 100 100 0 0 0 0
10 10 2015 g j h 2015gjh 100 100 100 100 0 0 0 0
10 10 2014 w w t 2014wwt 100 100 100 100 0 0 0 0

正題


T 1 : n s s l 1268 T1:nssl1268- 可見點數【數論 , , 尤拉】

和儀仗隊一樣,就直接放儀仗隊了
部落格連結:
https://blog.csdn.net/Mr_wuyongcong/article/details/81071889


T 2 : n s s l 1269 T2:nssl1269- 射擊【貪心 , , 堆】

部落格連結:
https://blog.csdn.net/Mr_wuyongcong/article/details/83618568


T 3 : n s s l 1270 T3:nssl1270- 創世紀【樹形 d p , dp, 基環樹】

部落格連結:
https://blog.csdn.net/Mr_wuyongcong/article/details/83618655


s o m e   o f   c o d e some\ of\ code


T2 80分code

#include<cstdio>
#include<queue>
#include<algorithm>
#define ll long long
#define N 200100
using namespace std;
struct node{
	ll t,w;
}a[N];
ll n,last,ans;
priority_queue<ll> q;
bool cmp(node x,node y)
{return x.t==y.t?x.w>y.w:x.t>y.t;}
int main()
{
	scanf("%lld",&n);
	for(ll i=1;i<=n;i++)
	  scanf("%lld%lld",&a[i].t,&a[i].w);
	sort(a+1,a+1+n,cmp);
	for(ll i=1;i<=n;i++)
	{
		q.push(a[i].w);
		for(ll j=a[i+1].t;j<a[i].t&&!q.empty();j++)
		{
			ans+=q.top();
			q.pop();
		}
	}
	printf("%lld",ans);
}

T3 0分code

#include<cstdio>
#include<algorithm>
#include<cstring><