DP
文章平均质量分 69
Achanss
My life is good, and u just make it better!
展开
-
*max_element(start, end)可用于一维数组或多维数组 附带简易DP
示例代码: #include<iostream>#include<cstring>#include<cmath>#include<algorithm>using namespace std;int tree[1001];int dp[1001][31];int main(void){ int T,W; whi...原创 2017-12-02 18:23:00 · 1121 阅读 · 0 评论 -
CodeForce 1072-B. Curiosity Has No Limits(递推)
CodeForce 1072-B. Curiosity Has No Limits题目链接题目大意:给出两个数组a,b长度均为n-1问能否构造出长度为n的t数组,满足1、a[i] = t[i] | t[i+1]2、b[i] = t[i] &amp;amp; t[i+1]解题思路:对所有情况枚举输出可以发现对应于一个确定的t[i]和a[i],b[i] t[i+1]的值要么存在且唯一,要么不存...原创 2018-10-22 20:19:33 · 397 阅读 · 0 评论 -
UPC——2789: Selling CPUs(DP)
2789: Selling CPUs传送门时间限制: 1 Sec 内存限制: 64 MB提交: 164 解决: 58[提交] [状态] [讨论版] [命题人:admin] 题目描述You are very happy, that you got a job at ACME Corporation’s CPU factory. After a hard month of ...原创 2018-10-05 21:09:16 · 430 阅读 · 0 评论 -
UPC ——9301: CHEAP DELIVERIES(K次最短路dijktra+状压DP)
9301: CHEAP DELIVERIES 题目传送门时间限制: 1 Sec 内存限制: 128 MB提交: 190 解决: 52[提交] [状态] [讨论版] [命题人:admin] 题目描述Abu runs a delivery service where he deliver items from one city to another. As with a...原创 2018-10-05 11:49:09 · 469 阅读 · 0 评论 -
UPC——7713: Elections(概率DP)
7713: Elections时间限制: 1 Sec 内存限制: 128 MB提交: 82 解决: 38[提交] [状态] [讨论版] [命题人:admin]题目描述Jenabkhan who has become billionaire from his Laboo bussiness, is now running for president. His country us...原创 2018-09-13 19:56:22 · 236 阅读 · 0 评论 -
Codeforces_148D. Bag of mice (DP)
D. Bag of micetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe dragon and the princess are arguing about what to do on the Ne...原创 2018-09-13 19:56:37 · 215 阅读 · 0 评论 -
2018南京网络赛 NJ_E - AC challenge
#include <bits/stdc++.h>using namespace std;int bit[22];int a[22];int b[22];int state[22];long long dp[1<<20];int numbit[1<<20];const long long INF = 1000000000000000LL;...原创 2018-09-13 19:57:09 · 213 阅读 · 0 评论 -
UPC-7027: Flipping Coins (DP)
7027: Flipping Coins时间限制: 1 Sec 内存限制: 128 MB Special Judge提交: 127 解决: 56[提交] [状态] [讨论版] [命题人:admin]题目描述Here’s a jolly and simple game: line up a row of N identical coins, all with the heads...原创 2018-09-13 19:58:02 · 255 阅读 · 0 评论 -
UPC-5212: Coins I (DP)
5212: Coins I时间限制: 1 Sec 内存限制: 128 MB提交: 122 解决: 74[提交] [状态] [讨论版] [命题人:admin]题目描述Alice and Bob are playing a simple game. They line up a row of n identical coins, all with the heads facing ...原创 2018-09-13 19:57:28 · 184 阅读 · 0 评论 -
CodeForces ——1079C. Playing Piano(记忆化搜索 / DP )
CodeForces ——1079C. Playing PianoDFS版本:记忆化在DFS过程中出现过的,因为只要出现回溯,证明该深度下,所有方案都是无效解。 存一下这些无效的方案直接跳过~~/** @Author: Achan* @Date: 2018-11-20 19:29:26* @Last Modified by: Achan* @Last Modified tim...原创 2018-11-20 22:07:14 · 600 阅读 · 0 评论