QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#22816. Ujemne podstawy

Statistics

Ujemne podstawy są jak dodatnie, lecz co druga waga pozycji jest ujemna.

Siedem w dodatniej podstawie dwa to $111_2$. W podstawie minus dwa $7$ to $11011_{-2}$, ponieważ $1\cdot16+1\cdot(-8)+0\cdot4+1\cdot(-2)+1=7$.

Ujemne podstawy przedstawiają dodatnie i ujemne liczby bez znaku. W tym zadaniu takie zapisy nie używają znaku. Zamień zwykłą liczbę całkowitą na daną podstawę.

Wejście

Jeden wiersz z $N$ i $B$: $-30000\le N\le30000$ to liczba w podstawie $10$ do konwersji; nowa podstawa spełnia $-10\le B\le-2$ lub $2\le B\le10$.

Wyjście

Jeden wiersz z zapisem $N$ w podstawie $B$.

Przykład

Wejście 1

7 -2

Wyjście 1

11011

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.