This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
#include<bits/stdc++.h>
usingnamespacestd;
constintN=1e5+10;
intT;//T组数据
intn;//每一组数据的个数n
inta[N];//每个商店的金钱数量
/**
f[i][0] 代表的是不偷第i家店铺能得到的最多现金数量;
f[i][1] 代表的是偷第i家店铺能得到的最多现金数量。
*/
intf[N][2];
/**
状态机 O(n)
把一个过程用一种确定的状态描述了出来
如 f[i][0] 表示没有偷第 i 个商店, f[i][1] 表示偷了第 i 个商店
则 f[i][0] 的入边(即过程)有两条 1. 偷了第 i - 1 个商店, 2. 没偷第 i - 1 个商店