|
| Code Submission Evaluation System |
Login |
BOI 2016, day 1
|
Start: | 2016-05-12 09:00:00 |
End: | 2016-05-12 14:00:00 |
|
|
Tasks | Scoreboard | Statistics
CSES - BOI 2016, day 1 - Results
Task: | Bosses |
Sender: | zscoder |
Submission time: | 2016-05-12 10:36:17 |
Language: | C++ |
Status: | READY |
Score: | 0 |
Feedback
group | verdict | score |
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
Test results
test | verdict | time (s) | group | |
#1 | ACCEPTED | 0.05 / 1.50 | 1 | details |
#2 | WRONG ANSWER | 0.06 / 1.50 | 1 | details |
#3 | WRONG ANSWER | 0.05 / 1.50 | 1 | details |
#4 | WRONG ANSWER | 0.06 / 1.50 | 1 | details |
#5 | WRONG ANSWER | 0.05 / 1.50 | 1 | details |
#6 | WRONG ANSWER | 0.07 / 1.50 | 1 | details |
#7 | WRONG ANSWER | 0.06 / 1.50 | 2 | details |
#8 | WRONG ANSWER | 0.06 / 1.50 | 2 | details |
#9 | WRONG ANSWER | 0.06 / 1.50 | 2 | details |
#10 | WRONG ANSWER | 0.06 / 1.50 | 2 | details |
#11 | WRONG ANSWER | 0.05 / 1.50 | 2 | details |
#12 | WRONG ANSWER | 0.18 / 1.50 | 3 | details |
#13 | WRONG ANSWER | 0.16 / 1.50 | 3 | details |
#14 | ACCEPTED | 0.16 / 1.50 | 3 | details |
#15 | ACCEPTED | 0.06 / 1.50 | 3 | details |
#16 | WRONG ANSWER | 0.94 / 1.50 | 3 | details |
#17 | RUNTIME ERROR | 1.10 / 1.50 | 3 | details |
#18 | TIME LIMIT EXCEEDED | -- / 1.50 | 3 | details |
Compiler report
input/code.cpp: In function 'void bfs(int)':
input/code.cpp:28:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i < adj[v].size(); i++)
^
input/code.cpp: In function 'int main()':
input/code.cpp:44:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
^
input/code.cpp:47:25: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
int k; scanf("%d", &k);
^
input/code.cpp:51:19: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &u);
^
Code
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> ii;
typedef pair<ii, ll> iii;
vi adj[5001];
bool visited[5001];
ll val[5001];
int dist[5001];
int visit = 0;
void bfs(int u)
{
queue<int> q;
q.push(u);
while(!q.empty())
{
int v = q.front(); q.pop();
visited[v] = true; visit++;
for(int i = 0; i < adj[v].size(); i++)
{
int w = adj[v][i];
if(!visited[w])
{
dist[w] = dist[v] + 1;
q.push(w);
}
}
}
}
int main()
{
//ios_base::sync_with_stdio(0); cin.tie(0);
int n;
scanf("%d", &n);
for(int i = 1; i <= n; i++)
{
int k; scanf("%d", &k);
int u;
for(int j = 0; j < k; j++)
{
scanf("%d", &u);
adj[u].pb(i);
}
}
ll bestans = ll(1e18);
for(int i = 1; i <= n; i++)
{
ll ans = 0;
dist[i] = 1;
bfs(i);
if(visit == n)
{
for(int j = 1; j <= n; j++)
{
//cout << dist[j] << ' ';
val[dist[j]]++;
}
//cout << endl;
for(int j = 1; j <= n; j++)
{
ans += val[j]*j;
}
bestans = min(bestans, ans);
}
memset(visited, false, sizeof(visited));
memset(val, 0, sizeof(val));
visit = 0;
}
printf("%lld\n", bestans);
return 0;
}
Test details
Test 1
Group: 1
Verdict: ACCEPTED
Test 2
Group: 1
Verdict: WRONG ANSWER
input |
---|
6 2 6 5 3 4 6 3 2 4 1 4 5 3 1 6 ...
|
user output |
---|
1000000000000000000
|
Test 3
Group: 1
Verdict: WRONG ANSWER
input |
---|
9 2 6 3 2 8 4 0 4 8 3 6 9 ...
|
Test 4
Group: 1
Verdict: WRONG ANSWER
input |
---|
10 3 3 2 8 3 6 7 3 4 6 10 7 9 1 10 ...
|
user output |
---|
1000000000000000000
|
Test 5
Group: 1
Verdict: WRONG ANSWER
input |
---|
10 3 4 8 10 1 10 1 5 3 6 8 5 ...
|
user output |
---|
1000000000000000000
|
Test 6
Group: 1
Verdict: WRONG ANSWER
input |
---|
10 2 2 6 2 3 5 2 4 1 2 6 7 ...
|
user output |
---|
1000000000000000000
|
Test 7
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 2 78 92 1 15 1 57 1 45 ...
|
user output |
---|
1000000000000000000
|
Test 8
Group: 2
Verdict: WRONG ANSWER
input |
---|
50 6 16 31 50 6 4 8 7 7 16 27 22 15 30 14 5 20 22 42 33 37 3 18 45 9 ...
|
user output |
---|
1000000000000000000
|
Test 9
Group: 2
Verdict: WRONG ANSWER
input |
---|
30 5 12 26 25 18 24 8 6 13 5 7 10 22 20 29 6 16 14 9 27 5 20 3 19 17 11 ...
|
user output |
---|
1000000000000000000
|
Test 10
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 2 2 77 3 99 94 85 2 47 29 2 33 74 ...
|
user output |
---|
1000000000000000000
|
Test 11
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 3 50 11 85 2 84 69 2 41 39 2 43 82 ...
|
user output |
---|
1000000000000000000
|
Test 12
Group: 3
Verdict: WRONG ANSWER
input |
---|
200 46 154 36 47 187 86 48 66 124 ...
|
user output |
---|
1000000000000000000
|
Test 13
Group: 3
Verdict: WRONG ANSWER
input |
---|
150 60 32 101 42 139 95 36 81 83 1...
|
user output |
---|
1000000000000000000
|
Test 14
Group: 3
Verdict: ACCEPTED
input |
---|
5000 1 3355 1 2176 1 3754 1 950 ...
|
Test 15
Group: 3
Verdict: ACCEPTED
input |
---|
5000 1 848 1 418 1 3390 1 2840 ...
|
Test 16
Group: 3
Verdict: WRONG ANSWER
input |
---|
5000 2 4629 753 1 345 3 3573 1802 449 1 3051 ...
|
user output |
---|
1000000000000000000
|
Test 17
Group: 3
Verdict: RUNTIME ERROR
input |
---|
5000 2 2282 1819 2 2987 3194 2 3472 4256 2 3226 3684 ...
|
Test 18
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
5000 2 1912 3423 2 419 4226 2 1627 4693 2 4760 1391 ...
|