Loading

摘要: 题目描述 给出一个长为n的数列,以及n个操作,操作涉及区间加法,询问区间内小于某个值x的前驱(比其小的最大元素)。输入格式 第一行输入一个数字 。 第二行输入n个数字,第i个数字为ai,以空格隔开。 接下来输入n行询问,每行输入四个数字opt,l,r,c,以空格隔开。 若opt=0,表示将位于l,r 阅读全文
posted @ 2020-07-14 20:24 脂环 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 题目描述 给出一个长为n的数列,以及n个操作,操作涉及区间加法,询问区间内小于某个值x的元素个数。 输入格式 第一行输入一个数字 。 第二行输入n个数字,第i个数字为ai,以空格隔开。 接下来输入n行询问,每行输入四个数字opt,l,r,c,以空格隔开。 若opt=0,表示将位于l,r的之间的数字都 阅读全文
posted @ 2020-07-14 15:13 脂环 阅读(259) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/hokky/p/8476698.html 简而言之,直接赋值是最浅的;copy和[:]较深,但是列表中嵌套的列表还是浅拷贝;deepcopy是最深的。 阅读全文
posted @ 2020-07-14 09:55 脂环 阅读(153) 评论(0) 推荐(0) 编辑
摘要: There are nn programmers that you want to split into several non-empty teams. The skill of the ii -th programmer is aiai . You want to assemble the ma 阅读全文
posted @ 2020-07-14 09:30 脂环 阅读(253) 评论(0) 推荐(0) 编辑
摘要: You are given a permutation p1,p2,…,pnp1,p2,…,pn . Recall that sequence of nn integers is called a permutation if it contains all integers from 11 to 阅读全文
posted @ 2020-07-14 08:35 脂环 阅读(491) 评论(0) 推荐(0) 编辑
摘要: Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string s=s1s2…sns 阅读全文
posted @ 2020-07-14 08:32 脂环 阅读(365) 评论(0) 推荐(0) 编辑