摘要: 原题链接:Problem - B - Codeforces 题目大意:输入一个数n,给出n首歌曲评分的排列。给出一个长度为n且只为1或0的字符串s,每一个0或1对应一首歌曲的评价。要求根据s对歌曲重新评分并重新输出排列。重新评分的要求为:1.重新评分后得到的也需要是一个排列。2.评价为1的歌曲评分一 阅读全文
posted @ 2021-12-28 14:07 wbw1537 阅读(217) 评论(0) 推荐(0)
摘要: 原题链接:Problem - 500B - Codeforces 题目大意:给出一个排列和一个矩阵,排列中不同的两个数可以互换位置,条件是两个位置在矩阵中对应的值为1。通过交换尽可能地使排列升序并输出。 思路:矩阵中为1的值并不代表所有可以交换组合的集合。例如假设1和3位置的数可交换,1和5位置的数 阅读全文
posted @ 2021-12-22 20:40 wbw1537 阅读(43) 评论(0) 推荐(0)
摘要: 传送门未知 题意:给两个整数n,s,寻找一个可能的中位数最大的元素非负的数组(元素可以相同),使得数组长度为n,各元素之和为s。 中位数的定义见题目 思路:既然是非负数组,就意味着可以有为0的元素。而且元素可以相同,就意味着可以将中位数前的数全部设为0,原题转换为寻找一个长度为n/2+1的递增数组, 阅读全文
posted @ 2021-12-16 22:26 wbw1537 阅读(61) 评论(0) 推荐(0)
摘要: C - Divide and Multiply 原题链接找不到了... William has array of nn numbers a1​,a2​,…,an​ He can perform the following sequence of operations any number of ti 阅读全文
posted @ 2021-12-14 23:30 wbw1537 阅读(48) 评论(0) 推荐(0)
摘要: B. Team Composition: Programmers and Mathematicians 题目链接:Problem - B - Codeforces time limit per test 1 second memory limit per test 256 megabytes inp 阅读全文
posted @ 2021-11-26 10:21 wbw1537 阅读(301) 评论(0) 推荐(0)
摘要: 链接:https://ac.nowcoder.com/acm/contest/19483/A来源:牛客网 题目描述 给定一个长度大小为N{N}N的正整数数组,查询M{M}M轮,每次问一个区间所有元素的连续乘积。 由于这个答案可能很大,你只用输出结果对109+7{10^9+7}109+7取余数后的结果 阅读全文
posted @ 2021-11-25 22:29 wbw1537 阅读(623) 评论(0) 推荐(0)
摘要: B. Special Permutation time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output A permutation of 阅读全文
posted @ 2021-11-24 20:40 wbw1537 阅读(170) 评论(0) 推荐(0)
摘要: Problem - 1 - Codeforces 1. Nuclear Reactor time limit per test 1 second memory limit per test 256 megabytes input standard input output standard outp 阅读全文
posted @ 2021-11-24 20:26 wbw1537 阅读(112) 评论(0) 推荐(0)
摘要: Problem - 6 - Codeforces 6. Kitchen Plates time limit per test 1 second memory limit per test 256 megabytes input standard input output standard outpu 阅读全文
posted @ 2021-11-24 18:30 wbw1537 阅读(64) 评论(0) 推荐(0)