2011年11月27日
摘要: 思路:裸的最大下降子序列#include<iostream> #define max(a,b) (a>b?a:b) using namespace std; const int N=10010; const int inf=32770; int num[N],dp[N]; int n; int solve() { int ans=0; memset(dp,0,sizeof(dp)); num[0]=inf; for(int i=1;i<=n;i++) { for(int j=i-1;j>=0;j--) { if(num[i]<=num[j]) { dp[i. 阅读全文
posted @ 2011-11-27 21:58 不是我干的 阅读(149) 评论(0) 推荐(0)
摘要: 题意:给定一个字符换,给定surprising的定义。要求判断是否。思路:水题。因为很久没用map了,特地用下map。#include<iostream> #include<string> #include<map> using namespace std; string str; int main() { while(cin>>str,str!="*") { bool flag=true; for(int i=0;i<str.length()&&flag;i++) { map<string,int 阅读全文
posted @ 2011-11-27 10:58 不是我干的 阅读(284) 评论(0) 推荐(0)