連結リストを反転する

与えられたリンクドリストを反転させ、最終的に反転されたリンクドリストを出力してください。

入力

入力はプログラムによって自動的に処理されるため、特に何もする必要はありません。

出力

プログラムは反転後のリンクドリストを出力してください。

入力
出力
5 4 5 6 1 -4
-4 1 6 5 4
 

Constraints

Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue