Submission #13559

#TimeUsernameProblemLanguageResultExecution timeMemory
13559baneling100Veni, vidi, vici (kriii2_V)C++98
4 / 4
0 ms1084 KiB
#include <stdio.h> #include <string.h> #define L_MAX 101 #define MOD 26 int N, L; char S[L_MAX+1]; int mod(int num) { while(num<0) num+=MOD; while(num>=MOD) num-=MOD; return num; } int main(void) { int i; scanf("%d",&N); while(scanf("%s",S)==1) { L=strlen(S); for(i=0 ; i<L ; i++) S[i]-='a'; if(L%2) L--; for(i=0 ; i<L ; i+=2) printf("%c",mod(S[i]+S[i+1]-N)+'a'); printf(" "); } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...