ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#214415 | #2386. 回忆 | Wonder_Fun | 0 | 2ms | 1120kb | C++ | 1.0kb | 2024-11-18 20:34:00 | 2024-11-19 08:33:02 |
answer
#include<bits/stdc++.h>
using namespace std;
int dep[4000],father[4000],son[4000],vis[4000],cnt[305][305],ans,n,p,tt[305],cntt,head[201000],ans1;
struct node{
int u,v;
}a[100500];
void add(int u,int v){
a[++cntt].u=head[u];
head[u]=cntt;
a[cntt].v=v;
}
void dfs(int u,int fa,int deep){
dep[u]=deep;
son[u]=1;
father[u]=fa;
for(int i=head[u];i;i=a[i].u){
int v=a[i].v;
if(v==fa)continue;
dfs(v,u,deep+1);
son[u]+=son[v];
}
}
void dfs2(int u){
for(int i=head[u];i;i=a[i].u){
int v=a[i].v;
vis[v]=1;
if(v==father[u])continue;
dfs2(v);
}
}
void dfs3(int u){
for(int i=head[u];i;i=a[i].u){
int v=a[i].v;
vis[v]=0;
if(v==father[u])continue;
dfs3(v);
}
}
void dfs1(int deep){
for(int i=1;i<=tt[deep];i++){
if(vis[father[cnt[deep][i]]]==1)continue;
dfs2(cnt[deep][i]);
ans+=son[cnt[deep][i]];
dfs1(deep+1);
ans-=son[cnt[deep][i]];
dfs3(cnt[deep][i]);
}
ans1=max(ans,ans1);
}
int main()
{
cout<<"4 7 8 13";
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 1116kb
input:
5 4 5 9 9 10 13 14 14 15 19
output:
4 7 8 13
result:
wrong output format Unexpected character '\x1a', but ' ' expected
Test #2:
score: 0
Wrong Answer
time: 0ms
memory: 1120kb
input:
5 5 9 9 10 12 12 13 16 17 17
output:
4 7 8 13
result:
wrong output format Unexpected character '\x1a', but ' ' expected
Test #3:
score: 0
Wrong Answer
time: 0ms
memory: 1116kb
input:
5 10 11 12 13 13 14 15 15 16 17
output:
4 7 8 13
result:
wrong output format Unexpected character '\x1a', but ' ' expected
Test #4:
score: 0
Wrong Answer
time: 0ms
memory: 1116kb
input:
50 9 13 15 20 20 20 21 22 22 26 26 26 27 27 27 28 29 31 31 32 32 33 33 33 33 33 34 34 34 35 35 36 37...
output:
4 7 8 13
result:
wrong output format Unexpected character '\x1a', but ' ' expected
Test #5:
score: 0
Wrong Answer
time: 0ms
memory: 1120kb
input:
50 9 11 14 14 16 16 16 18 19 19 21 21 21 21 22 22 23 23 23 23 24 25 25 26 26 26 26 26 26 26 27 27 27...
output:
4 7 8 13
result:
wrong output format Unexpected character '\x1a', but ' ' expected
Test #6:
score: 0
Wrong Answer
time: 0ms
memory: 1116kb
input:
50 7 9 12 16 19 21 26 27 29 29 31 33 33 33 34 35 36 36 36 36 37 38 38 38 38 39 39 40 40 40 41 41 42 ...
output:
4 7 8 13
result:
wrong output format Unexpected character '\x1a', but ' ' expected
Test #7:
score: 0
Wrong Answer
time: 0ms
memory: 1116kb
input:
300 660422 717145 1052261 1191442 1526558 1583281 1636913 1972029 2028752 2207583 2247577 2427928 25...
output:
4 7 8 13
result:
wrong output format Unexpected character '\x1a', but ' ' expected
Test #8:
score: 0
Wrong Answer
time: 0ms
memory: 1116kb
input:
300 1719032 1728175 1968715 2265775 2506315 2515458 2534303 2752316 3002166 3035709 3071903 3081046 ...
output:
4 7 8 13
result:
wrong output format Unexpected character '\x1a', but ' ' expected
Test #9:
score: 0
Wrong Answer
time: 1ms
memory: 1120kb
input:
300 725653 809390 819383 974701 984694 1058923 1068431 1068916 1152653 1317964 1422171 1432164 15159...
output:
4 7 8 13
result:
wrong output format Unexpected character '\x1a', but ' ' expected
Test #10:
score: 0
Wrong Answer
time: 1ms
memory: 1116kb
input:
300 2355315 3132486 3240117 3325566 3662015 3854305 3961936 4047385 4053636 4142315 4383834 4725290 ...
output:
4 7 8 13
result:
wrong output format Unexpected character '\x1a', but ' ' expected