Hossam

Solution - Hossam and (sub-)palindromic tree

又名:《最近 vjudge 题全部罚坐》。 唯一 Trick:回文序列,就想区间 dp!时间复杂度 \(O(n ^ 2)\)! 如果是序列:\(f_{l, r}\) 表示 \([l, r]\) 的最长回文子序列,\(f_{l, r} = \max(f_{l + 1, r}, f_{l, r - 1} ......
palindromic Solution Hossam tree and

B. Hossam and Friends

B. Hossam and Friends 题目大意: 有\(n\)对朋友,其中\(m\)对朋友互相不认识,让你选区间,最多可以选多少区间,区间中没有互相不认识的朋友 思路: 遍历每个点作为区间的左端点,必须满足\(a[i]\le a[i+1]\)(\(a[i]\)存储以\(i\)做左端点,右端点的 ......
Friends Hossam and

Codeforces Round 837 (Div. 2) A. Hossam and Combinatorics

给一个长为 $n$ 的数组 $a$ ,统计出所有二元组 $(a_i, a_j)$ 数量,满足以下条件: * $1 \leq j view ``` #include void solve() { int n; std::cin >> n; std::vector a(n); for (int i = ......
Combinatorics Codeforces Hossam Round 837

Codeforces Round 837 (Div. 2) F. Hossam and Range Minimum Query

[传送门](https://codeforces.com/contest/1771/problem/F) 大致题意: ** 给一个n,然后给一个数组a, 有m个询问,询问区间[l, r]出现次数为奇数的最小值,若没有输出0, 每次输入的l,r需要异或上上一个答案,在第一个询问的时候认为上一个答案为0 ......
Codeforces Minimum Hossam Round Range
共4篇  :1/1页 首页上一页1下一页尾页