Skip to content

Instantly share code, notes, and snippets.

@rogerioagjr
Last active June 9, 2016 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rogerioagjr/3739042e929ba6417214578f689964c7 to your computer and use it in GitHub Desktop.
Save rogerioagjr/3739042e929ba6417214578f689964c7 to your computer and use it in GitHub Desktop.
Exemplo 1 - Sanduíche
for(int i=1;i<=n;i++)
for(int j=i;j<2*n && prefix[j+1]-prefix[i-1]<=d){
j++;
if(prefix[j]-prefix[i-1]==d) resp++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment