[Offer收割]编程练习赛107 register

Ended

Participants:61

Verdict:Accepted
Score:100 / 100
Submitted:2019-09-01 14:00:56

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
#include <map>
#include <numeric>
#include <algorithm>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
using namespace std;
int main()
{
    string s;
    cin >> s;
    if (s.size() <= 2) {
        cout << s.size() << endl;
        return 0;
    }
    int len = 0;
    int beg = -1;
    for (int i = 2; i < s.size(); i++)
    {
        if (s[i] == s[i - 1] && s[i] == s[i - 2]) {
            beg = i - 2;
        }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX