QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#73298 | #1300. Kleptography | xinchengo | WA | 2ms | 3492kb | C++14 | 476b | 2023-01-23 16:46:32 | 2023-01-23 16:46:35 |
Judging History
answer
#include<iostream>
using namespace std;
enum limits
{
maxn = 30, maxm = 100
};
int n, m;
char p[maxn + 7], c[maxm + 7];
int main()
{
cin >> n >> m >> (p+1) >> (c+1);
for(int i=m; i>m-n; i--)
p[i] = p[i-m+n] - 'a';
for(int i=1; i<=m; i++)
c[i] -= 'a';
for(int i=m; i>n; i--)
p[i-n] = (c[i] - p[i] + 26) % 26;
for(int i=1; i<=m; i++)
p[i] += 'a';
p[m+1] = '\n', p[m+2] = '\0';
cout << (p+1);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3492kb
input:
2 6 zz zzjazz
output:
jaaazz
result:
ok single line: 'jaaazz'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3272kb
input:
3 6 bye aaacwi
output:
byebye
result:
ok single line: 'byebye'
Test #3:
score: 0
Accepted
time: 2ms
memory: 3492kb
input:
3 5 spy vsspy
output:
aaspy
result:
ok single line: 'aaspy'
Test #4:
score: -100
Wrong Answer
time: 2ms
memory: 3320kb
input:
30 100 orinviduntutlaboreetdoloremagn locmccnsgquoegvvlbayzhniclytemffjepqekwuqupzzlzlephbcaagrnqryzjmrliwoxbxmydbumrwxblmoceyqrhwcafhfesc
output:
loremipsumdolorsitametconsetetur\x12
result:
wrong answer 1st lines differ - expected: 'loremipsumdolorsitametconsetet...porinviduntutlaboreetdoloremagn', found: 'loremipsumdolorsitametconsetetur\x12'