首页 > TAG信息列表 > 1187

[LeetCode] 1187. Make Array Strictly Increasing 使数组严格递增

Given two integer arrays arr1 and arr2, return the minimum number of operations (possibly zero) needed to make arr1 strictly increasing. In one operation, you can choose two indices 0 <= i < arr1.length and 0 <= j < arr2.length and do the assi

HDU 1187 Big Event in HDU

题意:有n个物品,希望尽可能均分 尽可能均分,就是找尽可能接近sum/2的方案 考虑生成函数 \(G(x)=(1+x^{v[i]}+x^{2v[i]}+...+x^{a[i]v[i]})(...\) #include<bits/stdc++.h> using namespace std; int rd(){ int ret=0, f=1;char c; while(c=getchar(),!isdigit(c))f=c=='-'?-1

LeetCode 1187. 使数组严格递增

tle 但是我好开心啊(真) #include<bits/stdc++.h> using namespace std; int srh(vector<int>& arr1, vector<int>& arr2, int a, int b) {//搜索改完,搜完,一定要改回来再搜,保持之后的人还是原数组 if(a>=arr1.size()) return 0; int ans = arr2.size()+1; int j =

codeforces 1187 B Letters Shop

codeforces 1187 B Letters Shop 题意 有一个长度为n(0 < n <= \(2 * 10^5\))的字符串,有m(0 < m <= \(5 * 10^4\))次询问,每次询问输入一个字符串t(0 < |t| <= \(2 * 10^5\)),从n串里面取出所有a串的元素,需要取到第几个元素?(\(\quad\sum_{i=1}^{m}|t_i|≤2⋅10^5\)) 题解 直接暴力

Codeforces Contest 1187 E Tree Painting —— 树形DP

This way 题意: 给你一棵树,一开始每个点都是白色的,现在你要将点一个一个涂黑,一开始你可以任选一个点,但是之后你需要在黑的点旁边选点。你每次涂黑所得到的值是与你选择的点相邻的白色区块的大小(包括它本身),问你最终得到的值最大是多少。 题解: 稍微模一下就可以发现一定是从某