摘要:
思路: 贪心 ,以边为单位看被用了几次。 本题自己的错误: 没有把题的思路想完全,只想了一部分,只想到了到终点,而没有到其它点也可以有边。 Farmer John has a farm that consists of nn pastures connected by one-directional 阅读全文
摘要:
技巧: 有负数,要用数组就统一加一个大的数(更具题目)map可能会影响时间 对于本题牢牢利用每一个值不一样, Polycarp watched TV-show where k jury members one by one rated a participant by adding him a ce 阅读全文
摘要:
重要结论: 钥匙一定是连续的。 A. Office Keys time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output There are n p 阅读全文
摘要:
思路: 根据博弈条件: 能够转化到必败的条件,必赢,不然必输 然后另外一个技巧 看能不能后手一直让某一个条件维持不变,从而让自己获胜 1 初始情况可能要特判,更具自己的代码 Alice and Bob always like playing games with each other and tod 阅读全文
摘要:
思路:将同样大小的数为一组,这一组的某个特定值的位置,来更新ans。 特定值:last的左边的值的优先级高于右边的值的优先级。 树状数组维护这个区间里面有多少个没有被删的值。 B. Cards Sorting time limit per test 1 second memory limit per 阅读全文