Click below to use Competitive Programming Helper
https://hetfadia.github.io/CompetitveProgrammingHelper/
Table of Contents
You can create Random Arrays, Random Permutations, Primes, PrimesCount, NextPrimes, PreviousPrimes, Prime Factors of Numbers in a Given Range, Random Trees of N nodes, Approx Time for a program, Memory used by a Program etc using this project.
The Generated output can be used to test a code, hack a code, debug a code easily and in no time.
The output can also determine the time the code would take when submitted so that we can determine whether it is TLE or not.
Using the above functionalities we can also simple test cases, worst test cases etc
Go to the github pages link
Enter the numbers or array size in the input boxes
The input boxes automatically evaluates the input.
You can see the output by pressing enter
Click on Generate button to generate the output(arrays or permutations or prime factors).
Click on clear button to reset the generated output.
The program automatically evaluates the input.
10**5Evaluated as pow(10,5)1e7Evaluated as 100000002*(10*3)/2Evaluated as its value ie. 30logstar(a,b)Evaluated as iterative logarithm of a to the base biterlog(a,b)Evaluated as iterative logarithm of a to the base bexp(3)Evaluated as e raised to 3= 20.08piEvaluated as pi(pi, Pi, PI, pI all works here)eEvaluated as e ie 2.73sin(1)Evaluated as sin of 1 radiancos(1)Evaluated as cos of 1 radiantan(1)Evaluated as tan of 1 radianpow(10,5)Evaluated as 10**5sqrt(100)Evaluated as 10cbrt(1000)Evaluated as 10log(1000)Evaluated as Math.log(1000)=6.9log2(1000)Evaluated as Math.log2(1000)=9.96log10(1000)Evaluated as Math.log10(1000)=3mex(a)Evaluated to the mex of the array a
The Program also evaluates these python features
pow(a,b,c)Evaluated as (a**b)%cchr(a)Evaluated as the character having ascii value aord(a)Evaluated as the ascii value of abin(a)Evaluated as string of binary representation of aoct(a)Evaluated as string of octal representation of ahex(a)Evaluated as string of hexadecimal representation of afloat(a)Evaluated as the float form of aint(a)Evaluated as the integral form of aint(a,0)Evaluated to integer form of a by automatically detecting base of aint(a,b)Evaluated to the value of a in base b (eg int("100",2)=4)len(a)Evaluated to the length of the objectfactorial(a)Evaluated to the factorial of the numbersort(a,key=itself,reverse=True)sorts the array according to key in the reverse arg. Here key and reverse are optionalsorted(a,key=itself,reverse=True)Returns the sorted form of array according to key in the reverse arg. Here key and reverse are optionalkeys(a)Returns the keys of the dictionary objectvalues(a)Returns the values of the dictionary objectbit_length(a)Returns the number of significant bits in the binary representation of the number aCounter(a)Returns the key value pair of the array acount(a,b)Returns the number of occurences of b in the array arangeReturns the list of python range functionlist(a)Returns list of the object areversed(a)Returns the reversed list of the object ajoin(a,b)Returns the "b".join(a) ie joins b within each consequitive items of acombinations(arr,len)Returns all the combinations of arr of size lencombinations_with_replacement(arr,len)Returns all the combinations of arr of size lenpermutations(arr,len)Returns all the permutations of arr of size lenproduct(arr,len)Returns all the products of arr with the repeat rbinBits(n,len=64)Returns the binary representation of n in len bits
The program also evaluates these c++ features
setb(a)Returns the count of 1 in the 64 bit binary representation of the number amsb(a)Returns the most significant bits in the 64 bit binary representation of the number arb(a)Returns the decimal value of rightmost bit in the 64 bit binary representation of the number arbm(a)Returns the rightmost bit in the 64 bit binary representation of the number asorta(a,key)Sorts the array a ascending according to key. Here key(default=ascending) is optionalsortd(a)Sorts the array a in descending order according to key. Here key(default=descending) is optional__gcd(a,b)Returns the gcd of a and b__builtin_popcountll(a)Returns the count of 1 in the 64 bit binary representation of the number a__builtin_parityll(a)Returns the parity of count of 1 in the 64 bit binary representation of the number a__builtin_clzll(a)Returns the number of leading zeros in the 64 bit binary representation of the number a__builtin_ctzll(a)Returns the number of trailing zeros in the 64 bit binary representation of the number ais_sorted(a)Returns true if a is ascending sorted else falsenext_permutation(a)a is next permutated and 1 is returned if a becomes sorted else 0prev_permutation(a)a is prev permutated and 1 is returned if a becomes reverse sorted else 0count_if(a,func,start,end)return the count of elements of a where func(element) satisfies. Start(default=0) and end(def=n) are optional
Many other expressions are also evaluated by writing Math.atan, Math.acos etc.
Thus any integer expression in any of the input boxes can be replaced by 1e7, log2(3) and the program will work fine.
Sieve Of Erantosthenes: Sieve is used to find whether Integers in a large interval are prime or not.
Sieve Prime Factorization(spf): SPF is used in the prime factorization of integers in a large interval.
Prufer Sequence is used to generate random tree.
The Program automatically detects whether SPF and Sieve can fasten the code. If they can save time using them then Sieve or SPF are used respectively.
The program input accepts integers as well as scientific notations.
The Test cases generator also gives a colored output.
The program input currently only generates array of integers in random integers.
For using string and characters in sort, you have to input manually like 'a' 'abc' 'str' 't'
Here are the few Screenshots









