Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

Grtting TLE For EQUATION

$
0
0

include <stdio.h>

include <iostream>

int main() {

int t; scanf("%d",&t);

while(t--) { long long int N,A,B,C,i,j; scanf("%lld %lld %lld %lld",&N,&A,&B,&C); long long int ans=0; for(i=0;i<=A;i++) for(j=0;j<=B;j++) if(i+j<=N) ans+=std::min(N+1-i-j,C+1);

printf("%lld\n",ans); } return 0; }


Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>