编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#25921 #1065. 被优化掉的Shenchuan Accepted 100 179 ms 1416 K C++ (NOI) / 591 B hzhis0 2025-03-13 20:48:50
显示原始代码
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
    int n;
    cin >> n;
    string str;
    cin >> str;

    vector<int> positions;
    string target = "shenchuan";
    int targetLen = target.length();

    for (int i = 0; i <= n - targetLen; ++i) {
        if (str.substr(i, targetLen) == target) {
            positions.push_back(i + 1);
        }
    }

    cout << positions.size() << std::endl;
    for (int i = 0; i < positions.size(); i++) {
        cout << positions[i] - 1 << " ";
    }
    cout << endl;

    return 0;
}
子任务 #1
Accepted
得分:100
测试点 #1
Accepted
得分:100
用时:3 ms
内存:176 KiB

输入文件(1.in

7542
ibmvpqolwmyepkgsreliijtpnpvuyqdjgxhtfpttishenchuanyyclupkqpnrajhfqfmgahayaitshenchuanhdshenchu
<7448 bytes omitted>

答案文件(1.out

200
41 76 87 140 172 182 222 312 347 416 440 481 502 519 532 582 601 658 717 744 804 834 863 936 96
<877 bytes omitted>

用户输出

200
41 76 87 140 172 182 222 312 347 416 440 481 502 519 532 582 601 658 717 744 804 834 863 936 967 1025 1041 1056 1084 1121 11
<849 bytes omitted>

系统信息

Exited with return code 0
测试点 #2
Accepted
得分:100
用时:3 ms
内存:188 KiB

输入文件(2.in

7561
vdtldccehtcsshenchuanirqbgwtctndsbdxmbdpkumyshenchuaniiummbmovshenchuanlqhnqeowfxgjtmshenchuan
<7467 bytes omitted>

答案文件(2.out

196
12 44 62 85 100 133 172 189 209 229 295 346 387 401 423 439 455 483 496 589 609 682 717 813 937
<856 bytes omitted>

用户输出

196
12 44 62 85 100 133 172 189 209 229 295 346 387 401 423 439 455 483 496 589 609 682 717 813 937 1031 1100 1124 1160 1171 121
<828 bytes omitted>

系统信息

Exited with return code 0
测试点 #3
Accepted
得分:100
用时:133 ms
内存:1416 KiB

输入文件(3.in

1000000
shenchuanxdufyijxqtgcxgilcytaiapshenchuanixnxkwpyvrjshenchuanjnvxrwkfutwwqyrrqcroucnoshench
<999909 bytes omitted>

答案文件(3.out

26432
0 32 52 85 141 165 191 203 330 369 381 406 449 464 479 511 543 556 570 590 613 659 684 800 82
<181976 bytes omitted>

用户输出

26432
0 32 52 85 141 165 191 203 330 369 381 406 449 464 479 511 543 556 570 590 613 659 684 800 823 835 860 901 952 1026 1051 1
<181948 bytes omitted>

系统信息

Exited with return code 0
测试点 #4
Accepted
得分:100
用时:16 ms
内存:440 KiB

输入文件(4.in

107616
arnvopvilashenchuanuhairrqcnvipslaysruwpvovxkmshenchuaniwjyfkklcixbdomgmolqdwpcqnxshenchuand
<107524 bytes omitted>

答案文件(4.out

2889
10 46 82 105 160 187 211 257 282 319 347 356 376 463 532 582 592 659 695 814 830 889 924 994 1
<17184 bytes omitted>

用户输出

2889
10 46 82 105 160 187 211 257 282 319 347 356 376 463 532 582 592 659 695 814 830 889 924 994 1042 1067 1106 1143 1161 1182 
<17156 bytes omitted>

系统信息

Exited with return code 0
测试点 #5
Accepted
得分:100
用时:16 ms
内存:452 KiB

输入文件(5.in

107635
gmtmbbcbuhugvtxctjfaxhwyehwurkvwjbhrxfjpvsmuqhytyshkyipvyarhtqnctjaldxfqwimnnbopnshenchuansh
<107543 bytes omitted>

答案文件(5.out

2914
81 90 113 132 160 248 337 393 436 454 539 616 628 687 700 723 749 795 829 864 897 908 927 938 
<17304 bytes omitted>

用户输出

2914
81 90 113 132 160 248 337 393 436 454 539 616 628 687 700 723 749 795 829 864 897 908 927 938 994 1148 1192 1205 1244 1266 
<17276 bytes omitted>

系统信息

Exited with return code 0
测试点 #6
Accepted
得分:100
用时:2 ms
内存:176 KiB

输入文件(6.in

7
wumnhfo

答案文件(6.out

0

用户输出

0

系统信息

Exited with return code 0
测试点 #7
Accepted
得分:100
用时:2 ms
内存:180 KiB

输入文件(7.in

10
pjsusnkior

答案文件(7.out

0

用户输出

0

系统信息

Exited with return code 0
测试点 #8
Accepted
得分:100
用时:2 ms
内存:176 KiB

输入文件(8.in

7
shenchua

答案文件(8.out

0

用户输出

0

系统信息

Exited with return code 0
测试点 #9
Accepted
得分:100
用时:2 ms
内存:172 KiB

输入文件(9.in

17
shenchuashenchuan

答案文件(9.out

1
8

用户输出

1
8 

系统信息

Exited with return code 0