Submission #9279

# Submission time Handle Problem Language Result Execution time Memory
9279 2014-09-28T05:20:16 Z roott76 Veni, vidi, vici (kriii2_V) C++
0 / 4
0 ms 1676 KB
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int main()
{
	int n;
	cin >> n;

	char in[100200];
	gets(in);

	int len = strlen(in), s = 0, e = 0;
	for(int i=0; i<len; i++)
	{
		if(in[i] == ' ')
		{
			e = i;
			if((e-s)%2) e--;

			for(int j=s; j<e; j+=2)
			{
				cout << char(((in[j]-'a')+(in[j+1]-'a') - n) % 26 + 'a');
			}
			cout << " ";
			s = i+1;
		}
	}
	e = len;
	if((e-s)%2) e--;
	for(int i=s; i<e; i+=2)
	{
		cout << char(((in[i]-'a')+(in[i+1]-'a') - n) % 26 + 'a');
	}
	cout << endl;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1676 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -