# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
564984 |
2022-05-20T06:34:29 Z |
shrimb |
Saveit (IOI10_saveit) |
C++17 |
|
248 ms |
12568 KB |
#include "grader.h"
#include "encoder.h"
#include"bits/stdc++.h"
using namespace std;
void encode(int n, int h, int p, int *v1, int *v2){
vector<int> adj[n + 1];
for (int i = 0 ; i < p ; i++) {
adj[v1[i]].push_back(v2[i]);
adj[v2[i]].push_back(v1[i]);
}
for (int i = 0 ; i < h ; i++) {
int dist[n];
for (int j = 0 ; j < n ; j++) dist[j] = INT_MAX;
dist[i] = 0;
queue<int> q;
q.push(i);
while (q.size()) {
auto cur = q.front();
q.pop();
for (int j : adj[cur]) {
if (dist[j] > dist[cur] + 1) {
dist[j] = dist[cur] + 1;
q.push(j);
}
}
}
for (int j = 0 ; j < n ; j++) {
for (int k = 0 ; k < 10 ; k++) {
encode_bit(bool(dist[j] & (1 << k)));
}
}
}
return;
}
#include "grader.h"
#include "decoder.h"
#include "bits/stdc++.h"
using namespace std;
void decode(int n, int h) {
int dist[h][n];
memset(dist, 0, sizeof dist);
for (int i = 0 ; i < h ; i++) {
for (int j = 0 ; j < n ; j++) {
for (int k = 0 ; k < 10 ; k++) {
dist[i][j] |= (1 << k)*decode_bit();
}
}
}
for (int i = 0 ; i < h ; i++) {
for (int j = 0 ; j < n ; j++) {
hops(j, i, dist[i][j]);
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
248 ms |
12568 KB |
wrong parameter |
2 |
Incorrect |
3 ms |
4612 KB |
wrong parameter |
3 |
Incorrect |
71 ms |
7436 KB |
wrong parameter |
4 |
Correct |
3 ms |
4728 KB |
Output is correct - 250 call(s) of encode_bit() |
5 |
Incorrect |
65 ms |
7648 KB |
wrong parameter |
6 |
Incorrect |
67 ms |
7864 KB |
wrong parameter |
7 |
Incorrect |
79 ms |
8228 KB |
wrong parameter |
8 |
Incorrect |
86 ms |
7564 KB |
wrong parameter |
9 |
Incorrect |
67 ms |
7808 KB |
wrong parameter |
10 |
Incorrect |
67 ms |
7724 KB |
wrong parameter |
11 |
Incorrect |
71 ms |
7836 KB |
wrong parameter |
12 |
Incorrect |
65 ms |
7648 KB |
wrong parameter |
13 |
Incorrect |
89 ms |
8432 KB |
wrong parameter |
14 |
Incorrect |
65 ms |
7696 KB |
wrong parameter |
15 |
Incorrect |
64 ms |
7724 KB |
wrong parameter |
16 |
Incorrect |
91 ms |
8212 KB |
wrong parameter |
17 |
Incorrect |
89 ms |
8136 KB |
wrong parameter |
18 |
Incorrect |
109 ms |
8520 KB |
wrong parameter |
19 |
Incorrect |
89 ms |
8060 KB |
wrong parameter |
20 |
Incorrect |
96 ms |
8792 KB |
wrong parameter |
21 |
Incorrect |
110 ms |
8820 KB |
wrong parameter |
22 |
Incorrect |
98 ms |
8460 KB |
wrong parameter |
23 |
Incorrect |
113 ms |
9176 KB |
wrong parameter |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
248 ms |
12568 KB |
wrong parameter |
2 |
Incorrect |
3 ms |
4612 KB |
wrong parameter |
3 |
Incorrect |
71 ms |
7436 KB |
wrong parameter |
4 |
Correct |
3 ms |
4728 KB |
Output is correct - 250 call(s) of encode_bit() |
5 |
Incorrect |
65 ms |
7648 KB |
wrong parameter |
6 |
Incorrect |
67 ms |
7864 KB |
wrong parameter |
7 |
Incorrect |
79 ms |
8228 KB |
wrong parameter |
8 |
Incorrect |
86 ms |
7564 KB |
wrong parameter |
9 |
Incorrect |
67 ms |
7808 KB |
wrong parameter |
10 |
Incorrect |
67 ms |
7724 KB |
wrong parameter |
11 |
Incorrect |
71 ms |
7836 KB |
wrong parameter |
12 |
Incorrect |
65 ms |
7648 KB |
wrong parameter |
13 |
Incorrect |
89 ms |
8432 KB |
wrong parameter |
14 |
Incorrect |
65 ms |
7696 KB |
wrong parameter |
15 |
Incorrect |
64 ms |
7724 KB |
wrong parameter |
16 |
Incorrect |
91 ms |
8212 KB |
wrong parameter |
17 |
Incorrect |
89 ms |
8136 KB |
wrong parameter |
18 |
Incorrect |
109 ms |
8520 KB |
wrong parameter |
19 |
Incorrect |
89 ms |
8060 KB |
wrong parameter |
20 |
Incorrect |
96 ms |
8792 KB |
wrong parameter |
21 |
Incorrect |
110 ms |
8820 KB |
wrong parameter |
22 |
Incorrect |
98 ms |
8460 KB |
wrong parameter |
23 |
Incorrect |
113 ms |
9176 KB |
wrong parameter |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
248 ms |
12568 KB |
wrong parameter |
2 |
Incorrect |
3 ms |
4612 KB |
wrong parameter |
3 |
Incorrect |
71 ms |
7436 KB |
wrong parameter |
4 |
Correct |
3 ms |
4728 KB |
Output is correct - 250 call(s) of encode_bit() |
5 |
Incorrect |
65 ms |
7648 KB |
wrong parameter |
6 |
Incorrect |
67 ms |
7864 KB |
wrong parameter |
7 |
Incorrect |
79 ms |
8228 KB |
wrong parameter |
8 |
Incorrect |
86 ms |
7564 KB |
wrong parameter |
9 |
Incorrect |
67 ms |
7808 KB |
wrong parameter |
10 |
Incorrect |
67 ms |
7724 KB |
wrong parameter |
11 |
Incorrect |
71 ms |
7836 KB |
wrong parameter |
12 |
Incorrect |
65 ms |
7648 KB |
wrong parameter |
13 |
Incorrect |
89 ms |
8432 KB |
wrong parameter |
14 |
Incorrect |
65 ms |
7696 KB |
wrong parameter |
15 |
Incorrect |
64 ms |
7724 KB |
wrong parameter |
16 |
Incorrect |
91 ms |
8212 KB |
wrong parameter |
17 |
Incorrect |
89 ms |
8136 KB |
wrong parameter |
18 |
Incorrect |
109 ms |
8520 KB |
wrong parameter |
19 |
Incorrect |
89 ms |
8060 KB |
wrong parameter |
20 |
Incorrect |
96 ms |
8792 KB |
wrong parameter |
21 |
Incorrect |
110 ms |
8820 KB |
wrong parameter |
22 |
Incorrect |
98 ms |
8460 KB |
wrong parameter |
23 |
Incorrect |
113 ms |
9176 KB |
wrong parameter |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
248 ms |
12568 KB |
wrong parameter |
2 |
Incorrect |
3 ms |
4612 KB |
wrong parameter |
3 |
Incorrect |
71 ms |
7436 KB |
wrong parameter |
4 |
Correct |
3 ms |
4728 KB |
Output is correct - 250 call(s) of encode_bit() |
5 |
Incorrect |
65 ms |
7648 KB |
wrong parameter |
6 |
Incorrect |
67 ms |
7864 KB |
wrong parameter |
7 |
Incorrect |
79 ms |
8228 KB |
wrong parameter |
8 |
Incorrect |
86 ms |
7564 KB |
wrong parameter |
9 |
Incorrect |
67 ms |
7808 KB |
wrong parameter |
10 |
Incorrect |
67 ms |
7724 KB |
wrong parameter |
11 |
Incorrect |
71 ms |
7836 KB |
wrong parameter |
12 |
Incorrect |
65 ms |
7648 KB |
wrong parameter |
13 |
Incorrect |
89 ms |
8432 KB |
wrong parameter |
14 |
Incorrect |
65 ms |
7696 KB |
wrong parameter |
15 |
Incorrect |
64 ms |
7724 KB |
wrong parameter |
16 |
Incorrect |
91 ms |
8212 KB |
wrong parameter |
17 |
Incorrect |
89 ms |
8136 KB |
wrong parameter |
18 |
Incorrect |
109 ms |
8520 KB |
wrong parameter |
19 |
Incorrect |
89 ms |
8060 KB |
wrong parameter |
20 |
Incorrect |
96 ms |
8792 KB |
wrong parameter |
21 |
Incorrect |
110 ms |
8820 KB |
wrong parameter |
22 |
Incorrect |
98 ms |
8460 KB |
wrong parameter |
23 |
Incorrect |
113 ms |
9176 KB |
wrong parameter |