Submission #9193

# Submission time Handle Problem Language Result Execution time Memory
9193 2014-09-28T04:30:44 Z corea Veni, vidi, vici (kriii2_V) C++14
0 / 4
0 ms 1676 KB
#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) {
					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
1 Correct 0 ms 1676 KB Output is correct
2 Correct 0 ms 1676 KB Output is correct
3 Correct 0 ms 1676 KB Output is correct
4 Correct 0 ms 1676 KB Output is correct
5 Correct 0 ms 1676 KB Output is correct
6 Correct 0 ms 1676 KB Output is correct
7 Incorrect 0 ms 1676 KB Output isn't correct
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -