songs专题

LeetCode--1012. Complement of Base 10 Integer 1013. Pairs of Songs With Total Durations Divisible

好久没更LeetCode了,因为最近手头的事情比较多。今天更新两条easy问题。 1013. Pairs of Songs With Total Durations Divisible by 60 这个问题是一个模算术问题。将歌曲时长转为[0,59]余数即可。 class Solution {public int numPairsDivisibleBy60(int[] time) {int

CF 937 G. Shuffling Songs

原题链接:Problem - G - Codeforces 题目大意:t组数据,每组数据给出n个歌曲,歌曲由二维构成,第一维为类型,第二维为作者,如果二首歌曲类型相同或者作者相同,那么它们就可以连续播放,题目中给出的音乐顺序可以改变,问删除多少首歌曲之后连续播放的音乐最多? 思路:状压dp+dfs,可以观察到一组数据最多只能给出16首音乐,可以用一个数的二进制来表示这个歌曲选和不选,那么就可以

leetcode 1013. Pairs of Songs With Total Durations Divisible by 60

leetcode 1013. Pairs of Songs With Total Durations Divisible by 60 题意:一个数组,每个数表示每首歌循环的时间。将所有歌两两匹配,要求满足两首歌持续的总时间能被60整除。求多少种方案。 思路:歌有50000,但是时间只有500。所以考虑将时间都对60取余,统计总个数。 mp[i]表示持续时间为i的歌的数量。 那么对于任意的i

These songs can cheer you up when life gets hard

These songs come from the online. Songs It’s my life —Bon JoviFollow your heart —ScorpionsUp&Up —ColdplayWhat are you waiting for? —NickelbackWhere the streets have no name —U2When you believe —M