CF858E.Tests Renumeration

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

The first line contains single integer nn ( 1<=n<=1051<=n<=10^{5} ) — the number of files with tests.

nn lines follow, each describing a file with test. Each line has a form of "name_i type_i", where "name_i" is the filename, and "type_i" equals "1", if the ii -th file contains an example test, and "0" if it contains a regular test. Filenames of each file are strings of digits and small English letters with length from 11 to 66 characters. The filenames are guaranteed to be distinct.

输入格式

In the first line print the minimum number of lines in Vladimir's script file.

After that print the script file, each line should be "move file_1 file_2", where "file_1" is an existing at the moment of this line being run filename, and "file_2" — is a string of digits and small English letters with length from 11 to 66 .

输出格式

输入输出样例

  • 输入#1

    5
    01 0
    2 1
    2extra 0
    3 1
    99 0
    

    输出#1

    4
    move 3 1
    move 01 5
    move 2extra 4
    move 99 3
    
  • 输入#2

    2
    1 0
    2 1
    

    输出#2

    3
    move 1 3
    move 2 1
    move 3 2
  • 输入#3

    5
    1 0
    11 1
    111 0
    1111 1
    11111 0
    

    输出#3

    5
    move 1 5
    move 11 1
    move 1111 2
    move 111 4
    move 11111 3
    
首页