首页 > 其他分享 >[ABC140F] Many Slimes

[ABC140F] Many Slimes

时间:2023-04-28 19:44:08浏览次数:42  
标签:题目 Many Slimes ABC140F 生成 multiset 用来

2023-02-13

题目

题目传送门

翻译

翻译

难度&重要性(1~10):6

题目来源

AtCoder

题目算法

贪心

解题思路

用了两个 multiset a 和一个 set s,一个 multiset 用来记录用来存还剩哪些数没生成,另一个用来存已经生成了哪些数,然后后面放数的时候就枚举第二个 multiset 来生成新的数。

然后 \(s\) 就是用来存还有哪几种数没放,因为根据贪心,我们需要找到第一个刚好小于它的数来生成,就可以在 \(s\) 上面二分一下即可。然后如果这个数在第一个 \(a\) 已经没了,那么我们就在这个 \(s\) 中把这个数删掉即可。

完成状态

已完成

标签:题目,Many,Slimes,ABC140F,生成,multiset,用来
From: https://www.cnblogs.com/OIerBoy/p/17363021.html

相关文章

  • 文章推荐---ChatGPT踩坑(too many signups from the same IP)
    http://681314.com/A/S1A6pDeCNF这个文章里关于注册写得不错,需要注意的地方有两点。第一,最好在港澳台地区或类型的地方访问提供的网站,不然无法登录第二,虚拟短信号码,最好选大国的,小国的我没收到......
  • UVA How Many Points of Intersection?
      HowManyPointsofIntersection? a dotsonthetoprowand b dotsonthebottomrow.Wedrawlinesegmentsconnectingeverydotonthetoprowwitheverydotonthebottomrow.Thedotsarearrangedinsuchawaythatthenumberofinternalintersectio......
  • How Many O's? UVA - 11038
    写下区间[a,b]的所有数 ,问一共有多少个0 #include<iostream>#include<cstring>#include<vector>usingnamespacestd;#defineintlonglongintn,f[40][40][2][2];vector<int>a;intdfs(intx,intcnt0,intflg,intlead){ if(x<0){ i......
  • is blocked because of many connection errors; unblock with 'mysqladmin flush-hos
    指定允许连接不成功的最大尝试次数。5.7默认是100;如果到达这个数,那么服务器将不再允许新的连接,即便mysql仍正常对外提供服务。所以可以将这个参数设置为几万。showvariableslike'max_connect_errors';//最大链接错误次数可以提供最大的链接错误次数setglobalmax_conn......
  • 应用连MySQL 报错ERROR 1129 Host is blocked because of many connection errors
    开发反馈应用连MySQL报错 createconnectionSQLException,url:连接串,errorCode1129。搜索1129报错,报错内容为:Hostisblockedbecauseofmanyconnectionerrors一、报错原因同一个ip在短时间内产生太多中断的数据库连接(超过mysql数据库max_connection_errors设置),导......
  • archery entered FATAL state, too many start retries too quickly
    #################################一、配置文件:supervisord.conf(venv)[root@wy3-db245archery]#catsupervisord.conf[unix_http_server]file=supervisor.sock[supervisord]logfile=logs/supervisord.lognodaemon=false[supervisorctl]serverurl=unix://supervisor.s......
  • UVa 696 How Many Knights (想法题)
    696-HowManyKnightsTimelimit:3.000secondshttp://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=637Theknightisapieceusedinchess,agameplayedonaboardwithsquaresarrangedinrowsandcolumns.Aknight......
  • archery entered FATAL state, too many start retries too quickly
    #################################一、配置文件:supervisord.conf(venv)[root@wy3-db245archery]#catsupervisord.conf[unix_http_server]file=supervisor.sock[supervisord]logfile=logs/supervisord.lognodaemon=false[supervisorctl]serverurl=unix://supervis......
  • POJ - 2029 Get Many Persimmon Trees(暴力水题)
    题目大意:给你一个矩阵,矩阵上面有N个柿子树,现在要求你画一个s*t的矩阵,使得这个矩阵内的柿子树达到最多解题思路:100*100,直接暴力#include<cstdio>#include<cstring>#include<algorithm>usingnamespacestd;constintN=110;intn,w,h,s,t;intmap[N][N];voidin......
  • The Many Ways To Call Axes In Matplotlib
    %matplotlibwidgetfromIPython.displayimportdisplay,HTMLimportrefrompathlibimportPathimportcv2importnumpyasnpimportmatplotlib.pyplotaspltfrompprintimportpprintimportclipboardimportpandasaspdimportconcurrent.futuresimportt......