UOJ Logo

NOI.AC

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#212139#3818. 01游戏liujiahe0409011ms1248kbC++345b2024-10-13 11:32:042024-10-13 12:40:57

answer

#include<bits/stdc++.h>
using namespace std;
int dp[5005];
int js(string s){
	int len=s.size();
	for(int i=0;i<len;i++){
		dp[i]=1;
	}
	for(int i=0;i<len;i++){
		for(int j=0;j<i;j++){
			if(s[i]!=s[j]){
				dp[i]=max(dp[j]+1,dp[i]);
			}
		}
	}
	return dp[len-1];
}
string s;
int main(){
	cin>>s;
	cout<<js(s);
	return 0;
}

Details

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

Subtask #1:

score: 0
Wrong Answer

Test #1:

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

input:

11000001100100000010

output:

8

result:

wrong answer 1st numbers differ - expected: '9', found: '8'

Subtask #2:

score: 0
Wrong Answer

Test #9:

score: 20
Accepted
time: 0ms
memory: 1236kb

input:

1101111111000101001010110010010111010010111001000100101001010110110001100110011101010010001101001100...

output:

158

result:

ok 1 number(s): "158"

Test #10:

score: -20
Wrong Answer
time: 0ms
memory: 1236kb

input:

0111110000010010100101001010000001011100000001101001001101010101111101010000001111100001010000111111...

output:

153

result:

wrong answer 1st numbers differ - expected: '155', found: '153'

Subtask #3:

score: 0
Wrong Answer

Test #17:

score: 20
Accepted
time: 7ms
memory: 1248kb

input:

0101100001001111011100100000011100110100001001100110111000100001110101010001010011000110001001110000...

output:

997

result:

ok 1 number(s): "997"

Test #18:

score: -20
Wrong Answer
time: 4ms
memory: 1248kb

input:

1000100100110111110101100101001010000101001001101101100010001001111100101011000011001011101011000001...

output:

1030

result:

wrong answer 1st numbers differ - expected: '1032', found: '1030'

Subtask #4:

score: 0
Runtime Error

Test #25:

score: 0
Runtime Error

input:

0001001111100010010111110001100000010001011100010011110001000101110010101011111100000101111100110100...

output:


result: