faf

来源:互联网 发布:优化手机流畅度的软件 编辑:程序博客网 时间:2024/06/01 23:10


package faf;

import java.util.Scanner;

public class Sdsf {
     public static int res[][][]=new int[21][21][21];
    
     public static int dFS(int a,int b,int c){
      if(a<=0||b<=0||c<=0){
       return 1;
      }
      if(a>20||b>20||c>20){
       return dFS(20,20,20);
      }
      
      if(res[a][b][c]>0){
       return res[a][b][c];
      }
      
      if(a<b&&b<c){
       int temp=dFS(a,b,c-1)+dFS(a,b-1,c-1)-dFS(a,b-1,c);
       res[a][b][c]=temp;
       return temp;
      }else{
       int temp0=dFS(a-1,b,c)+dFS(a-1,b-1,c)+dFS(a-1,b,c-1)-dFS(a-1,b-1,c-1);
       res[a][b][c]=temp0;
       return temp0;
      }
     }
  public static void main(String[] args){
   Scanner in=new Scanner(System.in);
   while(in.hasNext()){
    
    
    
   }
   
      System.out.println(dFS(50,50,50));
     
 }

}

0 0