HDU 5914 Triangle

n只有20,强行手推,wa了两发……

【代码】

/* ***********************************************
Author        :angon

************************************************ */
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
using namespace std;
#define showtime fprintf(stderr,"time = %.15f\n",clock() / (double)CLOCKS_PER_SEC)
#define lld %I64d
#define REP(i,k,n) for(int i=k;i'9'; ch=getchar());for(; ch>='0'&&ch<='9'; ch=getchar())s=s*10+ch-'0';return s;}


int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    int a[21] = {0,0,0,0,1,1,2,3,3,4,5,6,7,7,8,9,10,11,12,13,14};
    int t;
    int cas=1;
    scan(t);
    while(t--)
    {
        int n;
        scan(n);
        printf("Case #%d: %d\n",cas++,a[n]);
    }


    return 0;
}


你可能感兴趣的:(HDU 5914 Triangle)