ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#212158 | #3818. 01游戏 | yangtianming001 | 0 | 0ms | 0kb | C++11 | 358b | 2024-10-13 11:41:49 | 2024-10-13 12:41:13 |
answer
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
int n = s.length();
int m = 0;
int cnt = 1;
for (int i = 1; i < n; ++i) {
if (s[i] == s[i - 1]) {
cnt += 1;
} else {
m = max(m, cnt);
cnt = 1;
}
}
m = max(m, cnt);
return m;
cout << m << endl;
return 0;
}
Details
小提示:点击横条可展开更详细的信息
Subtask #1:
score: 0
Runtime Error
Test #1:
score: 0
Runtime Error
input:
11000001100100000010
output:
result:
Subtask #2:
score: 0
Runtime Error
Test #9:
score: 0
Runtime Error
input:
1101111111000101001010110010010111010010111001000100101001010110110001100110011101010010001101001100...
output:
result:
Subtask #3:
score: 0
Runtime Error
Test #17:
score: 0
Runtime Error
input:
0101100001001111011100100000011100110100001001100110111000100001110101010001010011000110001001110000...
output:
result:
Subtask #4:
score: 0
Runtime Error
Test #25:
score: 0
Runtime Error
input:
0001001111100010010111110001100000010001011100010011110001000101110010101011111100000101111100110100...