标签:des style http color java os strong io
题目的意思还是比较好看懂的。注意以下几点:
1.所有的{}与$$都是唯一匹配的啊,$$ $$这种情况按前两个一组后两个一组来算。
2.换行不会打破连续的空格。
3.{}与$$之间的不会有嵌套的形式。
4.中间计算过程有可能超int要用long long 来存。
9 I‘ll shoot the magic arrow several times on the ground, and of course the arrow will leave some holes on the ground. When you connect three holes with three line segments, you may get a triangle. {|It is hole! Common sense!| No Response, Read Problem Statement|don‘t you know what a triangle is?} 1 Case $1: = >$ 5 $/*This is my code printed in proportional font, isn‘t it cool?*/ printf("Definitely it is cooooooool %d\n",4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4);$ 2 $Two space$ and {blue| red} color!
4 4 doge 6
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <stdlib.h>
#define clear(A, X, SIZE) memset(A, X, sizeof(A[0]) * (SIZE))
#define clearall(A, X) memset(A, X, sizeof(A))
#define max( x, y ) ( ((x) > (y)) ? (x) : (y) )
#define min( x, y ) ( ((x) < (y)) ? (x) : (y) )
#define LL long long
#define maxn 1e5
using namespace std;
int main()
{
int n;
LL ans,temp,cnt;
char c, x;
while(~scanf("%d",&n))
{
x=getchar();
while(x!='\n')
{
x=getchar();
}
bool flat1=false,flat2=false,flat=true;
ans=1;
temp=1;
while(n--)
{
while(1)
{
scanf("%c",&c);
if(c == '\n')
break;
if(flat)
{
if(ans>maxn || temp > maxn)
{
ans=maxn+10;
flat=false;
continue;
}
if(c=='{')
{
flat1=true;
cnt=1;
}
else if(c=='}')
{
ans*=cnt;
flat1=false;
}
else if(flat1&&c=='|')
{
cnt++;
}
else if(!flat2&&c=='$')
{
flat2=true;
temp=1;
cnt=1;
}
else if(flat2&&c=='$')
{
temp*=cnt;
ans*=temp;
flat2=false;
}
else if(flat2&&c==' ')
{
cnt++;
}
else if(flat2&&c!=' ')
{
temp*=cnt;
cnt=1;
}
}
}
}
if(ans>maxn)puts("doge");
else printf("%I64d\n",ans);
}
return 0;
}HDU 4891 The Great Pan(模拟),布布扣,bubuko.com
标签:des style http color java os strong io
原文地址:http://blog.csdn.net/xu12110501127/article/details/38292361