摘要: 题目:Center Alignment思路:模拟#include #include #include #include #include using namespace std;char s[1010][1010];int main(){ int cnt=0; while(gets(s[cnt++])) ; int mx=0; for(int i=0;i<cnt;i++) { int l=strlen(s[i]); mx=max(mx,l); } for(int i=0;i<mx+2;i++) cout<<"*... 阅读全文
posted @ 2013-07-13 15:59 over_flow 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 题目:Chat Servers Outgoing Traffic思路:水,map模拟#include #include #include #include #include #include #include using namespace std;mapm;int main(){ m.clear(); char s[110]; string str; int ans=0; while(gets(s)) { str=""; int l=strlen(s); if(s[0]=='+') { ... 阅读全文
posted @ 2013-07-13 13:45 over_flow 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 题目:http://acm.nyist.net/JudgeOnline/problem.php?pid=16思路:最长上升子序列#include #include #include #include #include using namespace std;struct node{ int x,y;}p[1010];int dp[1010];bool cmp(node a,node b){ if(a.x==b.x) return a.yp[i].y) swap(p[i].x,p[i].y); dp[i]=1; } sor... 阅读全文
posted @ 2013-07-13 11:11 over_flow 阅读(173) 评论(0) 推荐(0) 编辑