Submission #9336

#TimeUsernameProblemLanguageResultExecution timeMemory
9336dolpang2Veni, vidi, vici (kriii2_V)C++14
0 / 4
0 ms1676 KiB
#include <cstdio> #include <iostream> #include <string> int main() { int n = 0; scanf(" %d", &n); std::string word; int count = 0; while (std::cin >> word) { std::string converted; if (word.size() % 2 == 1) { for (size_t i = 0; i < word.size() - 1; ++i) { converted.push_back(word[i]); } } else { converted = word; } std::string ret; for (size_t i = 0; i < converted.size(); i += 2) { char a = converted[i] - 'a'; char b = converted[i + 1] - 'a'; int c = (a + b - n) % 26; char d = c + 'a'; ret.push_back(d); } if (count != 0) { std::cout << " "; } std::cout << ret; ++count; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...