이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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) % 26;
char d = c + 'a';
ret.push_back(d);
}
if (count != 0) {
std::cout << " ";
}
std::cout << ret;
++count;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |