QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#73298#1300. KleptographyxinchengoWA 2ms3492kbC++14476b2023-01-23 16:46:322023-01-23 16:46:35

Judging History

This is the latest submission verdict.

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-01-23 16:46:35]
  • Judged
  • Verdict: WA
  • Time: 2ms
  • Memory: 3492kb
  • [2023-01-23 16:46:32]
  • Submitted

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'