QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#661961#4430. Hidden PasswordkircoAC ✓0ms4292kbC++23739b2024-10-20 19:29:102024-10-20 19:29:11

Judging History

你现在查看的是最新测评结果

  • [2024-10-20 19:29:11]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:4292kb
  • [2024-10-20 19:29:10]
  • 提交

answer

#include <bits/stdc++.h>
#define int long long
#define endl "\n"
#define iosy ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define rop(i,a,n) for(int i=a;i<n;i++)
using namespace std;
const int inf = 0x3f3f3f3f3f3f3f3fLL;
const int N = 2e5+10;
const int MOD = 1e9+7;

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

void solve(){
	string s;cin>>s;
	// if(s.size()==1){
	// 	cout<<"NIE\n";
	// 	return;
	// }
	string ans=shift(s);
	if(shift(ans)==s)cout<<ans<<"\n";
	else cout<<"NIE\n";
}

signed main(){
	iosy;
	int _t=1;
	cin>>_t;
	while(_t--){
		solve();
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 4292kb

input:

20
aeljltfjjqdplqkoevfocfopmigcwtdkehcbrrjrukkjnaozzbpxaiusphivkjbyqqwxyngvkczgilniutalgskhpbcpmwdbjdekkihyuoteiurjvhgixsehjxtqugjzwelxmjqbunoyofvgsomzwrsjrddrmjebpovwebpzmmdbgghyisvqlwalutpffxvypxfphdmnudyjdjsnyhgctmhpzmayzjodaezeoxgkuioqiquffjzndmdqsdjuxlyrviisvczkxeyhpxejksmtohxcfkghsiiiyiliehmks...

output:

nrywygswwdqcydxbrisbpsbczvtpjgqxrupoeewehxxwanbmmocknvhfcuvixwolddjklatixpmtvyavhgnytfxucopczjqowqrxxvulhbgrvhewiutvkfruwkgdhtwmjrykzwdohablbsitfbzmjefweqqezwrocbijrocmzzqottulvfidyjnyhgcsskilckscuqzahqlwqwfalutpgzucmznlmwbqnrmrbktxhvbdvdhsswmaqzqdfqwhkyleivvfipmxkrluckrwxfzgbukpsxtufvvvlvyvruzxfbsw...

result:

ok 20 lines

Extra Test:

score: 0
Extra Test Passed