洛谷
洛谷
Ctrl AC
I'm sorry for everything, everything I've done.
展开
-
AcWing 1049 大盗阿福
原题普通方法:状态机方法:f[i][0]:未选第i家的f[i][1]:选了第i家的#include<bits/stdc++.h>using namespace std;using namespace std;const int N=100005,INF=0x3f3f3f3f;int n;int w[N],f[N][2];int main(){ int T;cin>>T; while(T--){ in..原创 2022-04-05 22:50:35 · 451 阅读 · 0 评论 -
洛谷 P3385 【模板】负环
“ Ctrl AC!一起 AC!”链式前向星似乎比vector邻接表好用 qwq题目:P3385 【模板】负环思路:SPFA模板,然后用链式前向星邻接表代码:#include<iostream>#include<queue>#include<cstring>using namespace std;const int MAXN = 2010;const int MAXM = 3010;const int INF = 0x3f3f3f3f;原创 2022-04-25 15:20:01 · 174 阅读 · 0 评论