Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
51513 _JF_ 最优子序列 C++ 运行超时 0 1000 MS 252 KB 1040 2022-07-13 11:49:10

Tests(0/20):


#include <bits/stdc++.h> using namespace std; int n; string q; int main() { int maxx=-INT_MAX; int n,m,Type,last; cin>>n>>m>>Type; string s; cin>>s; string p; for(int i=1; i<=n; i++) { for(int j=i; j<=n; j++) { int now=-1; for(int k=1; k<=n;k++) { if(k<i||k>j) { now++; q[now]=s[k-1]; } } bool flag=true; for(int ii=0; ii<=now; ii++) { for(int jj=ii+1; jj<=now; jj++) { for(int k=jj+1; k<=now; k++) { if(q[ii]==q[k]&&q[ii]!=q[jj]) flag=false; } } } if(now>=2&&flag==true) { if(maxx<now+1) { maxx=max(maxx,now+1); for(int k=0;k<=now;k++) p[k]=q[k]; last=now; } } } } if(Type==0) cout<<maxx<<endl; else { cout<<maxx<<endl; for(int k=0;k<=last;k++) cout<<p[k]; } return 0; }


测评信息:

输入

20 12 0
jhlbfajhlbfajhlbfaag

输出

9

答案

10

检查日志

wrong answer The length is wrong: expected = 10, found = 9

系统信息

exit code: 0, checker exit code: 1

输入

20 12 0
ehjbehjbehjbkhlckhlc

输出

6

答案

10

检查日志

wrong answer The length is wrong: expected = 10, found = 6

系统信息

exit code: 0, checker exit code: 1

输入

200 4 0
abababababababababababababababababababababababababababababdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdaadcbcbcbcbcbcbc...

输出

                    

答案

101

检查日志

wrong answer The length is wrong: expected = 10, found = 6

系统信息

exit code: 0, checker exit code: 0

输入

200 4 0
dbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcccccccccccccccccccccccccccccccccccccccccccccccccdcdcdcbb...

输出

                    

答案

128

检查日志

wrong answer The length is wrong: expected = 10, found = 6

系统信息

exit code: 0, checker exit code: 0

输入

200 12 0
idljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljelhdelhdelhdelhdelhdelhdelhdelhdkdliehfichficl...

输出

                    

答案

57

检查日志

wrong answer The length is wrong: expected = 10, found = 6

系统信息

exit code: 0, checker exit code: 0

输入

200 12 0
gbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfaebgaebgjahldijahldijahldijahldijahldijahldijahldijahldijahldijahldijahldicgkhea...

输出

                    

答案

47

检查日志

wrong answer The length is wrong: expected = 10, found = 6

系统信息

exit code: 0, checker exit code: 0

输入

200 12 1
cgiahcgiahcgiahcgiahcgiahcgiahcgiahcgiahcgiahcgiahcgiahcgiahcgiahcgiahcgiahcgiahcgiahcfacfacfacfacfacfacfalkcglkcglkcglkcglkcglkcglkcglkcglkcglkcglkcglkcglkcglkcglkcglkcglkcglkcglgfalgfaifbi...

输出

                    

答案

54
aaaaaaaaaaaaaaaaaaaaaaaalkccccccccccccccccccggfffbbbbi

检查日志

wrong answer The length is wrong: expected = 10, found = 6

系统信息

exit code: 0, checker exit code: 0

输入

200 12 1
gacbegacbegacbegacbegacbegacbegacbegacbegacbegacbegacbegacbegacbegacbegacbegacbegacbegacbegacbegacbekfjkfjkfjkfjkfjkfjkfjkfjkfjkfjkfjcekgdcekgdcekgdcekgdcekgdcekgdcekgdcekgdcekgdiefajiefajie...

输出

                    

答案

51
aaaaaaaaaaaaaaaaaaaabekkkkkkkkkkkkdddddddddfffjjicg

检查日志

wrong answer The length is wrong: expected = 10, found = 6

系统信息

exit code: 0, checker exit code: 0

输入

200 12 2
jaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeilhalkhalkhalkcjg...

输出

                    

答案

48
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaeihhhcjfkbdgl

检查日志

wrong answer The length is wrong: expected = 10, found = 6

系统信息

exit code: 0, checker exit code: 0

输入

200 12 2
jhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgacjlfedcjlfedcjlfedcjlfedcjlfedcjlfedcjlfedcjlfedcjlfedcjlf...

输出

                    

答案

51
hgaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacccccccccccjlfed

检查日志

wrong answer The length is wrong: expected = 10, found = 6

系统信息

exit code: 0, checker exit code: 0

输入

3000 12 0
fejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejb...

输出

                    

答案

607

检查日志

wrong answer The length is wrong: expected = 10, found = 6

系统信息

exit code: 0, checker exit code: 0

输入

3000 12 0
dhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhef...

输出

                    

答案

661

检查日志

wrong answer The length is wrong: expected = 10, found = 6

系统信息

exit code: 0, checker exit code: 0

输入

3000 12 1
eihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihd...

输出

                    

答案

837
hddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddiiiiiiiiiiiiiiiiiiiiiiiiiiii...

检查日志

wrong answer The length is wrong: expected = 10, found = 6

系统信息

exit code: 0, checker exit code: 0

输入

3000 12 1
ekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjd...

输出

                    

答案

607
ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd...

检查日志

wrong answer The length is wrong: expected = 10, found = 6

系统信息

exit code: 0, checker exit code: 0

输入

3000 12 2
jbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbh...

输出

                    

答案

585
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbhfkaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

检查日志

wrong answer The length is wrong: expected = 10, found = 6

系统信息

exit code: 0, checker exit code: 0

输入

3000 12 2
gbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbj...

输出

                    

答案

517
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

检查日志

wrong answer The length is wrong: expected = 10, found = 6

系统信息

exit code: 0, checker exit code: 0

输入

3000 12 2
fjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjla...

输出

                    

答案

629
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...

检查日志

wrong answer The length is wrong: expected = 10, found = 6

系统信息

exit code: 0, checker exit code: 0

输入

3000 12 2
fdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihf...

输出

                    

答案

758
ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd...

检查日志

wrong answer The length is wrong: expected = 10, found = 6

系统信息

exit code: 0, checker exit code: 0

输入

3000 12 2
dhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgj...

输出

                    

答案

615
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...

检查日志

wrong answer The length is wrong: expected = 10, found = 6

系统信息

exit code: 0, checker exit code: 0

输入

3000 12 2
jlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbd...

输出

                    

答案

583
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...

检查日志

wrong answer The length is wrong: expected = 10, found = 6

系统信息

exit code: 0, checker exit code: 0