Task: | Merkkijono |
Sender: | SeveriK |
Submission time: | 2018-01-18 16:33:36 +0200 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.03 s | details |
#2 | OUTPUT LIMIT EXCEEDED | 0.00 s | details |
#3 | OUTPUT LIMIT EXCEEDED | 0.00 s | details |
#4 | OUTPUT LIMIT EXCEEDED | 0.00 s | details |
#5 | OUTPUT LIMIT EXCEEDED | 0.00 s | details |
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"; } } else { nums.insert(nums.begin(), nums[nums.size() - 1]); nums.pop_back(); cout << "MOVE" << "\n"; } } return 0; }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
ABCDEFGHIJKLMNOPQRSTUVWXYZ |
correct output |
---|
0 |
user output |
---|
(empty) |
Test 2
Verdict: OUTPUT LIMIT EXCEEDED
input |
---|
ZYXWVUTSRQPONMLKJIHGFEDCBA |
correct output |
---|
923 MOVE MOVE SWAP MOVE ... |
user output |
---|
(empty) |
Test 3
Verdict: OUTPUT LIMIT EXCEEDED
input |
---|
RPJMFWBHYQOTXUAENLDGZISCVK |
correct output |
---|
611 SWAP MOVE MOVE SWAP ... |
user output |
---|
(empty) |
Test 4
Verdict: OUTPUT LIMIT EXCEEDED
input |
---|
GWJSPBHANMXYFLKIDORVUCEZQT |
correct output |
---|
659 MOVE SWAP MOVE SWAP ... |
user output |
---|
(empty) |
Test 5
Verdict: OUTPUT LIMIT EXCEEDED
input |
---|
BJYNFLKEIUCZMQHRAXOGWPSDTV |
correct output |
---|
624 MOVE SWAP MOVE SWAP ... |
user output |
---|
(empty) |