04 2020 档案
摘要:#include<iostream> #include<Windows.h> #include<winsock.h> #include <assert.h> #include<string> using namespace std; #pragma comment(lib, "ws2_32.lib"
阅读全文
摘要:https://ac.nowcoder.com/acm/problem/13611 其实把,把树分成k个连通块有几种分配方法= 从树上取下k-1条边有几种取法,排列组合就行了,,,,,, #include<iostream> #include<algorithm> using namespace s
阅读全文
摘要:https://ac.nowcoder.com/acm/contest/5086/C 其实不难,让a堵在c到1的毕竟之路上就好了,需要注意,若是a和c同时到1号点就是no,同时到其他点就是yes。。。。坑了好久我的妈呀 代码公式含义:len a到c 1的必经路的长度,假设到x点 ans b到c加上c
阅读全文
摘要:https://ac.nowcoder.com/acm/problem/13249 #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #include<vector> using namespace s
阅读全文
摘要:https://ac.nowcoder.com/acm/contest/4912/A 过这个题有个前提,需要知道删除哪条边 必须是直径上的边 为什么? 如果不删直径上的边答案就不可能减少了,建议多画画试一下 抓住直径两端s和t开始树形DP, 具体看代码吧 #include<iostream> #in
阅读全文
摘要:如下图 #include<iostream> #include<cstring> #include<algorithm> #include<cstdio> using namespace std; int dp[1010][1010]; char list[1010]; char ans[1010]
阅读全文

浙公网安备 33010602011771号