ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#190928 | #3390. 凯撒密码 | Sun_wtup | 100 | 22ms | 1288kb | C++ | 1.3kb | 2023-10-07 19:06:47 | 2023-10-07 21:40:07 |
answer
#include <bits/stdc++.h>
//#include <windows.h>
//#include <psapi.h>
//#include <time.h>
using namespace std;
#define debug(x) std::cerr<<#x<<'='<<x<<std::endl
signed main()
{
// freopen("Luogu_P_1877.cpp.in","r",stdin);
// freopen("Luogu_P_1877.cpp.out","w",stdout);
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
string s, t;
// clock_t start,end; //定义clock_t变量
// start = clock(); //开始时间
cin >> s >> t;
// end = clock(); //结束时间
// cout<<"time = "<<double(end-start)/CLOCKS_PER_SEC<<"s"<<endl;//输出时间
if (s.size() != t.size()) {
cout << "IMPOSSIBLE";
return 0;
}
if (s == t) {
cout << 0;
return 0;
}
// int cnt = -1;
// int cntnum = -1;
for (int i = 1; i <= 265; i++) {
for (int j = 0; j < s.size(); j++) {
if (s[j] >= '0' and s[j] <= '9') {
if (s[j] == '9') s[j] = '0';
else s[j] = s[j] + 1;
}
if (s[j] >= 'a' and s[j] <= 'z') {
if (s[j] == 'z') s[j] = 'a';
else s[j] = s[j] + 1;
}
}
if (s == t) {
cout << i;
return 0;
}
}
// HANDLE hd = GetCurrentProcess();
// PROCESS_MEMORY_COUNTERS pmc;
// GetProcessMemoryInfo(hd, &pmc, sizeof(pmc));
// printf("%lf", double(pmc.WorkingSetSize) / 1024 / 1024);//单位MiB
cout << "IMPOSSIBLE";
// fclose(stdin);
// fclose(stdout);
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 10
Accepted
time: 0ms
memory: 1212kb
input:
a 0
output:
IMPOSSIBLE
result:
ok single line: 'IMPOSSIBLE'
Test #2:
score: 10
Accepted
time: 0ms
memory: 1244kb
input:
c x
output:
21
result:
ok single line: '21'
Test #3:
score: 10
Accepted
time: 0ms
memory: 1240kb
input:
8 3
output:
5
result:
ok single line: '5'
Test #4:
score: 10
Accepted
time: 0ms
memory: 1244kb
input:
097 097
output:
0
result:
ok single line: '0'
Test #5:
score: 10
Accepted
time: 0ms
memory: 1244kb
input:
135409 357621
output:
2
result:
ok single line: '2'
Test #6:
score: 10
Accepted
time: 0ms
memory: 1284kb
input:
ulhpnmrkblwafxapsldccdplmqukqlxwixjtleoirjyyivdguyiffnvunoxconwjvovmqluhyypgfkmdvgpzjuepkwjdoniezcli...
output:
21
result:
ok single line: '21'
Test #7:
score: 10
Accepted
time: 1ms
memory: 1284kb
input:
ijvxljtolmgjndlwoyjjttakhzvzmihjdhkyfnafwrpeuiuiurusvsnugviqzouvuxalhxmxhclxdzrxylbzsmdruqpnvagkninp...
output:
13
result:
ok single line: '13'
Test #8:
score: 10
Accepted
time: 3ms
memory: 1284kb
input:
lb3zc66k080upg8dfv18jctk0sejke93251mw9f3642u1x7889s5y38wdv39391v3gptt6656248xw576z2w27gh9t3wh5j634lg...
output:
22
result:
ok single line: '22'
Test #9:
score: 10
Accepted
time: 6ms
memory: 1288kb
input:
h18855603165ay78uft01r1i89sx9o1z6d1h0nd2l8f28xe05571r64vjeofr32453571pa1z9x47dpg5k3uw2027lx4270g4xyh...
output:
98
result:
ok single line: '98'
Test #10:
score: 10
Accepted
time: 12ms
memory: 1288kb
input:
2c3hoz6dbcggcjjf665nqfcy3w2yoej1lyr1j523230e2q228b6vn96gsuq1sustb1269uiyrk6y3gi883f789rro7nomg9776w1...
output:
129
result:
ok single line: '129'
Extra Test:
score: 0
Extra Test Passed