模拟题。

  1. #include<map>
  2. #include<set>
  3. #include<ctime>
  4. #include<cmath>
  5. #include<queue>
  6. #include<string>
  7. #include<vector>
  8. #include<cstdio>
  9. #include<cstring>
  10. #include<iostream>
  11. #include<algorithm>
  12. #include<functional>
  13. using namespace std;
  14. #define ms(x,y) memset(x,y,sizeof(x))
  15. #define rep(i,j,k) for(int i=j;i<=k;i++)
  16. #define per(i,j,k) for(int i=j;i>=k;i--)
  17. #define loop(i,j,k) for (int i=j;i!=-1;i=k[i])
  18. #define inone(x) scanf("%d",&x)
  19. #define intwo(x,y) scanf("%d%d",&x,&y)
  20. #define inthr(x,y,z) scanf("%d%d%d",&x,&y,&z)
  21. #define infou(x,y,z,p) scanf("%d%d%d%d",&x,&y,&z,&p)
  22. #define lson x<<1,l,mid
  23. #define rson x<<1|1,mid+1,r
  24. #define mp(i,j) make_pair(i,j)
  25. #define ft first
  26. #define sd second
  27. typedef long long LL;
  28. typedef pair<int, int> pii;
  29. const int low(int x) { return x&-x; }
  30. const int INF = 0x7FFFFFFF;
  31. const int mod = 1e9 + ;
  32. const int N = 4e5 + ;
  33. const double eps = 1e-;
  34.  
  35. int n;
  36. char t[];
  37. int p1,p2,ans;
  38. int f;
  39.  
  40. void G()
  41. {
  42. for(int i=;t[i];i++)
  43. {
  44. if(t[i]!=' ')
  45. {
  46. if(f==)
  47. {
  48. if(1LL*(p1+)*ans<=) ans=(p1+)*ans;
  49. else ans=;
  50. }
  51. p1=;
  52. }
  53.  
  54. if(t[i]=='{') p2=;
  55. else if(t[i]=='}')
  56. {
  57. if(1LL*(p2+)*ans<=) ans=(p2+)*ans;
  58. else ans=;
  59. }
  60. else if(t[i]=='|') p2++;
  61. else if(t[i]==' ') p1++;
  62. else if(t[i]=='$')
  63. {
  64. f=f^;
  65. }
  66. }
  67. }
  68.  
  69. int main()
  70. {
  71. while(~scanf("%d",&n))
  72. {
  73. getchar(); ans=; f=p1=p2=;
  74. while(n--)
  75. {
  76. gets(t); G();
  77. }
  78.  
  79. if(ans>) printf("doge\n");
  80. else printf("%d\n",ans);
  81.  
  82. }
  83. return ;
  84. }

HDU 4891 The Great Pan的更多相关文章

  1. HDU 4891 The Great Pan (字符串处理)

    题目链接:HDU 4891 The Great Pan 求一串字符有多少种不同的意思,当中关心'{','}'之间的'|'. 和'$','$'之间的空格,连续N个空格算N+1种. AC代码: #incl ...

  2. HDU 4891 The Great Pan (模拟)

    The Great Pan 题目链接: http://acm.hust.edu.cn/vjudge/contest/123554#problem/D Description As a programm ...

  3. 2014多校第三场1005 || HDU 4891 The Great Pan(模拟)

    题目链接 题意 : 给你n行字符串,问你有多少种理解方式.有两大类的理解 (1){A|B|C|D|...}代表着理解方式可以是A,可以是B或C或者D. (2)$blah blah$,在$$这两个符号中 ...

  4. HDU 4891 The Great Pan (题意题+模拟)

    题意:给定一个文章,问你有多少种读法,计算方法有两种,如果在$中,如果有多个空格就算n+1,如果是一个就算2的次方,如果在{}中, 那么就是把每个空格数乘起来. 析:直接模拟,每次计算一行,注意上一行 ...

  5. 2014联合三所学校 (HDU 4888 HDU 4891 HDU 4893)

    HDU 4891 The Great Pan 注册标题  他怎么说,你怎么样  需要注意的是乘法时,它会爆炸int 代码: #include<iostream> #include<c ...

  6. hdu 4891 模拟水题

    http://acm.hdu.edu.cn/showproblem.php?pid=4891 给出一个文本,问说有多少种理解方式. 1. $$中间的,(s1+1) * (s2+1) * ...*(sn ...

  7. HDU - 6166:Senior Pan(顶点集合最短路&二进制分组)

    Senior Pan fails in his discrete math exam again. So he asks Master ZKC to give him graph theory pro ...

  8. HDU 4891

    一道简单的模拟题 需要要匹配{} 和 $$ 符里面的东西即可 //#pragma comment(linker, "/STACK:16777216") //for c++ Comp ...

  9. hdu 4891 模拟

    题意:       给你一个串,问你有几种意思,有两个规则 (1) { }  答案乘以  ({}之间"|"的个数 + 1)  (2)  &&   答案乘以  (&a ...

随机推荐

  1. cssText基本使用及注意事项

    一.cssText之起步 那些年,我们是这样设置样式的: xxx.style.width = "233px"; xxx.style.position = "fixed&q ...

  2. java项目环境搭建

    开发java项目时,由于涉及到版权问题,最好使用开源.免费的软件.比如eclipse. 此外,一个web的java项目涉及到jdk.tomcat等,插件还可能用到svn插件.maven插件. 建议进入 ...

  3. Axis2 WebService(配置、发布、调用)

    准备工作 1.下载:axis2-1.5.4-bin.zip,axis2-1.5.4-war.zip 下载地址:http://axis.apache.org/axis2/java/core/ 2.环境变 ...

  4. java线程的基本概念

    进程和线程 进程的诞生 操作系统中有2个任务A,B,任务A先执行,执行到一半需要io,因此要大量时间,在这个时间段内cpu是空闲的,浪费了资源,于是就有进程,当A暂时无法利用cpu,但是又不能销毁时, ...

  5. 洛谷 2957 [USACO09OCT]谷仓里的回声Barn Echoes

    题目描述 The cows enjoy mooing at the barn because their moos echo back, although sometimes not complete ...

  6. 上下文管理器 contextlib

    from contextlib import contextmanager @contextmanager def tag(name): print "<%s>" % ...

  7. Flask从入门到放弃1:路由app.route()

    Flask从入门到放弃1: Flask中的路由app.route(): 参考来源:http://python.jobbole.com/80956/ https://www.raspberrypi.or ...

  8. COGS1882 [国家集训队2011]单选错位

    ★   输入文件:nt2011_exp.in   输出文件:nt2011_exp.out   简单对比时间限制:1 s   内存限制:512 MB [试题来源] 2011中国国家集训队命题答辩 [问题 ...

  9. Desert King(POJ2728+最优比率生成树+二分)

    题目链接:http://poj.org/problem?id=2728 题目: 题意:求一颗生成树,使得费用与距离的比值最小,其中距离等于两点之间的平面欧拉距离,费用为z坐标之差. 思路: 由上图我们 ...

  10. SpringCloud Feign重试详解

    摘要: 今天在生产环境发生了数据库进程卡死的现象,除了sql因为全量更新,没加索引的原因,最主要还是我们的接口的服务器端接口出现问题了.忽视了更新接口的幂等性,以及调用方feign client的重试 ...