2 views
25 Jan 2026
Given an integer n, print EVEN or ODD....
2 views
25 Jan 2026
Given an integer n, print its absolute value....
2 views
25 Jan 2026
Print NEGATIVE, ZERO, or POSITIVE for an integer n....
2 views
25 Jan 2026
Print the last digit of an integer n (as a non-negative digit)....
2 views
25 Jan 2026
Check if a number is divisible by 3 and print YES/NO....
2 views
25 Jan 2026
Check if a number is divisible by 9 and print YES/NO....
2 views
25 Jan 2026
Check divisibility by 11 using digit positions rule....
2 views
25 Jan 2026
Given a decimal string s, decide if it represents a number divisible by 4....
2 views
25 Jan 2026
Given a decimal string s, decide if it represents a number divisible by 8....
2 views
25 Jan 2026
Given integer n, print YES if divisible by 25....
3 views
25 Jan 2026
Compare two fractions without floating point. Print , or =....
3 views
25 Jan 2026
Given integers a and b>0, print floor(a/b) and ceil(a/b)....
3 views
25 Jan 2026
Given integers a and m>0, print a mod m in range [0,m-1]....
2 views
25 Jan 2026
Given n and k>0, round n to nearest multiple of k (ties go up)....
3 views
25 Jan 2026
Given L R k, count integers in [L,R] divisible by k....
3 views
25 Jan 2026
Given n and k>0, print the smallest multiple of k that is >= n....
3 views
25 Jan 2026
Given n and k>0, print the largest multiple of k that is ...
2 views
25 Jan 2026
Given n, print YES if it is a power of 2....
3 views
25 Jan 2026
Given n>0, print the smallest power of 2 that is >= n....
3 views
25 Jan 2026
Given n>0, print how many bits are needed to write n in binary....
3 views
25 Jan 2026
Given a big number as string, print its digit sum modulo 9....
2 views
25 Jan 2026
Given a non-negative integer n (as string), print its digital root (0-9)....
2 views
25 Jan 2026
Given integer n, print YES if divisible by 6....
2 views
25 Jan 2026
Given integer n, print YES if divisible by 12....
3 views
25 Jan 2026
Given n and k, find the smallest non-negative x so (n+x) divisible by k....
2 views
25 Jan 2026
Given a and b, print the reduced ratio a:b....
2 views
25 Jan 2026
Given n...
2 views
25 Jan 2026
Given n...
3 views
25 Jan 2026
Check if n is a perfect number (sum of proper divisors equals n)....
3 views
25 Jan 2026
Given year y, print YES if it is a leap year....
4 views
25 Jan 2026
Compute gcd(a,b)....
2 views
25 Jan 2026
Compute lcm(a,b)....
3 views
25 Jan 2026
Given n and n integers, print gcd of all numbers....
2 views
25 Jan 2026
Given n...
2 views
25 Jan 2026
Print YES if gcd(a,b)=1....
2 views
25 Jan 2026
Given a/b, reduce it to lowest terms and keep sign in numerator....
2 views
25 Jan 2026
Given n numbers, print gcd of all |ai-a1|....
3 views
25 Jan 2026
Find x,y such that ax+by=gcd(a,b). Print gcd x y....
2 views
25 Jan 2026
Given a and m, print inverse of a mod m, or -1 if not exists....
2 views
25 Jan 2026
Given two numbers ...
2 views
25 Jan 2026
Given array and q queries [l,r], output gcd of all except between l..r....
3 views
25 Jan 2026
Given a and b, print YES if lcm(a,b)=a*b (no overlap factors)....
2 views
25 Jan 2026
Given n...
3 views
25 Jan 2026
Given n...
2 views
25 Jan 2026
Print YES if n is prime....
2 views
25 Jan 2026
Given n, print the smallest prime >= n....
2 views
25 Jan 2026
Given n>1, print its smallest prime factor....
2 views
25 Jan 2026
Print prime factors with exponents for n....
3 views
25 Jan 2026
Given n...
3 views
25 Jan 2026
Given even n (>=4), find two primes that sum to n....
2 views
25 Jan 2026
A semiprime has exactly two prime factors (counted with multiplicity). Print YES/NO....
3 views
25 Jan 2026
Given n, print how many distinct primes divide it....
6 views
25 Jan 2026
Print YES if n is squarefree (no prime square divides it)....
2 views
25 Jan 2026
Print the largest prime factor of n....
2 views
25 Jan 2026
Given n, find nearest primes below and above (p...
2 views
25 Jan 2026
Given a and m>0, output normalized a mod m in [0,m-1]....
2 views
25 Jan 2026
Compute (a+b) mod m for large a,b....
2 views
25 Jan 2026
Compute (a-b) mod m (non-negative)....
2 views
25 Jan 2026
Compute (a*b) mod m for up to 10^18 (use bigint idea)....
2 views
25 Jan 2026
Compute a^b mod m....
2 views
25 Jan 2026
Print YES if a and b are congruent mod m....
2 views
25 Jan 2026
Find the smallest x in [L,R] such that x ≡ a mod m, else -1....
2 views
25 Jan 2026
Solve x ≡ a (mod m), x ≡ b (mod n) when m and n are coprime....
5 views
25 Jan 2026
Given prime p and a not divisible by p, compute inverse a^(p-2) mod p....
2 views
25 Jan 2026
Count how many x in [0..m-1] satisfy ax ≡ b (mod m)....
2 views
25 Jan 2026
Compute nCr for small n (n...
2 views
25 Jan 2026
Compute nPr = n*(n-1)*...*(n-r+1)....
3 views
25 Jan 2026
Given n, count length-n binary strings with no '11'....
2 views
25 Jan 2026
If there are n people and everyone shakes hands once, how many handshakes?...
2 views
25 Jan 2026
Choose r people from n and also pick a captain from chosen team....
2 views
25 Jan 2026
Count solutions of x1+...+xk = n with xi>=0....
2 views
25 Jan 2026
Given n and k, count k-sized subsets....
2 views
25 Jan 2026
Compute sum_{i=0..k} C(n,i) for given n,k....
2 views
25 Jan 2026
Count ways to arrange n distinct items on a circle....
2 views
25 Jan 2026
Compute number of derangements for n...
2 views
25 Jan 2026
Given n tosses, probability of exactly k heads as reduced fraction....
2 views
25 Jan 2026
Expected sum of rolling one fair die....
2 views
25 Jan 2026
Given n independent trials with success probability p (as a/b), find prob of at least one success....
2 views
25 Jan 2026
Probability that sum of two fair dice equals S....
2 views
25 Jan 2026
A bag has r red and b blue balls. One ball is drawn. Prob it is red....
2 views
25 Jan 2026
Evaluate a boolean expression with AND/OR/NOT on 0/1 values....
2 views
25 Jan 2026
Given X and Y (0/1), compute NOT(X AND Y) and (NOT X) OR (NOT Y) and verify equality....
2 views
25 Jan 2026
Given bits a and b, print a XOR b....
2 views
25 Jan 2026
How many rows in truth table for n boolean variables?...
2 views
25 Jan 2026
Given bits p and q, compute p -> q....
2 views
25 Jan 2026
Given n and a list of pairs (a,b), check if relation is reflexive....
2 views
25 Jan 2026
Given sizes |A|,|B| and |A∩B|, compute |A∪B|....
2 views
25 Jan 2026
How many functions from set of size n to set of size m?...
3 views
25 Jan 2026
Count injective functions from n to m (n...
2 views
25 Jan 2026
Count surjections from n to m for small n,m (...
3 views
25 Jan 2026
Compute the n-th Fibonacci number (0-indexed)....
2 views
25 Jan 2026
Given a1,d,n find n-th term....
2 views
25 Jan 2026
Given a,r,n,m compute a*r^(n-1) mod m....
2 views
25 Jan 2026
Given f0,f1 and f(n)=f(n-1)+2f(n-2), compute f(n)....
2 views
25 Jan 2026
Given degrees of all vertices, print YES if sum of degrees is even....
2 views
25 Jan 2026
Given sum of degrees S, compute number of edges E....
2 views
25 Jan 2026
Given number of nodes n in a tree, print number of edges....
2 views
25 Jan 2026
In complete bipartite K(a,b), how many edges?...
3 views
25 Jan 2026
Compute the n-th Catalan number for n...
2 views
25 Jan 2026
Given height h (root at height 0), print min and max nodes in a binary tree....
2 views
25 Jan 2026
In a full binary tree, leaves = internal+1. Given internal nodes i, print leaves....
2 views
25 Jan 2026
Multiply two 2x2 matrices....
2 views
25 Jan 2026
Compute determinant of 2x2 matrix....
2 views
25 Jan 2026
Given n and an n x n matrix, print its trace....
2 views
25 Jan 2026
Compute dot product of two vectors....
2 views
25 Jan 2026
Given two 2D vectors, print ACUTE/RIGHT/OBTUSE....
2 views
25 Jan 2026
Compute Euclidean distance between two points (x1,y1),(x2,y2) with 2 decimals....
3 views
25 Jan 2026
Compute area of triangle from 3 points (2D)....
2 views
25 Jan 2026
Given n decimals, sum them and print with 6 decimals (show stable summation idea)....