#include <stdio.h>
#include <iostream>
#include <string>
#include <map>
#include <queue>
#include <set>
#include <vector>
using namespace std;
int main(void){
int n;
scanf("%d", &n);
string tmp_str;
cin>>tmp_str;
char input_str[2000];
gets(input_str);
string full_str = tmp_str + input_str;
while(true){
if(full_str.length() <= 1){
break;
}
if(full_str[1] == ' '){
printf(" ");
full_str = full_str.substr(2);
continue;
}
if(full_str[0] == ' '){
printf(" ");
full_str = full_str.substr(1);
continue;
}
int first, end;
first = full_str[0] - 'a';
end = full_str[1] - 'a';
int modu = (first+end-n);
if(modu < 0){
modu += 26;
}
modu = modu%26;
printf("%c", 'a'+modu);
full_str = full_str.substr(2);
}
printf("\n");
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
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 |
Correct |
0 ms |
1676 KB |
Output is correct |
8 |
Correct |
0 ms |
1676 KB |
Output is correct |
9 |
Correct |
0 ms |
1676 KB |
Output is correct |
10 |
Correct |
0 ms |
1676 KB |
Output is correct |
11 |
Correct |
0 ms |
1676 KB |
Output is correct |
12 |
Correct |
0 ms |
1676 KB |
Output is correct |
13 |
Correct |
0 ms |
1676 KB |
Output is correct |
14 |
Correct |
0 ms |
1676 KB |
Output is correct |
15 |
Correct |
0 ms |
1676 KB |
Output is correct |
16 |
Correct |
0 ms |
1676 KB |
Output is correct |
17 |
Correct |
0 ms |
1676 KB |
Output is correct |
18 |
Correct |
0 ms |
1676 KB |
Output is correct |
19 |
Correct |
0 ms |
1676 KB |
Output is correct |
20 |
Correct |
0 ms |
1676 KB |
Output is correct |
21 |
Correct |
0 ms |
1676 KB |
Output is correct |
22 |
Correct |
0 ms |
1676 KB |
Output is correct |
23 |
Correct |
0 ms |
1676 KB |
Output is correct |
24 |
Correct |
0 ms |
1676 KB |
Output is correct |
25 |
Correct |
0 ms |
1676 KB |
Output is correct |
26 |
Correct |
0 ms |
1676 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
1672 KB |
open (syscall #2) was called by the program (disallowed syscall) |
2 |
Halted |
0 ms |
0 KB |
- |