C. Playlist time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You have a playlist consisting of nn songs. The ii-th song is characterized by two numbers titi and bibi — its length and beauty…
当时题意看错了...不过大致思路是对的,唯一没有想到的就是用优先队列搞这个东西,真是不该啊... 题意大概就是,有N首歌,N首歌有两个东西,一个是长度Ti,一个是美丽值Bi,你最多可以选择K首歌, 这些首歌的总和是这些歌的总的长度乘以其中最大的美丽值. 简而言之,就是选择最K个点,问其第一权值总和乘以最小第二权值最大时多少? 很容易想到需要把第二权值排序. 举个例子 4 3 4 7 15 1 3 6 6 8 排序后 T 15   3      4      6 B 1     6      7 …
题目链接 :C. Playlist #include<bits/stdc++.h> using namespace std; #define maxn 300005 #define LL long long #define pii pair<int,int> const int inf = (int)1e9; vector<pii>q; bool cmp(pii a,pii b){ if(a.second==b.second) return a.first>b.f…
最近省队前联考被杭二成七南外什么的吊锤得布星,拿一场Div. 2恢复信心 然后Div.2 Rk3.Div. 1+Div. 2 Rk9,rating大涨200引起舒适 现在的Div. 2都怎么了,最难题难度都快接近3K了-- A. Detective Book 记\(a_i\)的前缀最大值为\(Max_i\),那么要求的就是\(Max_i = i\)的\(i\)的数量 #include<iostream> #include<cstdio> #include<cstdlib>…
A. Detective Book 题意:一个人读书  给出每一章埋的坑在第几页可以填完 . 一个人一天如果不填完坑他就会一直看 问几天能把这本书看完 思路:模拟一下 取一下过程中最大的坑的页数  如果最大页数等于当前页数 day++即可 #include<bits/stdc++.h> using namespace std; #define FOR(i,f_start,f_end) for(int i=f_start ;i<=f_end;i++) #define MT(x,i) mem…
https://codeforces.com/contest/1140/problem/C 题意 每首歌有\(t_i\)和\(b_i\)两个值,最多挑选m首歌,使得sum(\(t_i\))*min(\(b_i\))最大 题解 假如最小的\(b_i\)确定了,那么拿得越多越好 枚举最小的\(b_i\)然后取剩下最大的\(t_i\) 两种做法 1.从\(b_i\)大向小扫,这样用优先队列维护最大的那些\(t_i\)(丢弃最小的) 2.用两个优先队列模拟 代码 //做法1 #include<bits/…
#include<bits/stdc++.h>using namespace std;const long long mod=998244353;long long f[200007][2],g[200007][2];long long a[200007],b[200007],c[200007];int n,k,cnt1,cnt2;long long qpow(long long a,long long p){    long long ans=1;    while(p){        i…
C. Brutality time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are playing a new famous fighting game: Kortal Mombat XII. You have to perform a brutality on your opponent's character. You…
Problem   Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec Problem Description Input Output The only line should contain the minimal number of days required for the ship to reach the point (x2,y2)(x2,y2). If it…
Problem   Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems Time Limit: 3000 mSec Problem Description Input The input contains a single line consisting of 2 integers N and M (1≤N≤10^18, 2≤M≤100). Output Print one integer, the total n…