22611_Reverse

2022-5-16 18:22| 发布者: Hocassian| 查看: 20| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506783334600-Problem List-采集的数据-后羿采集器.html

Pro.ID

22611

Title

Reverse

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22611

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 3000/1000 MS (Java/Others)     Memory Limit: 131072/65536 K (Java/Others)
  • 描述

    Consider a Two-Operation Machine (TOM for short) with nine registers, numbered 1…9. Each register stores a non-negative integer in the range 0…1000. The machine has two operations:

    A TOM program includes a set of initial values for the registers and a sequence of operations. Given an integer N ( 0 <= N <= 255 ), generate a TOM program that prints the decreasing sequence of integers N, N-1, N-2, …, 0. The maximum number of consecutive S-operations should be as small as possible.

    Example of a TOM program and its execution for N=2:

    Input cases are numbered 1 through 16 and are available via the contest server.

    输入

    The first line of the input file contains K, an integer specifying the input case number.

    The second line of input contains N.

    输出

    Description

    Consider a Two-Operation Machine (TOM for short) with nine registers, numbered 1…9. Each register stores a non-negative integer in the range 0…1000. The machine has two operations:

    A TOM program includes a set of initial values for the registers and a sequence of operations. Given an integer N ( 0 <= N <= 255 ), generate a TOM program that prints the decreasing sequence of integers N, N-1, N-2, …, 0. The maximum number of consecutive S-operations should be as small as possible.

    Example of a TOM program and its execution for N=2:

    Input cases are numbered 1 through 16 and are available via the contest server.

    Input

    The first line of the input file contains K, an integer specifying the input case number.

    The second line of input contains N.

    Output

    The first line of output should be the string “FILE reverse K”, where K is the case number.

    The second line of output should contain nine space-separated values representing the desired initial values of the registers, in order (register 1, then register 2, etc.).

    The rest of the output file should contain the ordered list of operations to be performed, one per line. Thus, the third line contains the first operation to perform, and so on. The last line of the file should be the one that prints 0. Each line should be a valid operation. The instructions should be formatted as in the example output.

    Sample Input
    1
    2
    Sample Output
    FILE reverse 1
    0 2 1 0 0 0 0 0 0
    P 2
    P 3
    P 1
    Source

    样例输入

    1
    2

    样例输出

    FILE reverse 1
    0 2 1 0 0 0 0 0 0
    P 2
    P 3
    P 1

    提示

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部