Submission #384001

# Submission time Handle Problem Language Result Execution time Memory
384001 2021-03-31T07:25:26 Z MODDI Saveit (IOI10_saveit) C++14
50 / 100
368 ms 12776 KB
#include "grader.h"
#include "encoder.h"
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define mp make_pair
using namespace std;
int dist[1010];
vector<int> adj[1010];
void encode(int n, int h, int m, int *v1, int *v2) {
	for( int i = 0 ; i < m ; i++ ) {
		int u = v1[i] , v = v2[i];
		adj[u].pb(v);
		adj[v].pb(u);
	}
	for( int src = 0 ; src < h ; src++ ) {
		queue<int> Q;
		memset(dist,-1,sizeof(dist));
		Q.push(src);
		dist[src] = 0;
		while(!Q.empty()) {
			int u = Q.front();
			Q.pop();
			int deg = adj[u].size();
			for( int i = 0 ; i < deg ; i++ ) {
				int v = adj[u][i];
				if(dist[v] == -1) {
					Q.push(v);
					dist[v] = dist[u]+1;
				}
			}
		}
		for( int i = 0 ; i < n ; i++ )
			for( int j = 0 ; j < 10 ; j++ )
				if(dist[i]&(1<<j))
					encode_bit(1);
				else
					encode_bit(0);
	}
}
#include "grader.h"
#include "decoder.h"
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define mp make_pair
#define pb push_back
using namespace std;
void decode(int n, int h) {
	for( int i = 0 ; i < h ; i++ )
		for( int j = 0 ; j < n ; j++ ) {
			int val = 0;
			for( int k = 0 ; k < 10 ; k++ )
				val |= (decode_bit() * (1<<k));
			hops(i,j,val);
		}
}
# Verdict Execution time Memory Grader output
1 Correct 368 ms 12776 KB Output is partially correct - 360000 call(s) of encode_bit()
2 Correct 4 ms 4716 KB Output is correct - 150 call(s) of encode_bit()
3 Correct 90 ms 7608 KB Output is partially correct - 324000 call(s) of encode_bit()
4 Correct 4 ms 4752 KB Output is correct - 250 call(s) of encode_bit()
5 Correct 84 ms 7520 KB Output is partially correct - 324000 call(s) of encode_bit()
6 Correct 104 ms 7932 KB Output is partially correct - 360000 call(s) of encode_bit()
7 Correct 115 ms 8288 KB Output is partially correct - 360000 call(s) of encode_bit()
8 Correct 88 ms 7696 KB Output is partially correct - 345960 call(s) of encode_bit()
9 Correct 102 ms 7888 KB Output is partially correct - 360000 call(s) of encode_bit()
10 Correct 106 ms 7736 KB Output is partially correct - 360000 call(s) of encode_bit()
11 Correct 106 ms 7976 KB Output is partially correct - 360000 call(s) of encode_bit()
12 Correct 98 ms 7908 KB Output is partially correct - 360000 call(s) of encode_bit()
13 Correct 130 ms 8664 KB Output is partially correct - 360000 call(s) of encode_bit()
14 Correct 103 ms 7828 KB Output is partially correct - 360000 call(s) of encode_bit()
15 Correct 94 ms 7880 KB Output is partially correct - 360000 call(s) of encode_bit()
16 Correct 128 ms 8288 KB Output is partially correct - 360000 call(s) of encode_bit()
17 Correct 121 ms 8288 KB Output is partially correct - 360000 call(s) of encode_bit()
18 Correct 135 ms 8544 KB Output is partially correct - 360000 call(s) of encode_bit()
19 Correct 105 ms 8160 KB Output is partially correct - 360000 call(s) of encode_bit()
20 Correct 153 ms 8972 KB Output is partially correct - 360000 call(s) of encode_bit()
21 Correct 169 ms 9056 KB Output is partially correct - 360000 call(s) of encode_bit()
22 Correct 119 ms 8308 KB Output is partially correct - 360000 call(s) of encode_bit()
23 Correct 173 ms 9056 KB Output is partially correct - 360000 call(s) of encode_bit()
# Verdict Execution time Memory Grader output
1 Correct 368 ms 12776 KB Output is partially correct - 360000 call(s) of encode_bit()
2 Correct 4 ms 4716 KB Output is correct - 150 call(s) of encode_bit()
3 Correct 90 ms 7608 KB Output is partially correct - 324000 call(s) of encode_bit()
4 Correct 4 ms 4752 KB Output is correct - 250 call(s) of encode_bit()
5 Correct 84 ms 7520 KB Output is partially correct - 324000 call(s) of encode_bit()
6 Correct 104 ms 7932 KB Output is partially correct - 360000 call(s) of encode_bit()
7 Correct 115 ms 8288 KB Output is partially correct - 360000 call(s) of encode_bit()
8 Correct 88 ms 7696 KB Output is partially correct - 345960 call(s) of encode_bit()
9 Correct 102 ms 7888 KB Output is partially correct - 360000 call(s) of encode_bit()
10 Correct 106 ms 7736 KB Output is partially correct - 360000 call(s) of encode_bit()
11 Correct 106 ms 7976 KB Output is partially correct - 360000 call(s) of encode_bit()
12 Correct 98 ms 7908 KB Output is partially correct - 360000 call(s) of encode_bit()
13 Correct 130 ms 8664 KB Output is partially correct - 360000 call(s) of encode_bit()
14 Correct 103 ms 7828 KB Output is partially correct - 360000 call(s) of encode_bit()
15 Correct 94 ms 7880 KB Output is partially correct - 360000 call(s) of encode_bit()
16 Correct 128 ms 8288 KB Output is partially correct - 360000 call(s) of encode_bit()
17 Correct 121 ms 8288 KB Output is partially correct - 360000 call(s) of encode_bit()
18 Correct 135 ms 8544 KB Output is partially correct - 360000 call(s) of encode_bit()
19 Correct 105 ms 8160 KB Output is partially correct - 360000 call(s) of encode_bit()
20 Correct 153 ms 8972 KB Output is partially correct - 360000 call(s) of encode_bit()
21 Correct 169 ms 9056 KB Output is partially correct - 360000 call(s) of encode_bit()
22 Correct 119 ms 8308 KB Output is partially correct - 360000 call(s) of encode_bit()
23 Correct 173 ms 9056 KB Output is partially correct - 360000 call(s) of encode_bit()
# Verdict Execution time Memory Grader output
1 Correct 368 ms 12776 KB Output is partially correct - 360000 call(s) of encode_bit()
2 Correct 4 ms 4716 KB Output is correct - 150 call(s) of encode_bit()
3 Correct 90 ms 7608 KB Output is partially correct - 324000 call(s) of encode_bit()
4 Correct 4 ms 4752 KB Output is correct - 250 call(s) of encode_bit()
5 Correct 84 ms 7520 KB Output is partially correct - 324000 call(s) of encode_bit()
6 Correct 104 ms 7932 KB Output is partially correct - 360000 call(s) of encode_bit()
7 Correct 115 ms 8288 KB Output is partially correct - 360000 call(s) of encode_bit()
8 Correct 88 ms 7696 KB Output is partially correct - 345960 call(s) of encode_bit()
9 Correct 102 ms 7888 KB Output is partially correct - 360000 call(s) of encode_bit()
10 Correct 106 ms 7736 KB Output is partially correct - 360000 call(s) of encode_bit()
11 Correct 106 ms 7976 KB Output is partially correct - 360000 call(s) of encode_bit()
12 Correct 98 ms 7908 KB Output is partially correct - 360000 call(s) of encode_bit()
13 Correct 130 ms 8664 KB Output is partially correct - 360000 call(s) of encode_bit()
14 Correct 103 ms 7828 KB Output is partially correct - 360000 call(s) of encode_bit()
15 Correct 94 ms 7880 KB Output is partially correct - 360000 call(s) of encode_bit()
16 Correct 128 ms 8288 KB Output is partially correct - 360000 call(s) of encode_bit()
17 Correct 121 ms 8288 KB Output is partially correct - 360000 call(s) of encode_bit()
18 Correct 135 ms 8544 KB Output is partially correct - 360000 call(s) of encode_bit()
19 Correct 105 ms 8160 KB Output is partially correct - 360000 call(s) of encode_bit()
20 Correct 153 ms 8972 KB Output is partially correct - 360000 call(s) of encode_bit()
21 Correct 169 ms 9056 KB Output is partially correct - 360000 call(s) of encode_bit()
22 Correct 119 ms 8308 KB Output is partially correct - 360000 call(s) of encode_bit()
23 Correct 173 ms 9056 KB Output is partially correct - 360000 call(s) of encode_bit()
# Verdict Execution time Memory Grader output
1 Correct 368 ms 12776 KB Output is partially correct - 360000 call(s) of encode_bit()
2 Correct 4 ms 4716 KB Output is correct - 150 call(s) of encode_bit()
3 Correct 90 ms 7608 KB Output is partially correct - 324000 call(s) of encode_bit()
4 Correct 4 ms 4752 KB Output is correct - 250 call(s) of encode_bit()
5 Correct 84 ms 7520 KB Output is partially correct - 324000 call(s) of encode_bit()
6 Correct 104 ms 7932 KB Output is partially correct - 360000 call(s) of encode_bit()
7 Correct 115 ms 8288 KB Output is partially correct - 360000 call(s) of encode_bit()
8 Correct 88 ms 7696 KB Output is partially correct - 345960 call(s) of encode_bit()
9 Correct 102 ms 7888 KB Output is partially correct - 360000 call(s) of encode_bit()
10 Correct 106 ms 7736 KB Output is partially correct - 360000 call(s) of encode_bit()
11 Correct 106 ms 7976 KB Output is partially correct - 360000 call(s) of encode_bit()
12 Correct 98 ms 7908 KB Output is partially correct - 360000 call(s) of encode_bit()
13 Correct 130 ms 8664 KB Output is partially correct - 360000 call(s) of encode_bit()
14 Correct 103 ms 7828 KB Output is partially correct - 360000 call(s) of encode_bit()
15 Correct 94 ms 7880 KB Output is partially correct - 360000 call(s) of encode_bit()
16 Correct 128 ms 8288 KB Output is partially correct - 360000 call(s) of encode_bit()
17 Correct 121 ms 8288 KB Output is partially correct - 360000 call(s) of encode_bit()
18 Correct 135 ms 8544 KB Output is partially correct - 360000 call(s) of encode_bit()
19 Correct 105 ms 8160 KB Output is partially correct - 360000 call(s) of encode_bit()
20 Correct 153 ms 8972 KB Output is partially correct - 360000 call(s) of encode_bit()
21 Correct 169 ms 9056 KB Output is partially correct - 360000 call(s) of encode_bit()
22 Correct 119 ms 8308 KB Output is partially correct - 360000 call(s) of encode_bit()
23 Correct 173 ms 9056 KB Output is partially correct - 360000 call(s) of encode_bit()