QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 1024 MB Total points: 100 Hackable ✓

#18888. A plus gleich B

Statistics

$A+B$ ist eine Aufgabe, mit der die Grundkenntnisse im Wettbewerbsprogrammieren geprüft werden. Hier ist noch eine langweilige Variante davon.

Du hast zwei ganze Zahlen, $A$ und $B$. Du möchtest sie gleich machen. Dazu kannst du mehrere Schritte ausführen, wobei jeder Schritt eine der folgenden Operationen ist:

  • $A$+= $A$
  • $A$+= $B$
  • $B$+= $A$
  • $B$+= $B$

Leider ist $A+B$ für uns eine schwierige Aufgabe, daher darfst du höchstens 5000 Schritte ausführen.

Eingabe

Gegeben sind zwei ganze Zahlen $A, B$. ($1 \le A, B \le 10^{18}$).

Ausgabe

Gib in der ersten Zeile eine einzelne ganze Zahl $n$ ($0 \le n \le 5000$) aus, die die Anzahl der Schritte angibt.

Gib in den nächsten $n$ Zeilen jeweils eine der folgenden Zeichenketten aus, um die gewünschte Operation anzugeben: "A+=A", "A+=B", "B+=A" oder "B+=B".

Jede Schrittfolge, die das gewünschte Ergebnis liefert, wird als korrekt gewertet.

Beispiele

Eingabe 1

2 3

Ausgabe 1

4
B+=B
B+=A
A+=A
A+=A

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.