Hanpan home
Hanpan Studio home
Hanpan
·STUDIO
HanpanProblemsContestsSubmissionsRankingEvents
My problemsMy contests
StatementPlaySubmit textLeaderboardSubmissions
Rank #1
M
Bronze IIImotsuni04
says
87pts
“ichihime”
Challenge #8

Ran's Dungeon

Participant time limit
5,000 ms
Memory limit
512 MB
Submissions
834
Participants
26
On this page
  • Problem
  • Input
  • Example
  • Sample code

Problem

Ran's Dungeon is a single-player luck game in which you enter any single line of text, and the luck that line brings carries Ran up the dungeon. Words cheering Ran on are fine, and so is something silly that just popped into your head. All the luck in a run, from dice rolls to chest grades and item effects, is decided by that one line.

Once you enter a line, Ran climbs the dungeon automatically. Battles and item pickups all happen automatically, and you score points based on the floor Ran reaches.

1. A Line Full of Luck

Enter whatever you like as a single line. It does not have to be a complete sentence. Short words, numbers, and punctuation are also allowed.

  • Write a short line that is not too long. If you enter only spaces or text that is too long, the game cannot start. Specifically, you can use up to 212121 characters if you write only in Korean (Hangul), and up to 646464 characters if you use only English letters or digits.
  • Spaces at the start and end of the line are removed. Spaces in the middle are kept as they are.
  • The same line always produces the same adventure.
  • Which line brings which luck is a secret.

A great-sounding line does not always bring a good result. An unexpected phrase might carry Ran all the way to the top.

2. Ran

Ran starts with no items, 101010 attack, 100100100 health, and 100100100 maximum health. Ran's starting luck is an integer between −20-20−20 and 202020 inclusive, determined by the line you enter.

  • Ran grows stronger on entering each new floor, including floor 111. By default, attack and maximum health rise a little each time, and items change how much Ran grows.
  • Items change stats such as attack, maximum health, and luck, as well as the way Ran fights. Item effects are applied automatically.
  • The higher the luck, the easier it is for Ran to roll good numbers on the dice. Luck has no effect while it is 000 or less, and if the starting luck is negative, luck gained from items first has to make up the shortfall before it takes effect.

The dice used in the game show numbers from 111 to 666.

3. Floors and Bosses

The dungeon runs from floor 111 to floor 100100100. A boss waits on every floor that is a multiple of 101010, and monsters wait on all other floors. The higher the floor, the higher the opponents' base stats.

Floor Boss Traits
Floors 101010, 303030, 505050, 707070 Asta High health and relatively low attack.
Floors 202020, 404040, 606060, 808080 Maki Relatively low health and high attack.
Floor 909090 All Officers Assemble A single boss battle in which Asta and Maki appear together.
Floor 100100100 Laplace The final boss.

If Ran falls and can no longer revive, the adventure ends on that floor. If a battle is still undecided after 2,0002{,}0002,000 clashes, it counts as a loss for Ran.

4. Chests and Items

Chest grades, from lowest to highest, are Wood, Silver, Gold, Rainbow. By default, higher-grade chests appear more rarely, and each grade offers different items.

When you obtain most items, two dice are rolled to set the enhancement level of the effect. The general rules are as follows.

Sum of the two dice Result
222 The effect is reversed.
333 or 444 The effect is weaker than the base effect.
555 to 999 The base effect applies.
101010 or 111111 The effect is enhanced.
121212 The effect is enhanced even more, and extra dice are rolled.

If the sum is 121212, two more dice are rolled. If the sum of the two extra dice is 101010 or more, the enhancement level goes up one more step and two dice are rolled again. The extra rolls end when the sum is 999 or less or the enhancement cap is reached. How the enhancement level is reflected in the actual effect differs by item.

If luck adds an extra die, the sum of the two highest of the three dice is used.

When an item is obtained, a mutation may occur with a certain probability, changing its name, appearance, and effect. Luck also affects the chance of item mutation.

5. End of a Run and Scoring

A run ends when Ran loses a battle or defeats Laplace on floor 100100100.

Outcome Score
Ran is defeated on floor fff fff points
Defeat Laplace on floor 100100100 and clear the dungeon 101101101 points
The input breaks the rules 000 points

The floor where Ran falls also counts as a floor reached. For example, falling on floor 373737 gives 373737 points, and reaching floor 100100100 without defeating Laplace gives 100100100 points. If the input breaks the rules, the run does not start.

How far will your line take Ran? Find the lucky line that reaches the highest floor!

※ Some items in this problem are fan creations that parody Touhou Project and other works, and they are not official content of the original works.

Input

CODE is the signal that means “Please send the line to use for this adventure.” When you receive this signal, send one line of your choice.

Command Judge→Player (input) Player→Judge (output) Time limit (ms) Description
CODE CODE One line of text 1,0001{,}0001,000 Send the line that decides the luck of this adventure.
  • CODE is given only once, at the start of the game. You only need to respond once as well.
  • Your response can be any sentence, short word, number, and so on.
  • You can enter up to 212121 characters using only Korean (Hangul), or up to 646464 characters using only English letters or digits.
  • When mixing them, one Hangul character takes up as much room as three English letters. A space takes up as much room as one English letter, and emoji or other symbols may take up more room depending on the kind.
  • Spaces at the start and end of the line are removed, and spaces in the middle are kept as they are. You cannot send only spaces.
  • Do not split the line into several lines or put a tab in the middle of it. End the line with a newline so that the response is sent right away.
  • If you do not respond within 111 second of receiving the request, or you send something that breaks the input rules, the game does not start and your score is 000 points.

The time limit applies to the time from receiving the CODE request to sending your response. After your line is received, Ran's adventure proceeds automatically with no further requests.

Example

Each row below is an example from a different run. In one run, you answer the CODE request only once.

Judge→Player input Player→Judge output
CODE 란아 오늘은 꼭대기까지 가자

You can use a Korean sentence, or a short phrase that combines English letters and digits. After sending the line, you do not choose any further actions.

Sample code

  • CPP20 : main.cpp
  • PYTHON3, PYPY3 : main.py

Author

  • lll
    Bronze Vlll
PlaySubmit text
© 2026 hanpan
Privacy Policy

Tier icons are copyrighted by solved.ac. This service is not affiliated with solved.ac.