QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#135152#4430. Hidden PasswordSommohito#AC ✓27ms3920kbC++14833b2023-08-05 12:13:362023-08-05 12:13:39

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-08-05 12:13:39]
  • Judged
  • Verdict: AC
  • Time: 27ms
  • Memory: 3920kb
  • [2023-08-05 12:13:36]
  • Submitted

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#ifdef APURBA
#include "DEBUG_TEMPLATE.h"
#else
#define HERE
#define debug(args...)
#endif
#define ALL(x) x.begin(),x.end()

string go(string s, int d)
{
    for(int i=0;i<s.size();i++)
    {
        s[i] = (s[i] - 'a' + d + 26)%26 + 'a';
    }
    return s;
}

void TEST_CASES()
{
    string s;
    cin>>s;
    for(int d=1;d<=25;d++)
    {
        string t = go(s,d);
        if(s == go(t,d))
        {
            cout<<t<<"\n";
            return;
        }
    }
    cout<<"NIE\n";
}


/*
*/

int32_t main()
{
#ifndef APURBA
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
#endif
    int t=1;
    cin>>t;
    while(t--)
    {
        TEST_CASES();
    }
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 27ms
memory: 3920kb

input:

20
aeljltfjjqdplqkoevfocfopmigcwtdkehcbrrjrukkjnaozzbpxaiusphivkjbyqqwxyngvkczgilniutalgskhpbcpmwdbjdekkihyuoteiurjvhgixsehjxtqugjzwelxmjqbunoyofvgsomzwrsjrddrmjebpovwebpzmmdbgghyisvqlwalutpffxvypxfphdmnudyjdjsnyhgctmhpzmayzjodaezeoxgkuioqiquffjzndmdqsdjuxlyrviisvczkxeyhpxejksmtohxcfkghsiiiyiliehmks...

output:

nrywygswwdqcydxbrisbpsbczvtpjgqxrupoeewehxxwanbmmocknvhfcuvixwolddjklatixpmtvyavhgnytfxucopczjqowqrxxvulhbgrvhewiutvkfruwkgdhtwmjrykzwdohablbsitfbzmjefweqqezwrocbijrocmzzqottulvfidyjnyhgcsskilckscuqzahqlwqwfalutpgzucmznlmwbqnrmrbktxhvbdvdhsswmaqzqdfqwhkyleivvfipmxkrluckrwxfzgbukpsxtufvvvlvyvruzxfbsw...

result:

ok 20 lines

Extra Test:

score: 0
Extra Test Passed