题解 Merchant】的更多相关文章

传送门 可以发现如果我们最终选择的物品集合已经确定,就很好求了 \(\sum k*t+\sum b \geqslant s\) ,二分即可 但现在我们无法确定该选哪些物品 因此我们只需要check一下0时刻是否符合条件,如果不符合则进行二分. 注意check的时候我们只需要找出最大的 \(m\) 个即可 有点玄学. 证一下它有单调性: 因为保证有解,令存在一个解为时刻 \(t\) 那么此时存在一个 \(\sum k*t+\sum b \geqslant s\) 考虑时刻 \(t+1\),发现多了…
题目链接: while(1)gugu(while(1)) 闲扯 考场上怕T2正解写挂其他两题没管只打了暴力,晚上发现这题思维挺妙的 同时想吐槽出题人似乎热衷卡常...我的巨大常数现在显露无疑QAQ 分析 这道题yy出了一个似乎比solution更好理解的解法,一开始有\(n\)条一次函数,就有\(2^n\)种函数集合,显然每个集合也是一个一次函数\(T_i(x)=k_i x+b_i\) 我们把这个集合分成两种\(k_i<=0\)和\(k_i>0\),显然如果答案最后最大值的函数集合是第一种,那…
The merchant Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 4556   Accepted: 1576 Description There are N cities in a country, and there is one and only one simple path between each pair of cities. A merchant has chosen some paths and w…
Description There are N cities in a country, and there is one and only one simple path between each pair of cities. A merchant has chosen some paths and wants to earn as much money as possible in each path. When he move along a path, he can choose on…
There are N cities in a country, and there is one and only one simple path between each pair of cities. A merchant has chosen some paths and wants to earn as much money as possible in each path. When he move along a path, he can choose one city to bu…
题目质量还是比较高的,只是当时澳大利亚方面出了一点问题?最后造成了区分度非常迷的局面. 纵观三道题,T1是披着交互外衣的提答题,T2是披着交互外衣的传统题,T3是一道据说近年来APIO最水的一道传统题,然而对于不敢相信T3水的选手来说只能靠硬搞两道交互拿分了. T1 Rainbow 没脸写题解和程序了. Subtask 1直接floodfill一下,Subtask 2听说前缀和讨论一下,后面听说数据结构维护一下. T2 Koala 这个感觉可以写一篇交互库玩耍记了,感觉前几个部分分就是在考调戏交…
There are N cities in a country, and there is one and only one simple path between each pair of cities. A merchant has chosen some paths and wants to earn as much money as possible in each path. When he move along a path, he can choose one city to bu…
题目描述 有$n$个物品,第$i$个物品有两个属性$k_i,b_i$,表示它在时刻$x$的价值为$k_i\times x+b_i$.当前处于时刻$0$,你可以选择不超过$m$个物品,使得存在某个整数时刻$t,t\geqslant 0$,你选择的所有物品的总价值大于等于$S$.给出$S$,求$t$的最小值. 输入格式 从文件$merchant.in$中读入数据.第一行三个整数$n,m,S$.接下来$n$行,第$i$行两个整数$k_i,b_i$. 输出格式 输出到文件$merchant.out$中.…
我要举报本次校赛出题人的消极出题!!! 官方题解请戳:http://3.scnuacm2015.sinaapp.com/?p=89(其实就是一堆代码没有题解) A. 树链剖分数据结构板题 题目大意:我没看,看不懂. 基本思路:我不会. 参考代码:找Oyk老师和Czj老师去. B. The background of water problem 题目大意(大写加粗的水题):给定$N$个学生和他们$K$个科目的成绩$S_i$,再给出各科目$K_i$的权重顺序$Q_i$,求排名之后,拥有id为$X$的…
以下代码为了阅读方便,省去以下头文件: #include <iostream> #include <stdio.h> #include <math.h> #include <string.h> #include <time.h> #include <stdlib.h> #include <string> #include <bitset> #include <vector> #include <…