# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
476468 |
2021-09-27T09:31:41 Z |
AdamGS |
Saveit (IOI10_saveit) |
C++14 |
|
218 ms |
9460 KB |
#include "grader.h"
#include "encoder.h"
#include<bits/stdc++.h>
using namespace std;
typedef long double ld;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
void encode(int n, int h, int m, int *a, int *b) {
vector<pair<int,int>>V[n];
int uzyte[m], odl[n];
rep(i, m) {
uzyte[i]=0;
V[a[i]].pb({b[i], i});
V[b[i]].pb({a[i], i});
}
rep(i, h) {
rep(j, n) odl[j]=1000000007;
queue<int>q;
q.push(i);
odl[i]=0;
while(!q.empty()) {
int p=q.front(); q.pop();
for(auto j : V[p]) if(odl[j.st]>odl[p]+1) {
odl[j.st]=odl[p]+1;
q.push(j.st);
uzyte[j.nd]=1;
}
}
}
vector<int>T[n];
rep(i, m) if(uzyte[i]) {
T[a[i]].pb(b[i]);
T[b[i]].pb(a[i]);
}
rep(i, h) rep(j, 10) encode_bit(i&(1<<j));
rep(i, n) {
rep(j, 10) encode_bit(T[i].size()&(1<<j));
for(auto j : T[i]) {
rep(l, 10) encode_bit(j&(1<<l));
}
}
}
#include "grader.h"
#include "decoder.h"
#include<bits/stdc++.h>
using namespace std;
typedef long double ld;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
void decode(int n, int h) {
vector<int>V[n];
rep(i, n) {
int a=0;
rep(j, 10) a+=decode_bit()*(1<<j);
rep(j, a) {
int x=0;
rep(l, 10) x+=decode_bit()*(1<<l);
V[i].pb(x);
}
}
rep(i, h) {
int odl[n];
rep(j, n) odl[j]=1000000007;
queue<int>q;
q.push(i);
odl[i]=0;
while(!q.empty()) {
int p=q.front(); q.pop();
for(auto j : V[p]) if(odl[j]>odl[p]+1) {
odl[j]=odl[p]+1;
q.push(j);
}
}
rep(j, n) hops(i, j, odl[j]);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
218 ms |
9460 KB |
encode_bit(b) wrong parameter |
2 |
Incorrect |
1 ms |
628 KB |
encode_bit(b) wrong parameter |
3 |
Incorrect |
6 ms |
868 KB |
encode_bit(b) wrong parameter |
4 |
Incorrect |
1 ms |
620 KB |
encode_bit(b) wrong parameter |
5 |
Incorrect |
10 ms |
1256 KB |
encode_bit(b) wrong parameter |
6 |
Incorrect |
10 ms |
1232 KB |
encode_bit(b) wrong parameter |
7 |
Incorrect |
40 ms |
1884 KB |
encode_bit(b) wrong parameter |
8 |
Incorrect |
5 ms |
868 KB |
encode_bit(b) wrong parameter |
9 |
Incorrect |
5 ms |
932 KB |
encode_bit(b) wrong parameter |
10 |
Incorrect |
7 ms |
876 KB |
encode_bit(b) wrong parameter |
11 |
Incorrect |
13 ms |
1108 KB |
encode_bit(b) wrong parameter |
12 |
Incorrect |
6 ms |
736 KB |
encode_bit(b) wrong parameter |
13 |
Incorrect |
48 ms |
2076 KB |
encode_bit(b) wrong parameter |
14 |
Incorrect |
9 ms |
848 KB |
encode_bit(b) wrong parameter |
15 |
Incorrect |
8 ms |
980 KB |
encode_bit(b) wrong parameter |
16 |
Incorrect |
36 ms |
1856 KB |
encode_bit(b) wrong parameter |
17 |
Incorrect |
27 ms |
1764 KB |
encode_bit(b) wrong parameter |
18 |
Incorrect |
50 ms |
2268 KB |
encode_bit(b) wrong parameter |
19 |
Incorrect |
14 ms |
1616 KB |
encode_bit(b) wrong parameter |
20 |
Incorrect |
45 ms |
2920 KB |
encode_bit(b) wrong parameter |
21 |
Incorrect |
58 ms |
3016 KB |
encode_bit(b) wrong parameter |
22 |
Incorrect |
47 ms |
2132 KB |
encode_bit(b) wrong parameter |
23 |
Incorrect |
50 ms |
3412 KB |
encode_bit(b) wrong parameter |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
218 ms |
9460 KB |
encode_bit(b) wrong parameter |
2 |
Incorrect |
1 ms |
628 KB |
encode_bit(b) wrong parameter |
3 |
Incorrect |
6 ms |
868 KB |
encode_bit(b) wrong parameter |
4 |
Incorrect |
1 ms |
620 KB |
encode_bit(b) wrong parameter |
5 |
Incorrect |
10 ms |
1256 KB |
encode_bit(b) wrong parameter |
6 |
Incorrect |
10 ms |
1232 KB |
encode_bit(b) wrong parameter |
7 |
Incorrect |
40 ms |
1884 KB |
encode_bit(b) wrong parameter |
8 |
Incorrect |
5 ms |
868 KB |
encode_bit(b) wrong parameter |
9 |
Incorrect |
5 ms |
932 KB |
encode_bit(b) wrong parameter |
10 |
Incorrect |
7 ms |
876 KB |
encode_bit(b) wrong parameter |
11 |
Incorrect |
13 ms |
1108 KB |
encode_bit(b) wrong parameter |
12 |
Incorrect |
6 ms |
736 KB |
encode_bit(b) wrong parameter |
13 |
Incorrect |
48 ms |
2076 KB |
encode_bit(b) wrong parameter |
14 |
Incorrect |
9 ms |
848 KB |
encode_bit(b) wrong parameter |
15 |
Incorrect |
8 ms |
980 KB |
encode_bit(b) wrong parameter |
16 |
Incorrect |
36 ms |
1856 KB |
encode_bit(b) wrong parameter |
17 |
Incorrect |
27 ms |
1764 KB |
encode_bit(b) wrong parameter |
18 |
Incorrect |
50 ms |
2268 KB |
encode_bit(b) wrong parameter |
19 |
Incorrect |
14 ms |
1616 KB |
encode_bit(b) wrong parameter |
20 |
Incorrect |
45 ms |
2920 KB |
encode_bit(b) wrong parameter |
21 |
Incorrect |
58 ms |
3016 KB |
encode_bit(b) wrong parameter |
22 |
Incorrect |
47 ms |
2132 KB |
encode_bit(b) wrong parameter |
23 |
Incorrect |
50 ms |
3412 KB |
encode_bit(b) wrong parameter |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
218 ms |
9460 KB |
encode_bit(b) wrong parameter |
2 |
Incorrect |
1 ms |
628 KB |
encode_bit(b) wrong parameter |
3 |
Incorrect |
6 ms |
868 KB |
encode_bit(b) wrong parameter |
4 |
Incorrect |
1 ms |
620 KB |
encode_bit(b) wrong parameter |
5 |
Incorrect |
10 ms |
1256 KB |
encode_bit(b) wrong parameter |
6 |
Incorrect |
10 ms |
1232 KB |
encode_bit(b) wrong parameter |
7 |
Incorrect |
40 ms |
1884 KB |
encode_bit(b) wrong parameter |
8 |
Incorrect |
5 ms |
868 KB |
encode_bit(b) wrong parameter |
9 |
Incorrect |
5 ms |
932 KB |
encode_bit(b) wrong parameter |
10 |
Incorrect |
7 ms |
876 KB |
encode_bit(b) wrong parameter |
11 |
Incorrect |
13 ms |
1108 KB |
encode_bit(b) wrong parameter |
12 |
Incorrect |
6 ms |
736 KB |
encode_bit(b) wrong parameter |
13 |
Incorrect |
48 ms |
2076 KB |
encode_bit(b) wrong parameter |
14 |
Incorrect |
9 ms |
848 KB |
encode_bit(b) wrong parameter |
15 |
Incorrect |
8 ms |
980 KB |
encode_bit(b) wrong parameter |
16 |
Incorrect |
36 ms |
1856 KB |
encode_bit(b) wrong parameter |
17 |
Incorrect |
27 ms |
1764 KB |
encode_bit(b) wrong parameter |
18 |
Incorrect |
50 ms |
2268 KB |
encode_bit(b) wrong parameter |
19 |
Incorrect |
14 ms |
1616 KB |
encode_bit(b) wrong parameter |
20 |
Incorrect |
45 ms |
2920 KB |
encode_bit(b) wrong parameter |
21 |
Incorrect |
58 ms |
3016 KB |
encode_bit(b) wrong parameter |
22 |
Incorrect |
47 ms |
2132 KB |
encode_bit(b) wrong parameter |
23 |
Incorrect |
50 ms |
3412 KB |
encode_bit(b) wrong parameter |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
218 ms |
9460 KB |
encode_bit(b) wrong parameter |
2 |
Incorrect |
1 ms |
628 KB |
encode_bit(b) wrong parameter |
3 |
Incorrect |
6 ms |
868 KB |
encode_bit(b) wrong parameter |
4 |
Incorrect |
1 ms |
620 KB |
encode_bit(b) wrong parameter |
5 |
Incorrect |
10 ms |
1256 KB |
encode_bit(b) wrong parameter |
6 |
Incorrect |
10 ms |
1232 KB |
encode_bit(b) wrong parameter |
7 |
Incorrect |
40 ms |
1884 KB |
encode_bit(b) wrong parameter |
8 |
Incorrect |
5 ms |
868 KB |
encode_bit(b) wrong parameter |
9 |
Incorrect |
5 ms |
932 KB |
encode_bit(b) wrong parameter |
10 |
Incorrect |
7 ms |
876 KB |
encode_bit(b) wrong parameter |
11 |
Incorrect |
13 ms |
1108 KB |
encode_bit(b) wrong parameter |
12 |
Incorrect |
6 ms |
736 KB |
encode_bit(b) wrong parameter |
13 |
Incorrect |
48 ms |
2076 KB |
encode_bit(b) wrong parameter |
14 |
Incorrect |
9 ms |
848 KB |
encode_bit(b) wrong parameter |
15 |
Incorrect |
8 ms |
980 KB |
encode_bit(b) wrong parameter |
16 |
Incorrect |
36 ms |
1856 KB |
encode_bit(b) wrong parameter |
17 |
Incorrect |
27 ms |
1764 KB |
encode_bit(b) wrong parameter |
18 |
Incorrect |
50 ms |
2268 KB |
encode_bit(b) wrong parameter |
19 |
Incorrect |
14 ms |
1616 KB |
encode_bit(b) wrong parameter |
20 |
Incorrect |
45 ms |
2920 KB |
encode_bit(b) wrong parameter |
21 |
Incorrect |
58 ms |
3016 KB |
encode_bit(b) wrong parameter |
22 |
Incorrect |
47 ms |
2132 KB |
encode_bit(b) wrong parameter |
23 |
Incorrect |
50 ms |
3412 KB |
encode_bit(b) wrong parameter |