# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
565040 |
2022-05-20T08:03:31 Z |
1zaid1 |
Saveit (IOI10_saveit) |
C++14 |
|
283 ms |
20484 KB |
#include "grader.h"
#include "encoder.h"
#include<bits/stdc++.h>
using namespace std;
const int M = 1e4+5;
vector<vector<int>> node(M, vector<int>({}));
vector<int> vis(M, 0), dist(M, 0);
void bfs(int s) {
queue<int> q;
q.push(s);
vis[s] = true;
while (!q.empty()) {
int f = q.front(); q.pop();
for (int i:node[f]) {
if (!vis[i]) {
vis[i] = true;
dist[i] = dist[f]+1;
q.push(i);
}
}
}
}
void encode(int n, int h, int p, int *a, int *b){
for (int i = 0; i < p; i++) {
node[a[i]].push_back(b[i]);
node[b[i]].push_back(a[i]);
}
map<pair<int, int>, int> ans;
for (int i = 0; i < h; i++) {
for (int j = 0; j < n; j++) dist[j] = vis[j] = 0;
bfs(i);
for (int j = 0; j < n; j++) ans[{i, j}] = dist[j];
}
for (int i = 0; i < h; i++) {
for (int j = i+1; j < n; j++) {
for (int k = 0; k < 10; k++) {
encode_bit((ans[{i, j}]&(1<<k))!=0);
}
}
}
return;
}
#include "grader.h"
#include "decoder.h"
#include<bits/stdc++.h>
using namespace std;
void decode(int n, int h) {
vector<vector<int>> pp(h, vector<int>(n, 0));
for (int i = 0; i < h; i++) {
for (int j = i+1; j < n; j++) {
for (int k = 0; k < 10; k++) {
pp[i][j] += decode_bit()*(1<<k);
pp[j][i] = pp[i][j];
}
}
}
for (int i = 0; i < h; i++) {
for (int j = 0; j < n; j++) {
hops(i, j, pp[i][j]);
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
283 ms |
20484 KB |
Execution killed with signal 11 |
2 |
Runtime error |
8 ms |
8968 KB |
Execution killed with signal 11 |
3 |
Runtime error |
102 ms |
15204 KB |
Execution killed with signal 11 |
4 |
Correct |
3 ms |
4880 KB |
Output is correct - 100 call(s) of encode_bit() |
5 |
Runtime error |
92 ms |
15408 KB |
Execution killed with signal 11 |
6 |
Runtime error |
111 ms |
16028 KB |
Execution killed with signal 11 |
7 |
Runtime error |
119 ms |
16324 KB |
Execution killed with signal 11 |
8 |
Runtime error |
110 ms |
15736 KB |
Execution killed with signal 11 |
9 |
Runtime error |
119 ms |
15940 KB |
Execution killed with signal 11 |
10 |
Runtime error |
116 ms |
15968 KB |
Execution killed with signal 11 |
11 |
Runtime error |
115 ms |
16064 KB |
Execution killed with signal 11 |
12 |
Runtime error |
106 ms |
15868 KB |
Execution killed with signal 11 |
13 |
Runtime error |
134 ms |
16540 KB |
Execution killed with signal 11 |
14 |
Runtime error |
100 ms |
15784 KB |
Execution killed with signal 11 |
15 |
Runtime error |
121 ms |
15920 KB |
Execution killed with signal 11 |
16 |
Runtime error |
129 ms |
16416 KB |
Execution killed with signal 11 |
17 |
Runtime error |
135 ms |
16456 KB |
Execution killed with signal 11 |
18 |
Runtime error |
156 ms |
16548 KB |
Execution killed with signal 11 |
19 |
Runtime error |
110 ms |
16296 KB |
Execution killed with signal 11 |
20 |
Runtime error |
139 ms |
16836 KB |
Execution killed with signal 11 |
21 |
Runtime error |
148 ms |
17000 KB |
Execution killed with signal 11 |
22 |
Runtime error |
115 ms |
16628 KB |
Execution killed with signal 11 |
23 |
Runtime error |
160 ms |
17276 KB |
Execution killed with signal 11 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
283 ms |
20484 KB |
Execution killed with signal 11 |
2 |
Runtime error |
8 ms |
8968 KB |
Execution killed with signal 11 |
3 |
Runtime error |
102 ms |
15204 KB |
Execution killed with signal 11 |
4 |
Correct |
3 ms |
4880 KB |
Output is correct - 100 call(s) of encode_bit() |
5 |
Runtime error |
92 ms |
15408 KB |
Execution killed with signal 11 |
6 |
Runtime error |
111 ms |
16028 KB |
Execution killed with signal 11 |
7 |
Runtime error |
119 ms |
16324 KB |
Execution killed with signal 11 |
8 |
Runtime error |
110 ms |
15736 KB |
Execution killed with signal 11 |
9 |
Runtime error |
119 ms |
15940 KB |
Execution killed with signal 11 |
10 |
Runtime error |
116 ms |
15968 KB |
Execution killed with signal 11 |
11 |
Runtime error |
115 ms |
16064 KB |
Execution killed with signal 11 |
12 |
Runtime error |
106 ms |
15868 KB |
Execution killed with signal 11 |
13 |
Runtime error |
134 ms |
16540 KB |
Execution killed with signal 11 |
14 |
Runtime error |
100 ms |
15784 KB |
Execution killed with signal 11 |
15 |
Runtime error |
121 ms |
15920 KB |
Execution killed with signal 11 |
16 |
Runtime error |
129 ms |
16416 KB |
Execution killed with signal 11 |
17 |
Runtime error |
135 ms |
16456 KB |
Execution killed with signal 11 |
18 |
Runtime error |
156 ms |
16548 KB |
Execution killed with signal 11 |
19 |
Runtime error |
110 ms |
16296 KB |
Execution killed with signal 11 |
20 |
Runtime error |
139 ms |
16836 KB |
Execution killed with signal 11 |
21 |
Runtime error |
148 ms |
17000 KB |
Execution killed with signal 11 |
22 |
Runtime error |
115 ms |
16628 KB |
Execution killed with signal 11 |
23 |
Runtime error |
160 ms |
17276 KB |
Execution killed with signal 11 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
283 ms |
20484 KB |
Execution killed with signal 11 |
2 |
Runtime error |
8 ms |
8968 KB |
Execution killed with signal 11 |
3 |
Runtime error |
102 ms |
15204 KB |
Execution killed with signal 11 |
4 |
Correct |
3 ms |
4880 KB |
Output is correct - 100 call(s) of encode_bit() |
5 |
Runtime error |
92 ms |
15408 KB |
Execution killed with signal 11 |
6 |
Runtime error |
111 ms |
16028 KB |
Execution killed with signal 11 |
7 |
Runtime error |
119 ms |
16324 KB |
Execution killed with signal 11 |
8 |
Runtime error |
110 ms |
15736 KB |
Execution killed with signal 11 |
9 |
Runtime error |
119 ms |
15940 KB |
Execution killed with signal 11 |
10 |
Runtime error |
116 ms |
15968 KB |
Execution killed with signal 11 |
11 |
Runtime error |
115 ms |
16064 KB |
Execution killed with signal 11 |
12 |
Runtime error |
106 ms |
15868 KB |
Execution killed with signal 11 |
13 |
Runtime error |
134 ms |
16540 KB |
Execution killed with signal 11 |
14 |
Runtime error |
100 ms |
15784 KB |
Execution killed with signal 11 |
15 |
Runtime error |
121 ms |
15920 KB |
Execution killed with signal 11 |
16 |
Runtime error |
129 ms |
16416 KB |
Execution killed with signal 11 |
17 |
Runtime error |
135 ms |
16456 KB |
Execution killed with signal 11 |
18 |
Runtime error |
156 ms |
16548 KB |
Execution killed with signal 11 |
19 |
Runtime error |
110 ms |
16296 KB |
Execution killed with signal 11 |
20 |
Runtime error |
139 ms |
16836 KB |
Execution killed with signal 11 |
21 |
Runtime error |
148 ms |
17000 KB |
Execution killed with signal 11 |
22 |
Runtime error |
115 ms |
16628 KB |
Execution killed with signal 11 |
23 |
Runtime error |
160 ms |
17276 KB |
Execution killed with signal 11 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
283 ms |
20484 KB |
Execution killed with signal 11 |
2 |
Runtime error |
8 ms |
8968 KB |
Execution killed with signal 11 |
3 |
Runtime error |
102 ms |
15204 KB |
Execution killed with signal 11 |
4 |
Correct |
3 ms |
4880 KB |
Output is correct - 100 call(s) of encode_bit() |
5 |
Runtime error |
92 ms |
15408 KB |
Execution killed with signal 11 |
6 |
Runtime error |
111 ms |
16028 KB |
Execution killed with signal 11 |
7 |
Runtime error |
119 ms |
16324 KB |
Execution killed with signal 11 |
8 |
Runtime error |
110 ms |
15736 KB |
Execution killed with signal 11 |
9 |
Runtime error |
119 ms |
15940 KB |
Execution killed with signal 11 |
10 |
Runtime error |
116 ms |
15968 KB |
Execution killed with signal 11 |
11 |
Runtime error |
115 ms |
16064 KB |
Execution killed with signal 11 |
12 |
Runtime error |
106 ms |
15868 KB |
Execution killed with signal 11 |
13 |
Runtime error |
134 ms |
16540 KB |
Execution killed with signal 11 |
14 |
Runtime error |
100 ms |
15784 KB |
Execution killed with signal 11 |
15 |
Runtime error |
121 ms |
15920 KB |
Execution killed with signal 11 |
16 |
Runtime error |
129 ms |
16416 KB |
Execution killed with signal 11 |
17 |
Runtime error |
135 ms |
16456 KB |
Execution killed with signal 11 |
18 |
Runtime error |
156 ms |
16548 KB |
Execution killed with signal 11 |
19 |
Runtime error |
110 ms |
16296 KB |
Execution killed with signal 11 |
20 |
Runtime error |
139 ms |
16836 KB |
Execution killed with signal 11 |
21 |
Runtime error |
148 ms |
17000 KB |
Execution killed with signal 11 |
22 |
Runtime error |
115 ms |
16628 KB |
Execution killed with signal 11 |
23 |
Runtime error |
160 ms |
17276 KB |
Execution killed with signal 11 |