NOIP2017模拟赛 senior 6.29 T2 小T的钢琴(piano) Description Input Output 这道题思路还是比较好想的,因为题目中已经提到公共子序列长度,所以咯,最长公共子序列好不好! But,这里我们如果只使用LCS的话那么,这里我们的时间复杂度是O(n^2)。 ...
分类:
其他好文 时间:
2017-07-24 21:33:00
阅读次数:
208
#include <iostream> using namespace std; int main(){ int n; cin >> n; int i = 0; while(n!=1) { i++; if(n%2==1) { n = (3 * n + 1)/2; } else { n = n / 2 ...
分类:
其他好文 时间:
2017-07-24 20:26:36
阅读次数:
132
A children’s puzzle that was popular 30 years ago consisted of a 5×5 frame which contained 24 small squares of equal size. A unique letter of the alph ...
分类:
其他好文 时间:
2017-07-24 20:24:47
阅读次数:
230
L脚本语言同意被其他编程语言调用。如C++,非常easy。仅仅要在宿主语言中载入L脚本引擎的动态库 直接调用这两个函数就能够了 extern "C" int __stdcall ScriptEngineDoString(wchar_t * ScriptString); extern "C" int ...
分类:
编程语言 时间:
2017-07-24 19:43:34
阅读次数:
223
算法训练 数组查找及替换 时间限制:1.0s 内存限制:512.0MB 时间限制:1.0s 内存限制:512.0MB 问题描述 给定某整数数组和某一整数b。要求删除数组中可以被b整除的所有元素,同时将该数组各元素按从小到大排序。如果数组元素数值在A到Z的ASCII之间,替换为对应字母。元素个数不超过 ...
分类:
编程语言 时间:
2017-07-24 19:42:14
阅读次数:
224
题目链接:http://codeforces.com/problemset/problem/628/B 解题思路: 一个数最后两位数能被4整除那么这个数就能被4整除,而且题目还是连续的子序列,这就很简单了 实现代码: ...
分类:
其他好文 时间:
2017-07-24 17:37:51
阅读次数:
123
题目链接:hdu 5772 String problem 题意: 给你一个字符串,只含有数字。 你需要选择出一个子序列,使得这个子序列的权值最大。 这个子序列如果这个数字第一次出现就ans-=bx,否则就-=ax 然后如果第i个字符和第j个字符都在子序列里面,那么ans+=w[i][j] 问你最大a ...
分类:
其他好文 时间:
2017-07-24 17:29:05
阅读次数:
163
604B - More Cowbell 思路:贪心。如果有些盒子装一个,那就只装最大的那几个。然后剩下的最大的和最小的合在一起装一个盒子,第二大和第二小的合在一起。。。。。。以此类推。 记录最大的盒子容量。 代码: ...
分类:
其他好文 时间:
2017-07-24 16:24:55
阅读次数:
148
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/ DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xht ...
分类:
Web程序 时间:
2017-07-24 14:51:15
阅读次数:
166
#include<ext/pb_ds/priority_queue.hpp>#define ll long long#define pa pair<ll,int>using namespace std;using namespace __gnu_pbds;typedef __gnu_pbds::pr ...
分类:
其他好文 时间:
2017-07-24 14:47:31
阅读次数:
167