编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#25493 | #1120. Rhodoks的排序 | Time Limit Exceeded | 0 | 4037 ms | 324 K | C / 1.1 K | Carl | 2020-05-04 13:15:07 |
#include <stdio.h>
#include <string.h>
int main() {
char str[10001];
scanf("%s", str);
int longth = strlen(str);
int i = 0, j;
char temp;
int gap = longth;
do {
gap = gap / 2;
for (i = gap; i < longth; i++) {
if (str[i] < str[i - gap]) {
temp = str[i];
for (j = i - gap; j >= 0 && str[j] > temp; j -= gap) {
str[j + gap] = str[j];
}
str[j + gap] = temp;
}
}
} while (gap > 1);
int flag = 0, longtho = longth;
for (i = 1; i < longth; i++) {
if (str[i] >= 'A' && str[i] <= 'Z') {
temp = str[i];
for (j = longth - 1; j = i + 1; j--) {
str[j - 1] = str[j];
}
str[longth - 1] = temp;
flag += 1;
longth -= 1;
}
}
for (i = 1; i < longth; i++) {
if (str[i] >= 'A' && str[i] <= 'Z') {
temp = str[i];
for (j = longth - 1; j >= i + 1; j--) {
str[j - 1] = str[j];
}
str[longth - 1] = temp;
flag += 1;
longth -= 1;
}
}
int p, q;
for (p = longtho - flag; p < longtho - 1; p++) {
for (q = longtho - flag; q < longtho - 1 - p; q++) {
if (str[q + 1] < str[q]) {
temp = str[q];
str[q] = str[q + 1];
str[q + 1] = temp;
}
}
}
for (i = 0; i < longtho; i++) printf("%c", str[i]);
return 0;
}
k5OivzqJri9B3V9XE3V0t1GahkPrQtRZN73DRWM1N4kGg57EJKPY4qHydK1eWES6U0s1f27ZF5Vpj1839TEAq8a5Hy52gkUkZw10
<2 bytes omitted>
m06E45ZJk594cbqyTKZ042jE71Z97Qk8sDls5fsKfp9rDE468BjH3Vry36hyMFCtjsc2x8b26u2hz1f10ZRkx8ew0vFC6ZiW0RKw
<2 bytes omitted>
tUWX8j6Z0Tx85oC3l7nl00SnGgIcmgJOkTnONWIyuSu30QB6pIKu0R4n7L4X9QOL87xAp9LTymn62yxZ2OFJ146nLL1O9hg0a316
<2 bytes omitted>
fRHJC8kKNZ17WgriI7nS9seLHwZTbeweo5LraEMRR3H29wKPx7RWH042849gH2y86Df7Moi80Wop8OX8OScx5O2rGZ5C2039XYX4
<99902 bytes omitted>
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
<99902 bytes omitted>
系统信息
Killed: Segmentation fault
cKQa8erMn8tK5tKH8qt50P6zbghI71M3t1OjPoyP3LCv9F4I1z5o7G0Cw4KZq8wT9l8VEWHQ7K2OyG7ZYsy9VWZ9yHU6j32q5WLy
<99902 bytes omitted>
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
<99902 bytes omitted>
系统信息
Killed: Segmentation fault
2v05yDLdjj1gWJh1374gI5hq1gLa2RI3Fc02Yk32buB5K4Zq9M8toe7C3F098Eq30K52UDdK90XW1WSOCe89oWouzW40206V45ZK
<99902 bytes omitted>
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
<99902 bytes omitted>
系统信息
Killed: Segmentation fault
fR9l22CZ615FmE0c3b06817wzjUjL5s4ps6W3eK1jGsxR4VpSGbpw0R2b7V3Ia7XgulbjEJQHe3gMm4Z561L8Hh14tM06MvTACyV
<99902 bytes omitted>
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
<99902 bytes omitted>
系统信息
Killed: Segmentation fault
c6Ami1W2o6c5SLJ5Ndw0308Y3ay2V4Wl25087R3mJ9hzc500Y4d9JrNmO7AAcnl89W21k4M2T6rrQS7aFot10U1z0VeB3C04t21t
<99902 bytes omitted>
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
<99902 bytes omitted>
系统信息
Killed: Segmentation fault
3KkXhF8XhpfNIf04cL5s1ihFRr6yT2WFU4ydvxC3PYcRvh6854Kar2KfNe48Q6T6R7i8fK07xJ0F5eGMJj58fSGU3Uun94ZCc7p2
<99902 bytes omitted>
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
<99902 bytes omitted>
系统信息
Killed: Segmentation fault