zoukankan      html  css  js  c++  java
  • GMOJ Contest2858 总结

    GMOJ Contest2858 总结

    1 比赛时

    我居然倒着看题.jpg

    1.1 第三题

    唔,也许是字符串有关算法吧…不过,我会25分!

    考虑高仿KMP,我尝试利用前面子串的信息更新后面的。 然而没搞出来

    1.2 第二题

    一眼写出DP式,然后看着数据范围自闭。

    算了,还是打个DFS吧,加个小优化,超过了n就直接组合数。

    1.3 第一题

    很有想法。可以发现一个区间 +d ,实质上是将两段上升子序列拼起来。一个区间 -d 相当于它后面的区间 +d。我们正着扫一遍,反着扫一遍,合并一下,就是答案了。

    2 比赛后

    第一题没有注意合并时一定不一定是两个最长子串相拼,获得了42分的好成绩。

    第二题可以DP,但要压缩状态。设 f[i][j][k] 为 (i, j),乘积为 x 且 (lfloorfrac{(n-1)}{x} floor=k) 时的方案数。

    第三题注意到[l, r]与[x, y]可以O(1)更新至[l+1, r+1]与[x+1, y+1]。O(n2)暴力即可

    3 总结

    1. 实现时注意细节
    2. N方过一万,暴力碾标算。
    3. 多注意算法优化的小技巧。

    Author: Lutts

    Created: 2019-08-20 二 16:55

    Validate

  • 相关阅读:
    【leetcode】1295. Find Numbers with Even Number of Digits
    【leetcode】427. Construct Quad Tree
    【leetcode】1240. Tiling a Rectangle with the Fewest Squares
    【leetcode】1292. Maximum Side Length of a Square with Sum Less than or Equal to Threshold
    【leetcode】1291. Sequential Digits
    【leetcode】1290. Convert Binary Number in a Linked List to Integer
    【leetcode】1269. Number of Ways to Stay in the Same Place After Some Steps
    【leetcode】1289. Minimum Falling Path Sum II
    【leetcode】1288. Remove Covered Intervals
    【leetcode】1287. Element Appearing More Than 25% In Sorted Array
  • 原文地址:https://www.cnblogs.com/BunnyLutts/p/11384065.html
Copyright © 2011-2022 走看看