This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <cstdio>
#include <string>
#include <sstream>
#include <vector>
#include <iostream>
using namespace std;
int n;
vector<string> a;
void go() {
int P[26][26];
for(int x = 0; x < 26; ++ x) {
for(int y = 0; y < 26; ++ y) {
for(int z = 0; z < 26; ++ z) {
if(x % 26 == (y + z - n + 26) % 26) {
P[y][z] = x;
}
}
}
}
for(string &s : a) {
for(int i=0; i+1<(int) s.length(); i += 2) {
int y = s[i] - 'a';
int z = s[i+1] - 'a';
int x = P[y][z];
printf("%c", x + 'a');
}
printf(" ");
}
}
int main() {
while(cin >> n) {
string s;
while(cin >> s) {
a.push_back(s);
}
go();
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |