这个问题是在一个坑----即使在使用long  long 这将是超出范围

自己显得很长的时间去阅读很多次的称号仍然没想到

当时的想法是要记住----无论如何,我用long long 已经最大范围。当然不能用更大的类型--即使unsigned它是唯一的 比long long 大一倍。如今回头看,这样的想法太唯心,不是理性分析的结果啊,,

代码:

//1005
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cstdlib>
#include <iostream>
using namespace std;
#define ll long long
const ll lim=1e5; int main()
{
//freopen("hdu1005.txt","r",stdin);
ll cnt,ans,kr,sp,n;
char c;
int last;
bool flag=0;
while(~scanf("%I64d",&n))
{
flag=0;
getchar();
cnt=kr=sp=0;
ans=1;
while(1)
{
c=getchar();
if(c == '\n')cnt++;
if(cnt>=n || c==EOF)break;
//{}
if(c == '$')
{
kr=last=0;
while(1)
{
c=getchar();
if(c == '\n'){cnt++;if(kr)last=1;continue;}
if(c == ' ')kr++;
//if(c != ' ' && c == '\n')conti
if(c != ' ' && kr){if(ans>lim)flag=1;ans*=(kr+1);kr=0;}
if(c == '$')break;
}
if(c != ' ' && kr){if(ans>lim)flag=1;ans*=(kr+1);kr=0;}
////
}
if(c == '{')
{
sp=0;
while(1)
{
c=getchar();
if(c == '\n'){cnt++;}
if(c == '|'){sp++;}
if(c == '}')break;
}
if(ans>lim)flag=1;
ans*=(sp+1);
sp=0;
}
}
if(ans>lim||flag)printf("doge\n");
else printf("%I64d\n",ans);
}
return 0;
}

最新文章

  1. 【环境配置】php5.5 + apache2.4 安装配置【转+修改】
  2. Linux 引导修复
  3. html5 placeholder
  4. leetcode 21
  5. 图解TCP/IP读书笔记(三)
  6. ReactNative学习-ListView
  7. 让WPS支持VHDL的关键词加粗
  8. ISO14443协议中,卡片对RATS,PPS,IBLOCK的处理约定
  9. 【转】常用背景色RGB数值
  10. spring Scurity终于测试OK了,复杂的功能还待深入研究!发布出来一起探讨吧!
  11. Go的50度灰:开发者要注意的陷阱和常见错误
  12. 随机生成游戏用户昵称(nodejs版本)(含机器人头像,金币等)
  13. arcgis js api前端完成面积测算
  14. 优化网站设计(七):避免在CSS中使用表达式
  15. Python __init__.py 文件使用
  16. Java - 15 Java 正则表达式
  17. MongoDB C Driver Building on CentOS
  18. 【POJ2888】Magic Bracelet Burnside引理+欧拉函数+矩阵乘法
  19. VC++开机自动启动程序的几种方法 (转载)
  20. HBuilder设置APP状态栏

热门文章

  1. [JS练习] 瀑布流照片墙
  2. EndNote是一款着名的参考文献管理软件
  3. Github上四种Lisp方言的流行度 | 肉山博客 (Wenshan's Blog)
  4. 4.锁--无锁编程以及CAS
  5. hnnu 11546 Sum of f(x) (求一个数的全部约数和)
  6. 《转》 Openstack Grizzly 指定 compute node 创建 instance
  7. OCA读书笔记(12) - 数据库维护
  8. 对于stackoverflow的中文翻译的相关问题
  9. Linux ssh密钥自动登录(转)
  10. Android中Menu的基本使用方法