Morass

Print - Conquer

Mar 31st, 2016
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.19 KB | None | 0 0
  1. bool lth(int W,int K,int N,int*d,bool x=0){
  2.     int J(0),S;
  3.     F(K){
  4.         S=0;
  5.         while(J<N-(K-i-1)&&S+d[J]<=W)S+=d[J++];
  6.         if(x)printf("%d\n",S);
  7.     }
  8.     return J==N;
  9. }
Advertisement
Add Comment
Please, Sign In to add comment