Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
51564 | 野兽先辈——田所浩二 | 最优子序列 | C++ | 解答错误 | 0 | 1000 MS | 12092 KB | 1056 | 2022-07-13 11:52:54 |
using namespace std; const int N=1005; int n,k,cnt,f[N<<1]; ll ans; struct node { int x,y,z; } edge[N*N]; bool cmp(node a,node b) { return a.z>b.z; } int find(int x) { if(f[x]!=x) f[x]=find(f[x]); return f[x]; } int main() { int x,y,z,fx,fy,sum; scanf("%d%d",&n,&k); for(int i=1; i<=n; i++) for(int j=1; j<=n; j++) { scanf("%d",&x); if(i>=j) continue; edge[++cnt]=(node) { i,j,x }; edge[++cnt]=(node) { i,j+n,k-x }; } if(k==1) { printf("%d",(n-2)*(n-1)/2); return 0; } sort(edge+1,edge+1+cnt,cmp); for(int i=1; i<=2*n; i++) f[i]=i; for(int i=1; i<=cnt; i++) { x=edge[i].x; y=edge[i].y; z=edge[i].z; fx=find(x); fy=find(y); if(fx==fy) ans+=z; else { if(sum==n) continue; sum++; ans+=z; f[fy]=fx; } } printf("%d\n",ans); return 0; }
20 12 0
jhlbfajhlbfajhlbfaag
2280
10
wrong answer The length is wrong: expected = 10, found = 2280
exit code: 0, checker exit code: 1
20 12 0
ehjbehjbehjbkhlckhlc
2280
10
wrong answer The length is wrong: expected = 10, found = 2280
exit code: 0, checker exit code: 1
200 4 0
abababababababababababababababababababababababababababababdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdaadcbcbcbcbcbcbc...
79600
101
wrong answer The length is wrong: expected = 101, found = 79600
exit code: 0, checker exit code: 1
200 4 0
dbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcccccccccccccccccccccccccccccccccccccccccccccccccdcdcdcbb...
79600
128
wrong answer The length is wrong: expected = 128, found = 79600
exit code: 0, checker exit code: 1
200 12 0
idljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljidljelhdelhdelhdelhdelhdelhdelhdelhdkdliehfichficl...
238800
57
wrong answer The length is wrong: expected = 57, found = 238800
exit code: 0, checker exit code: 1
200 12 0
gbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfgbalfaebgaebgjahldijahldijahldijahldijahldijahldijahldijahldijahldijahldijahldicgkhea...
238800
47
wrong answer The length is wrong: expected = 47, found = 238800
exit code: 0, checker exit code: 1
200 12 1
cgiahcgiahcgiahcgiahcgiahcgiahcgiahcgiahcgiahcgiahcgiahcgiahcgiahcgiahcgiahcgiahcgiahcfacfacfacfacfacfacfalkcglkcglkcglkcglkcglkcglkcglkcglkcglkcglkcglkcglkcglkcglkcglkcglkcglkcglgfalgfaifbi...
238800
54
aaaaaaaaaaaaaaaaaaaaaaaalkccccccccccccccccccggfffbbbbi
wrong answer The length is wrong: expected = 54, found = 238800
exit code: 0, checker exit code: 1
200 12 1
gacbegacbegacbegacbegacbegacbegacbegacbegacbegacbegacbegacbegacbegacbegacbegacbegacbegacbegacbegacbekfjkfjkfjkfjkfjkfjkfjkfjkfjkfjkfjcekgdcekgdcekgdcekgdcekgdcekgdcekgdcekgdcekgdiefajiefajie...
238800
51
aaaaaaaaaaaaaaaaaaaabekkkkkkkkkkkkdddddddddfffjjicg
wrong answer The length is wrong: expected = 51, found = 238800
exit code: 0, checker exit code: 1
200 12 2
jaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeiljaeilhalkhalkhalkcjg...
238800
48
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaeihhhcjfkbdgl
wrong answer The length is wrong: expected = 48, found = 238800
exit code: 0, checker exit code: 1
200 12 2
jhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgajhgacjlfedcjlfedcjlfedcjlfedcjlfedcjlfedcjlfedcjlfedcjlfedcjlf...
238800
51
hgaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacccccccccccjlfed
wrong answer The length is wrong: expected = 51, found = 238800
exit code: 0, checker exit code: 1
3000 12 0
fejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejbhfejb...
607
wrong answer The length is wrong: expected = 51, found = 238800
exit code: 0, checker exit code: 0
3000 12 0
dhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhefjdhef...
661
wrong answer The length is wrong: expected = 51, found = 238800
exit code: 0, checker exit code: 0
3000 12 1
eihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihdjeihd...
837
hddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddiiiiiiiiiiiiiiiiiiiiiiiiiiii...
wrong answer The length is wrong: expected = 51, found = 238800
exit code: 0, checker exit code: 0
3000 12 1
ekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjdlekjd...
607
ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd...
wrong answer The length is wrong: expected = 51, found = 238800
exit code: 0, checker exit code: 0
3000 12 2
jbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbhflkjbh...
585
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbhfkaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
wrong answer The length is wrong: expected = 51, found = 238800
exit code: 0, checker exit code: 0
3000 12 2
gbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbjaekgbj...
517
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
wrong answer The length is wrong: expected = 51, found = 238800
exit code: 0, checker exit code: 0
3000 12 2
fjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjladfjla...
629
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...
wrong answer The length is wrong: expected = 51, found = 238800
exit code: 0, checker exit code: 0
3000 12 2
fdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihfdihf...
758
ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd...
wrong answer The length is wrong: expected = 51, found = 238800
exit code: 0, checker exit code: 0
3000 12 2
dhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgjbdhgj...
615
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...
wrong answer The length is wrong: expected = 51, found = 238800
exit code: 0, checker exit code: 0
3000 12 2
jlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbdgjlbd...
583
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...
wrong answer The length is wrong: expected = 51, found = 238800
exit code: 0, checker exit code: 0