CSES - Datatähti 2018 loppu - Results
Submission details
Task:Tanssiaiset
Sender:SeveriK
Submission time:2018-01-18 16:28:55 +0200
Language:C++
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimegroup
#10.20 s1details
#20.20 s1details
#30.20 s1details
#40.20 s1details
#50.20 s1details
#60.20 s2details
#70.20 s2details
#80.19 s2details
#90.19 s2details
#100.19 s2details

Code

#include <iostream>
#include <cmath>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
    string input;

    cin >> input;

    vector<int> abNums;
    vector<int> nums;

    for(int i = 0; i < 26; i++)
    {
        abNums.push_back(i + 1);
        if(input[i] == 'A')
        {
            nums.push_back(1);
        }
        else if(input[i] == 'B')
        {
            nums.push_back(2);
        }
        else if(input[i] == 'C')
        {
            nums.push_back(3);
        }
        else if(input[i] == 'D')
        {
            nums.push_back(4);
        }
        else if(input[i] == 'E')
        {
            nums.push_back(5);
        }
        else if(input[i] == 'F')
        {
            nums.push_back(6);
        }
        else if(input[i] == 'G')
        {
            nums.push_back(7);
        }
        else if(input[i] == 'H')
        {
            nums.push_back(8);
        }
        else if(input[i] == 'I')
        {
            nums.push_back(9);
        }
        else if(input[i] == 'J')
        {
            nums.push_back(10);
        }
        else if(input[i] == 'K')
        {
            nums.push_back(11);
        }
        else if(input[i] == 'L')
        {
            nums.push_back(12);
        }
        else if(input[i] == 'M')
        {
            nums.push_back(13);
        }
        else if(input[i] == 'N')
        {
            nums.push_back(14);
        }
        else if(input[i] == 'O')
        {
            nums.push_back(15);
        }
        else if(input[i] == 'P')
        {
            nums.push_back(16);
        }
        else if(input[i] == 'Q')
        {
            nums.push_back(17);
        }
        else if(input[i] == 'R')
        {
            nums.push_back(18);
        }
        else if(input[i] == 'S')
        {
            nums.push_back(19);
        }
        else if(input[i] == 'T')
        {
            nums.push_back(20);
        }
        else if(input[i] == 'U')
        {
            nums.push_back(21);
        }
        else if(input[i] == 'V')
        {
            nums.push_back(22);
        }
        else if(input[i] == 'W')
        {
            nums.push_back(23);
        }
        else if(input[i] == 'X')
        {
            nums.push_back(24);
        }
        else if(input[i] == 'Y')
        {
            nums.push_back(25);
        }
        else if(input[i] == 'Z')
        {
            nums.push_back(26);
        }
    }

    while(nums != abNums)
    {
        if(nums[0] != nums[1] - 1)
        {
            if(nums[0] < nums[1])
            {
                nums.insert(nums.begin(), nums[nums.size() - 1]);
                nums.pop_back();
                cout << "MOVE" << "\n";

                int a = nums[0];
                nums[0] = nums[1];
                nums[1] = a;

                cout << "SWAP" << "\n";
            }
            else
            {
                int a = nums[0];
                nums[0] = nums[1];
                nums[1] = a;

                cout << "SWAP" << "\n";
            }
        }
    }

    return 0;
}

Test details

Test 1

Group: 1

Verdict:

input
100
79 22
53 70
7 23
91 26
...

correct output
75 45

user output
(empty)

Test 2

Group: 1

Verdict:

input
100
71 84
54 25
91 34
98 30
...

correct output
27 49

user output
(empty)

Test 3

Group: 1

Verdict:

input
100
74 68
86 10
83 56
31 87
...

correct output
67 2

user output
(empty)

Test 4

Group: 1

Verdict:

input
100
85 43
95 8
53 1
29 86
...

correct output
54 60

user output
(empty)

Test 5

Group: 1

Verdict:

input
100
71 69
74 45
8 95
12 32
...

correct output
5 7

user output
(empty)

Test 6

Group: 2

Verdict:

input
100000
95086 86958
87818 74731
27185 49356
54360 7043
...

correct output
60551 58365

user output
(empty)

Test 7

Group: 2

Verdict:

input
100000
14011 98742
82421 87350
55194 56454
90097 92904
...

correct output
50997 58566

user output
(empty)

Test 8

Group: 2

Verdict:

input
100000
72139 85248
98125 85461
39422 60426
45770 13451
...

correct output
50397 41760

user output
(empty)

Test 9

Group: 2

Verdict:

input
100000
32124 96365
8819 68067
90795 31927
45745 64571
...

correct output
56735 39394

user output
(empty)

Test 10

Group: 2

Verdict:

input
100000
70709 61209
69548 3671
2215 57335
2539 71294
...

correct output
69366 23793

user output
(empty)