UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#210919#2067. 肉夹馍Larryia00ms1280kbC++11628b2024-08-08 10:24:512024-08-08 14:28:42

answer

#include<bits/stdc++.h>
#define ll long long
using namespace std;
string s;
const int N = 2000005;
unordered_map <string,bool> mp;
string sb, str;
int d0, mid;
int main() {
    cin >> s;
    for (int i = 1; i <= s.length(); i++) {
        bool f = 0;
        mp[s.substr(0, i)] = 1;
        d0 = (i / 2) - !(i % 2);
        mid = 0;
        for (int j = 21; j >= 0; j--){
            if (mid + (1 << j) > d0) continue;
            int td = mid + (1 << j);
            if (mp[s.substr(i - td, td)] == 1){
                mid = td;
            }
        }
        cout << mid << ' ';
    }
    return 0;
}

详细

小提示:点击横条可展开更详细的信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 1280kb

input:

qpbvqpbvqpbvavdqpbvqpbvqpbvavdqpbvqpbvqpbvavdfnfninqpbvqpbvqpbvavdqpbvqpbvqpbvavdqpbvqpbvqpbvavd

output:

0 0 0 0 1 2 0 0 1 2 0 4 0 0 0 1 2 0 4 1 2 0 8 1 2 0 12 0 0 0 1 2 0 4 1 2 0 8 1 2 0 12 0 0 0 0 0 0 0 ...

result:

wrong answer 7th words differ - expected: '3', found: '0'

Subtask #2:

score: 0
Skipped

Subtask #3:

score: 0
Skipped

Subtask #4:

score: 0
Skipped