Skip to content

Instantly share code, notes, and snippets.

@zsrinivas
Created May 21, 2014 04:11
Show Gist options
  • Save zsrinivas/cd7eb3165ce65a57ad46 to your computer and use it in GitHub Desktop.
Save zsrinivas/cd7eb3165ce65a57ad46 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
inline int get_int()
{
int n=0;
char c=0;
while(c<33)
c=getchar_unlocked();
while(c>='0'&&c<='9')
{
n=(n<<3)+(n<<1)+(c-'0');
c=getchar_unlocked();
}
return n;
}
int main(int argc, char const *argv[])
{
int i,tesc,n;
int qi,min;
tesc=get_int();
while(tesc--)
{
n=get_int();
min=0;
for (i = 0; i < n; ++i)
{
qi=get_int();
min=min>(qi+i)?min:(qi+i);
}
printf("%d\n", min);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment