# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
899198 |
2024-01-05T15:18:41 Z |
Macker |
Saveit (IOI10_saveit) |
C++17 |
|
264 ms |
20360 KB |
#include <bits/stdc++.h>
#include "grader.h"
#include "encoder.h"
using namespace std;
void encode(int nv, int nh, int ne, int *v1, int *v2){
vector<vector<int>> adj(nv);
for (int i = 0; i < ne; i++) {
adj[v1[i]].push_back(v2[i]);
adj[v2[i]].push_back(v1[i]);
}
for (int i = 0; i < nh; i++)
{
queue<int> q({i});
vector<int> dist(nv, INT_MAX);
dist[i] = 0;
while(q.size()){
int a = q.front(); q.pop();
for (auto b : adj[a]) {
if(dist[b] > dist[a] + 1){
dist[b] = dist[a] + 1;
q.push(b);
}
}
}
for (int i = 0; i < nv; i++) {
for (int b = 0; b < 10; b++) {
encode_bit((bool)(dist[i] & (1 << b)));
}
}
}
return;
}
#include "grader.h"
#include "decoder.h"
#include <bits/stdc++.h>
using namespace std;
void decode(int nv, int nh) {
for (int i = 0; i < nh; i++){
for (int j = 0; j < nv; j++) {
int res = 0;
for (int k = 0, x = 1; k < 10; k++, x *= 2) {
if(decode_bit()){
res += x;
}
}
hops(i, j, res);
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
264 ms |
20360 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
2 |
Correct |
2 ms |
11268 KB |
Output is correct - 150 call(s) of encode_bit() |
3 |
Correct |
49 ms |
15416 KB |
Output is partially correct - 324000 call(s) of encode_bit() |
4 |
Correct |
2 ms |
11268 KB |
Output is correct - 250 call(s) of encode_bit() |
5 |
Correct |
53 ms |
15772 KB |
Output is partially correct - 324000 call(s) of encode_bit() |
6 |
Correct |
60 ms |
15728 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
7 |
Correct |
66 ms |
16020 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
8 |
Correct |
53 ms |
15344 KB |
Output is partially correct - 345960 call(s) of encode_bit() |
9 |
Correct |
56 ms |
15568 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
10 |
Correct |
55 ms |
15368 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
11 |
Correct |
68 ms |
15500 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
12 |
Correct |
54 ms |
15464 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
13 |
Correct |
73 ms |
15620 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
14 |
Correct |
62 ms |
15776 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
15 |
Correct |
55 ms |
15840 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
16 |
Correct |
72 ms |
16108 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
17 |
Correct |
63 ms |
15908 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
18 |
Correct |
75 ms |
16232 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
19 |
Correct |
63 ms |
15752 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
20 |
Correct |
97 ms |
18564 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
21 |
Correct |
100 ms |
18616 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
22 |
Correct |
81 ms |
16200 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
23 |
Correct |
92 ms |
18664 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
264 ms |
20360 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
2 |
Correct |
2 ms |
11268 KB |
Output is correct - 150 call(s) of encode_bit() |
3 |
Correct |
49 ms |
15416 KB |
Output is partially correct - 324000 call(s) of encode_bit() |
4 |
Correct |
2 ms |
11268 KB |
Output is correct - 250 call(s) of encode_bit() |
5 |
Correct |
53 ms |
15772 KB |
Output is partially correct - 324000 call(s) of encode_bit() |
6 |
Correct |
60 ms |
15728 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
7 |
Correct |
66 ms |
16020 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
8 |
Correct |
53 ms |
15344 KB |
Output is partially correct - 345960 call(s) of encode_bit() |
9 |
Correct |
56 ms |
15568 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
10 |
Correct |
55 ms |
15368 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
11 |
Correct |
68 ms |
15500 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
12 |
Correct |
54 ms |
15464 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
13 |
Correct |
73 ms |
15620 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
14 |
Correct |
62 ms |
15776 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
15 |
Correct |
55 ms |
15840 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
16 |
Correct |
72 ms |
16108 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
17 |
Correct |
63 ms |
15908 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
18 |
Correct |
75 ms |
16232 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
19 |
Correct |
63 ms |
15752 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
20 |
Correct |
97 ms |
18564 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
21 |
Correct |
100 ms |
18616 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
22 |
Correct |
81 ms |
16200 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
23 |
Correct |
92 ms |
18664 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
264 ms |
20360 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
2 |
Correct |
2 ms |
11268 KB |
Output is correct - 150 call(s) of encode_bit() |
3 |
Correct |
49 ms |
15416 KB |
Output is partially correct - 324000 call(s) of encode_bit() |
4 |
Correct |
2 ms |
11268 KB |
Output is correct - 250 call(s) of encode_bit() |
5 |
Correct |
53 ms |
15772 KB |
Output is partially correct - 324000 call(s) of encode_bit() |
6 |
Correct |
60 ms |
15728 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
7 |
Correct |
66 ms |
16020 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
8 |
Correct |
53 ms |
15344 KB |
Output is partially correct - 345960 call(s) of encode_bit() |
9 |
Correct |
56 ms |
15568 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
10 |
Correct |
55 ms |
15368 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
11 |
Correct |
68 ms |
15500 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
12 |
Correct |
54 ms |
15464 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
13 |
Correct |
73 ms |
15620 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
14 |
Correct |
62 ms |
15776 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
15 |
Correct |
55 ms |
15840 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
16 |
Correct |
72 ms |
16108 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
17 |
Correct |
63 ms |
15908 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
18 |
Correct |
75 ms |
16232 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
19 |
Correct |
63 ms |
15752 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
20 |
Correct |
97 ms |
18564 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
21 |
Correct |
100 ms |
18616 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
22 |
Correct |
81 ms |
16200 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
23 |
Correct |
92 ms |
18664 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
264 ms |
20360 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
2 |
Correct |
2 ms |
11268 KB |
Output is correct - 150 call(s) of encode_bit() |
3 |
Correct |
49 ms |
15416 KB |
Output is partially correct - 324000 call(s) of encode_bit() |
4 |
Correct |
2 ms |
11268 KB |
Output is correct - 250 call(s) of encode_bit() |
5 |
Correct |
53 ms |
15772 KB |
Output is partially correct - 324000 call(s) of encode_bit() |
6 |
Correct |
60 ms |
15728 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
7 |
Correct |
66 ms |
16020 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
8 |
Correct |
53 ms |
15344 KB |
Output is partially correct - 345960 call(s) of encode_bit() |
9 |
Correct |
56 ms |
15568 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
10 |
Correct |
55 ms |
15368 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
11 |
Correct |
68 ms |
15500 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
12 |
Correct |
54 ms |
15464 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
13 |
Correct |
73 ms |
15620 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
14 |
Correct |
62 ms |
15776 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
15 |
Correct |
55 ms |
15840 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
16 |
Correct |
72 ms |
16108 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
17 |
Correct |
63 ms |
15908 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
18 |
Correct |
75 ms |
16232 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
19 |
Correct |
63 ms |
15752 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
20 |
Correct |
97 ms |
18564 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
21 |
Correct |
100 ms |
18616 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
22 |
Correct |
81 ms |
16200 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
23 |
Correct |
92 ms |
18664 KB |
Output is partially correct - 360000 call(s) of encode_bit() |