2 views
24 Jan 2026
Input is a single token. If it can be converted to integer, output it. Otherwise output 0....
3 views
24 Jan 2026
Read two tokens. If both are integers, output their sum. If any is missing or not an integer, output ERROR....
2 views
24 Jan 2026
Read two integers a and b. Output a//b. If b is 0 output DIVIDE BY ZERO. If input is not valid, output ERROR....
2 views
24 Jan 2026
Read two integers a and b. Output a%b. If b is 0 output DIVIDE BY ZERO. If input is invalid, output ERROR....
3 views
24 Jan 2026
Read n integers and an index i (0-based). Output a[i]. If i is outside range or input is invalid, output OUT OF RANGE....
2 views
24 Jan 2026
Time string is provided in HH:MM. Output minutes since 00:00. If format is wrong or values are out of range, output INVALID....
2 views
24 Jan 2026
String s and position p are provided (0-based). Output character at that position. If p is not integer or out of range, output INVALID....
4 views
24 Jan 2026
Input is a single token. If it is a non-negative integer and perfect square output YES else NO. If input is invalid output NO....
4 views
24 Jan 2026
Read two integers a and b. Output a^b modulo 1000000007. If b is negative or input invalid, output ERROR....
2 views
24 Jan 2026
Input is a single token. If it is a number, output it with 2 decimals. Else output 0.00....
2 views
24 Jan 2026
Expression is provided as: a op b (space-separated). op can be + - * / %. Division is integer division. If op is invalid or division by zero happens, output ERROR....
3 views
24 Jan 2026
Read n tokens (may contain junk). Count how many tokens are valid integers and output the count....
2 views
24 Jan 2026
Read n tokens. Add only those tokens that are valid integers. Output the sum (0 if none valid)....
4 views
24 Jan 2026
Read n tokens. Multiply only valid integers and take modulo 1000000007. If no valid integers, output 0....
2 views
24 Jan 2026
Read a string num and base b (2 to 36). Convert num to decimal and output it. If conversion fails, output INVALID....
4 views
24 Jan 2026
Read a string, check if it is a valid IPv4 like A. B.C.D where each part is 0 to 255 and no empty parts. Output YES or NO....
2 views
24 Jan 2026
Read n numbers and q queries l r (0-based inclusive). For each query output sum. If query is out of range or invalid, output ERROR for that query....
2 views
24 Jan 2026
Read a list of tokens ending with END. Start sum=0. Add each token as integer. If a token is not integer (and not END), output BAD and stop. If all good, output sum....
3 views
24 Jan 2026
You will receive q commands: ADD x, SUB x, MUL x. Start value=0. If any command has invalid number or unknown op, output ERROR at line i (1-based) and stop. Else output final value....
3 views
24 Jan 2026
Read r c and then r lines of matrix. Some lines may have less than c numbers. Treat missing cells as 0. Output sum of each column....
2 views
24 Jan 2026
A phone number string is provided. Extract only digits and output them. If there are no digits, output INVALID....
2 views
24 Jan 2026
Read n tokens. Consider only valid integers, compute average and output floor value. If no valid integer, output 0....
3 views
24 Jan 2026
Read n lines with format key=value. Some lines may not have '=' or may be empty, ignore them. Then q queries keys. For each query output value or NOT FOUND....
4 views
24 Jan 2026
Date string is provided as dd-mm-yyyy. Output VALID if it is a real date (with leap year rules) else INVALID....
3 views
24 Jan 2026
Read string like a2b3c1 meaning aa bbb c. Output decoded string. If format is invalid (missing count or non-digit count), output ERROR....
3 views
24 Jan 2026
Expression contains integers, + - * / and parentheses. Division is integer division. If expression is invalid or division by zero occurs, output ERROR, else output result....
2 views
24 Jan 2026
You will receive q commands: BEGIN, COMMIT, ROLLBACK, SET k v, GET k. Implement nested transactions. GET prints value or NOT FOUND. If COMMIT/ROLLBACK is invalid, output ERROR and stop....
2 views
24 Jan 2026
Read n lines, each should be 'name amount'. amount must be integer. Sum valid amounts and count bad lines. Output total and badCount....
3 views
24 Jan 2026
Read n m and then m edges. Some edge lines may be broken or have nodes out of range. Ignore invalid edges. Output number of connected components in resulting graph....
3 views
24 Jan 2026
Read expression like 'a0 a1 a2... an | x'. Left side are ints separated by spaces. If any coefficient is invalid, output ERROR. Else evaluate polynomial at x using Horner and output....
2 views
24 Jan 2026
First line q. Next q lines have a b. For each line output a//b. If b is 0 or parsing fails, output ERROR for that line....
2 views
24 Jan 2026
Read a string containing brackets only: ()[]{}. If any other char is present, output ERROR. Else if brackets are balanced output YES else NO....
2 views
24 Jan 2026
Read n coordinate pairs. Each line should contain x y integers. If a line is invalid, treat it as 0 0. Output total distance travelled from (0,0) visiting points in order (Manhattan)....
2 views
24 Jan 2026
Read n tokens and integer k. Consider only tokens that are valid integers. If there are less than k valid integers, output ERROR. Else output sum of k largest valid integers....
3 views
24 Jan 2026
You will receive q commands: PUSHFRONT x, PUSHBACK x, POPFRONT, POPBACK. Start empty. On POP when empty, output ERROR and stop. Else after all commands output final deque as space-separated or EMPTY....