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 <algorithm>
using namespace std;
char line[1024];
int main(){
int n;
fgets(line, sizeof(line), stdin);
sscanf(line,"%d",&n);
fgets(line, sizeof(line), stdin);
int sm = 0, cn = 0;
for(int i = 0; line[i] != '\0'; i++) {
if (line[i] == ' ' || line[i] == '\n' || line[i] == '\r') {
if (line[i] == '\n' || line[i] == '\r') break;
sm = 0;
cn = 0;
printf("%c", line[i]);
} else {
sm += line[i]-'a';
cn++;
if (cn == 2) {
printf("%c", (sm+26-n)%26+'a');
cn = sm = 0;
}
}
}
puts("");
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |