diff --git a/2.c b/2.c new file mode 100644 index 0000000..1151612 --- /dev/null +++ b/2.c @@ -0,0 +1,39 @@ +#include +int main() +{ +long long int N; +long long int i,j,k,l,sum=1; +long long int count[1000001]; +scanf("%lld",&N); +long long int ip[N]; + +for(i=0;i=2) + { + + count[ip[i]]--; + i++; + } + else + { + + l=j-i+1; + sum+=((l*(l+1))/2); + j++; + if (j