3231 - I2P(I)2025_Chou_Hu_Lab2_ClassA Scoreboard

Time

2025/09/15 18:30:00 2025/09/15 20:30:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
14673 The Cipher of Vyasa Dev
14721 Gauranga Nityananda

14673 - The Cipher of Vyasa Dev   

Description

You’ve been unexpectedly transported back in time to an ancient world, long before the advent of modern technology. You’ve discovered that Vyasa Dev, a great figure from history, left behind crucial knowledge encoded in numbers. This knowledge was once thought to be too complex to decipher. The people of that time could not solve it because they lacked the tools and mathematical understanding required.

For generations, the encoded knowledge remained inaccessible, hidden in a series of numbers, each holding a piece of a great puzzle. But now, with your modern laptop and coding skills, the challenge is no longer impossible. What was once a monumental task can now be solved quickly with the power of technology.

 

                                    Open photo

 

The knowledge is hidden in the even indices of the number, and you must calculate the sum of these digits to solve the puzzle. Without your ability to code, this problem would have remained unsolved for centuries. But with your help, the knowledge Vyasa Dev left behind is finally within reach.

 

TASK: 

Find the sum of all EVEN indices (0-Indexed)

EXAMPLE:

Given the number 123456, the digits at the even indices (0, 2, 4) are:

  • Index 0: 1

  • Index 2: 3

  • Index 4: 5

The sum of these digits is: 1 + 3 + 5 = 9

Input

A single line of numbers.

Output

Sum of digits at even indices followed by a newline.

Sample Input  Download

Sample Output  Download

Tags




Discuss




14721 - Gauranga Nityananda   

Description

Gaura and Nitai were fascinated by how the world shifted with each action. To make things even more interesting, they decided to swap two sections of the string, one defined by indices l1..l2 and the other by r1..r2. They could see how the world adapted, still holding its essence while changing in form. It was a true lesson in balance, showing that even in change, everything could remain connected.

 

The Mercy of Sri Gaura and Sri Nityananda, May 31, Potomac ...

 

 

TASK: 
Given a string s and two pairs of indices l1..l2 and r1..r2, swap the substrings defined by these ranges. 

If the substrings are the same, return the original string.

 

EXPLANATION: 

For sample testcase 1
Substring 1 : 
"tyana"
Substring 2 : "auran"

So by switching the indices of the 2 substrings
"G" + "auran" + "ga Ni" + "tyana" + "nda"


For sample testcase 2
Substring 1 : 
"cdefg"
Substring 2 : "fghi"

So by switching the indices of the 2 substrings
"ab" + "fghi" + "cdefg" + "jklmnop"

Input

  • The first line contains the string s (may contain spaces).

  • The second line contains four non-negative integers: l1l2r1, and r2, separated by spaces. These define the inclusive indices of the two substrings to swap (zero-indexed) 

Constraints

  • l1 <= l2 <= len(s)
  • r1 <= r2 <= len(s)

Output

  • The modified string after swapping the substrings defined by the indices l1..l2 and r1..r2. The rest of the string should remain in the same order. (with a newline)

Sample Input  Download

Sample Output  Download

Tags




Discuss