QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#325677#2006. Parrotssocpite100 ✓6ms4028kbC++201.9kb2024-02-11 19:29:262024-02-11 19:29:26

Judging History

你现在查看的是最新测评结果

  • [2024-02-11 19:29:26]
  • 评测
  • 测评结果:100
  • 用时:6ms
  • 内存:4028kb
  • [2024-02-11 19:29:26]
  • 提交

encoder

#include "encoder.h"
#include "encoderlib.h"
#include<bits/stdc++.h>
using namespace std;

const int maxn = 64;
const int maxv = 256;

namespace {

	int h[maxn][maxv];
	int ptr = 0;

	void init(){
		ptr = 0;
		mt19937 rng(69420);
		for(int i = 0; i < 64; i++){
			for(int j = 0; j < 256; j++){
				h[i][j] = j;
			}
			shuffle(h[i], h[i] + maxv, rng);
		}	
	}

	void send_bit(int x){
		if(x && ptr < maxv)send(ptr);
		else ptr++;
	}
}

void encode(int N, int M[])
{
	init();
	int cnt1 = 0;
	for(int i = 0; i < N; i++)cnt1 += __builtin_popcount(h[i][M[i]]);
	int sw = 0;
	if(cnt1 < N*4){
		sw = 1;
		send_bit(0);
	}
	else send_bit(1);
	for(int i = 0; i < N; i++){
		for(int j = 0; j < 8; j++){
			send_bit((h[i][M[i]]>>j&1)^sw);
		}
	}
}

// int main(){
// 	int M[5] = {0, 1, 2, 3, 4};
// 	encode(5, M);
// }

decoder

#include "decoder.h"
#include "decoderlib.h"
#include<bits/stdc++.h>
using namespace std;

const int maxn = 64;
const int maxv = 256;

namespace {
	int h[maxn][maxv];
	int f[maxv], ans[maxn];
	int ptr = 0;

	void init(){
		memset(f, 0, sizeof(f));
		memset(ans, 0, sizeof(ans));
		ptr = 0;
		mt19937 rng(69420);
		for(int i = 0; i < 64; i++){
			for(int j = 0; j < 256; j++){
				h[i][j] = j;
			}
			shuffle(h[i], h[i] + maxv, rng);
		}	
	}


	int get_bit(){
		if(ptr == maxv)return 1;
		else if(!f[ptr]){
			ptr++;
			return 0;
		}
		else {
			f[ptr]--;
			return 1;
		}
	}
}

void decode(int N, int L, int X[])
{
	init();
	int sw = 0;
	for(int i = 0; i < L; i++)f[X[i]]++;
	if(!get_bit())sw = 1;
	for(int i = 0; i < N; i++){
		for(int j = 0; j < 8; j++){
			ans[i] ^= (get_bit()^sw)<<j;
		}
		for(int j = 0; j < maxv; j++){
			if(h[i][j] == ans[i]){
				output(j);
				break;
			}
		}
	}
}

// int main(){
// 	int X[18] = {3, 4, 5, 9, 12, 12, 13, 13, 14, 14, 14, 14, 14, 18, 18, 18, 20, 23};
// 	decode(5, 18, X);
// }

詳細信息

Subtask #1:

score: 17
Accepted

Test #1:

score: 17
Accepted
time: 2ms
memory: 3988kb

input:

10
8 40
0 0 0 1 2 3 4 4 4 5 5 5 5 6 6 9 11 13 13 13 15 15 15 18 18 18 18 18 18 18 19 19 19 21 22 22 23 23 23 25 
8 36
28 26 26 23 23 21 21 20 19 19 18 18 18 18 16 16 15 15 14 11 10 6 4 3 3 3 2 2 2 2 1 1 1 0 0 0 
8 37
0 0 0 1 2 3 3 3 3 4 4 4 5 6 6 9 9 10 13 16 16 16 19 19 19 20 20 21 22 22 24 24 25 2...

output:

0 0 0 0 0 0 0 0 
1 1 1 1 1 1 1 1 
0 1 0 1 0 1 1 0 
0 1 0 1 0 1 1 0 
0 1 0 1 0 1 1 0 
1 0 0 1 0 1 1 0 
1 0 0 1 1 1 1 0 
1 0 0 1 1 1 1 0 
1 1 0 1 0 0 0 0 
1 1 0 1 0 0 0 0 

input:


output:

5.000000

result:

ok 

Subtask #2:

score: 17
Accepted

Test #2:

score: 17
Accepted
time: 3ms
memory: 3984kb

input:

50
8 40
0 0 0 1 2 3 4 4 4 5 5 5 5 6 6 9 11 13 13 13 15 15 15 18 18 18 18 18 18 18 19 19 19 21 22 22 23 23 23 25 
8 35
30 30 30 29 29 29 29 29 29 29 29 29 26 23 23 23 23 23 22 22 19 19 17 13 12 9 7 7 6 6 6 6 4 4 2 
8 35
2 4 4 6 6 6 6 7 7 9 12 13 17 19 19 22 22 23 23 23 23 23 26 29 29 29 29 29 29 29 2...

output:

0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 
243 109 222 210 112 222 171 178 
228 158 233 59 205 124 41 237 
155 180 90 45 173 60 66 172 
164 37 205 149 192 176 235 103 
95 7 200 68 93 112 112 236 
232 187 132 122 197 218 57 94 
245 69 229 217 2...

input:


output:

5.625000

result:

ok 

Test #3:

score: 17
Accepted
time: 5ms
memory: 3972kb

input:

50
11 53
0 0 0 1 2 3 4 4 4 5 5 5 5 6 6 9 11 13 13 13 15 15 15 18 18 18 18 18 18 18 19 19 19 21 22 22 23 23 23 25 25 25 26 28 28 29 30 30 30 30 30 31 34 
11 45
44 36 36 36 36 34 33 33 33 30 30 30 30 29 29 29 29 29 29 29 29 29 26 23 23 23 23 23 22 22 19 19 17 13 12 9 7 7 6 6 6 6 4 4 2 
11 45
2 4 4 6 6...

output:

0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 0 0 0 
223 48 201 197 29 95 155 229 169 194 210 
82 128 14 63 9 120 170 54 242 202 80 
185 205 138 0 95 1 39 84 220 84 151 
181 154 208 54 30 17 25 13 215 50 209 
92 134 8...

input:


output:

5.090909

result:

ok 

Test #4:

score: 17
Accepted
time: 5ms
memory: 3900kb

input:

50
15 68
0 0 0 1 2 3 4 4 4 5 5 5 5 6 6 9 11 13 13 13 15 15 15 18 18 18 18 18 18 18 19 19 19 21 22 22 23 23 23 25 25 25 26 28 28 29 30 30 30 30 30 31 34 38 38 44 44 44 49 49 50 50 50 50 50 50 50 50 
15 62
57 57 56 56 56 54 54 53 53 53 51 51 51 51 50 49 45 44 36 36 36 36 34 33 33 33 30 30 30 30 29 29 ...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
224 32 223 221 238 25 224 254 248 66 164 36 102 46 7 
33 26 6 162 138 31 204 225 175 131 134 45 51 142 6 
178 231 12...

input:


output:

4.666667

result:

ok 

Test #5:

score: 17
Accepted
time: 5ms
memory: 3984kb

input:

50
16 68
0 0 0 1 2 3 4 4 4 5 5 5 5 6 6 9 11 13 13 13 15 15 15 18 18 18 18 18 18 18 19 19 19 21 22 22 23 23 23 25 25 25 26 28 28 29 30 30 30 30 30 31 34 38 38 44 44 44 49 49 50 50 50 50 50 50 50 50 
16 67
61 60 59 59 59 57 57 56 56 56 54 54 53 53 53 51 51 51 51 50 49 45 44 36 36 36 36 34 33 33 33 30 ...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
26 106 184 90 58 147 93 85 1 116 9 221 62 228 113 188 
51 58 213 192 113 132 214 231 184 129 103 227 111...

input:


output:

4.750000

result:

ok 

Subtask #3:

score: 18
Accepted

Test #6:

score: 18
Accepted
time: 4ms
memory: 3976kb

input:

50
8 40
0 0 0 1 2 3 4 4 4 5 5 5 5 6 6 9 11 13 13 13 15 15 15 18 18 18 18 18 18 18 19 19 19 21 22 22 23 23 23 25 
8 35
30 30 30 29 29 29 29 29 29 29 29 29 26 23 23 23 23 23 22 22 19 19 17 13 12 9 7 7 6 6 6 6 4 4 2 
8 35
2 4 4 6 6 6 6 7 7 9 12 13 17 19 19 22 22 23 23 23 23 23 26 29 29 29 29 29 29 29 2...

output:

0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 
243 109 222 210 112 222 171 178 
228 158 233 59 205 124 41 237 
155 180 90 45 173 60 66 172 
164 37 205 149 192 176 235 103 
95 7 200 68 93 112 112 236 
232 187 132 122 197 218 57 94 
245 69 229 217 2...

input:


output:

5.625000

result:

ok 

Test #7:

score: 18
Accepted
time: 5ms
memory: 3976kb

input:

50
11 53
0 0 0 1 2 3 4 4 4 5 5 5 5 6 6 9 11 13 13 13 15 15 15 18 18 18 18 18 18 18 19 19 19 21 22 22 23 23 23 25 25 25 26 28 28 29 30 30 30 30 30 31 34 
11 45
44 36 36 36 36 34 33 33 33 30 30 30 30 29 29 29 29 29 29 29 29 29 26 23 23 23 23 23 22 22 19 19 17 13 12 9 7 7 6 6 6 6 4 4 2 
11 45
2 4 4 6 6...

output:

0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 0 0 0 
223 48 201 197 29 95 155 229 169 194 210 
82 128 14 63 9 120 170 54 242 202 80 
185 205 138 0 95 1 39 84 220 84 151 
181 154 208 54 30 17 25 13 215 50 209 
92 134 8...

input:


output:

5.090909

result:

ok 

Test #8:

score: 18
Accepted
time: 5ms
memory: 4016kb

input:

50
15 68
0 0 0 1 2 3 4 4 4 5 5 5 5 6 6 9 11 13 13 13 15 15 15 18 18 18 18 18 18 18 19 19 19 21 22 22 23 23 23 25 25 25 26 28 28 29 30 30 30 30 30 31 34 38 38 44 44 44 49 49 50 50 50 50 50 50 50 50 
15 62
57 57 56 56 56 54 54 53 53 53 51 51 51 51 50 49 45 44 36 36 36 36 34 33 33 33 30 30 30 30 29 29 ...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
224 32 223 221 238 25 224 254 248 66 164 36 102 46 7 
33 26 6 162 138 31 204 225 175 131 134 45 51 142 6 
178 231 12...

input:


output:

4.666667

result:

ok 

Test #9:

score: 18
Accepted
time: 5ms
memory: 3896kb

input:

50
16 68
0 0 0 1 2 3 4 4 4 5 5 5 5 6 6 9 11 13 13 13 15 15 15 18 18 18 18 18 18 18 19 19 19 21 22 22 23 23 23 25 25 25 26 28 28 29 30 30 30 30 30 31 34 38 38 44 44 44 49 49 50 50 50 50 50 50 50 50 
16 67
61 60 59 59 59 57 57 56 56 56 54 54 53 53 53 51 51 51 51 50 49 45 44 36 36 36 36 34 33 33 33 30 ...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
26 106 184 90 58 147 93 85 1 116 9 221 62 228 113 188 
51 58 213 192 113 132 214 231 184 129 103 227 111...

input:


output:

4.750000

result:

ok 

Subtask #4:

score: 29
Accepted

Test #10:

score: 29
Accepted
time: 5ms
memory: 3876kb

input:

50
8 40
0 0 0 1 2 3 4 4 4 5 5 5 5 6 6 9 11 13 13 13 15 15 15 18 18 18 18 18 18 18 19 19 19 21 22 22 23 23 23 25 
8 35
30 30 30 29 29 29 29 29 29 29 29 29 26 23 23 23 23 23 22 22 19 19 17 13 12 9 7 7 6 6 6 6 4 4 2 
8 35
2 4 4 6 6 6 6 7 7 9 12 13 17 19 19 22 22 23 23 23 23 23 26 29 29 29 29 29 29 29 2...

output:

0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 
105 171 236 216 29 23 237 137 
133 238 133 208 208 161 99 228 
114 68 124 64 83 0 156 229 
107 234 136 136 175 106 239 229 
132 178 196 164 41 224 188...

input:


output:

5.125000

result:

ok 

Test #11:

score: 29
Accepted
time: 5ms
memory: 3876kb

input:

50
16 68
0 0 0 1 2 3 4 4 4 5 5 5 5 6 6 9 11 13 13 13 15 15 15 18 18 18 18 18 18 18 19 19 19 21 22 22 23 23 23 25 25 25 26 28 28 29 30 30 30 30 30 31 34 38 38 44 44 44 49 49 50 50 50 50 50 50 50 50 
16 67
61 60 59 59 59 57 57 56 56 56 54 54 53 53 53 51 51 51 51 50 49 45 44 36 36 36 36 34 33 33 33 30 ...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
188 66...

input:


output:

4.875000

result:

ok 

Test #12:

score: 29
Accepted
time: 5ms
memory: 3916kb

input:

50
20 87
0 0 0 1 2 3 4 4 4 5 5 5 5 6 6 9 11 13 13 13 15 15 15 18 18 18 18 18 18 18 19 19 19 21 22 22 23 23 23 25 25 25 26 28 28 29 30 30 30 30 30 31 34 38 38 44 44 44 49 49 50 50 50 50 50 50 50 50 61 62 62 64 65 66 66 67 67 67 67 68 68 70 70 74 74 74 74 
20 85
76 76 76 76 76 75 75 75 73 70 70 66 66 ...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 ...

input:


output:

4.850000

result:

ok 

Test #13:

score: 29
Accepted
time: 5ms
memory: 3892kb

input:

50
30 128
0 0 0 1 2 3 4 4 4 5 5 5 5 6 6 9 11 13 13 13 15 15 15 18 18 18 18 18 18 18 19 19 19 21 22 22 23 23 23 25 25 25 26 28 28 29 30 30 30 30 30 31 34 38 38 44 44 44 49 49 50 50 50 50 50 50 50 50 61 62 62 64 65 66 66 67 67 67 67 68 68 70 70 74 74 74 74 76 77 78 78 78 80 80 82 83 83 83 83 83 85 85 ...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 25...

input:


output:

4.600000

result:

ok 

Test #14:

score: 29
Accepted
time: 5ms
memory: 3980kb

input:

50
31 130
0 0 0 1 2 3 4 4 4 5 5 5 5 6 6 9 11 13 13 13 15 15 15 18 18 18 18 18 18 18 19 19 19 21 22 22 23 23 23 25 25 25 26 28 28 29 30 30 30 30 30 31 34 38 38 44 44 44 49 49 50 50 50 50 50 50 50 50 61 62 62 64 65 66 66 67 67 67 67 68 68 70 70 74 74 74 74 76 77 78 78 78 80 80 82 83 83 83 83 83 85 85 ...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 ...

input:


output:

4.677419

result:

ok 

Test #15:

score: 29
Accepted
time: 3ms
memory: 3972kb

input:

50
32 133
0 0 0 1 2 3 4 4 4 5 5 5 5 6 6 9 11 13 13 13 15 15 15 18 18 18 18 18 18 18 19 19 19 21 22 22 23 23 23 25 25 25 26 28 28 29 30 30 30 30 30 31 34 38 38 44 44 44 49 49 50 50 50 50 50 50 50 50 61 62 62 64 65 66 66 67 67 67 67 68 68 70 70 74 74 74 74 76 77 78 78 78 80 80 82 83 83 83 83 83 85 85 ...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 25...

input:


output:

4.625000

result:

ok 

Subtask #5:

score: 19
Accepted

Test #16:

score: 19
Accepted
time: 5ms
memory: 3836kb

input:

50
16 68
0 0 0 1 2 3 4 4 4 5 5 5 5 6 6 9 11 13 13 13 15 15 15 18 18 18 18 18 18 18 19 19 19 21 22 22 23 23 23 25 25 25 26 28 28 29 30 30 30 30 30 31 34 38 38 44 44 44 49 49 50 50 50 50 50 50 50 50 
16 67
61 60 59 59 59 57 57 56 56 56 54 54 53 53 53 51 51 51 51 50 49 45 44 36 36 36 36 34 33 33 33 30 ...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
214 69...

input:


output:

4.875000

result:

points 1.0

Test #17:

score: 19
Accepted
time: 5ms
memory: 3988kb

input:

50
32 133
0 0 0 1 2 3 4 4 4 5 5 5 5 6 6 9 11 13 13 13 15 15 15 18 18 18 18 18 18 18 19 19 19 21 22 22 23 23 23 25 25 25 26 28 28 29 30 30 30 30 30 31 34 38 38 44 44 44 49 49 50 50 50 50 50 50 50 50 61 62 62 64 65 66 66 67 67 67 67 68 68 70 70 74 74 74 74 76 77 78 78 78 80 80 82 83 83 83 83 83 85 85 ...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 25...

input:


output:

4.593750

result:

points 1.0

Test #18:

score: 19
Accepted
time: 2ms
memory: 3984kb

input:

50
33 140
0 0 0 1 2 3 4 4 4 5 5 5 5 6 6 9 11 13 13 13 15 15 15 18 18 18 18 18 18 18 19 19 19 21 22 22 23 23 23 25 25 25 26 28 28 29 30 30 30 30 30 31 34 38 38 44 44 44 49 49 50 50 50 50 50 50 50 50 61 62 62 64 65 66 66 67 67 67 67 68 68 70 70 74 74 74 74 76 77 78 78 78 80 80 82 83 83 83 83 83 85 85 ...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 ...

input:


output:

4.636364

result:

points 1.0

Test #19:

score: 19
Accepted
time: 6ms
memory: 4028kb

input:

50
50 201
3 4 5 6 9 13 15 15 15 16 16 17 17 20 20 23 23 23 30 33 33 34 36 39 39 42 43 43 45 46 51 52 52 52 53 53 53 53 55 55 55 55 55 55 58 58 58 58 58 60 68 68 68 68 68 68 68 68 68 68 68 69 71 71 72 73 75 79 81 81 83 83 83 83 87 87 88 89 92 92 94 94 95 100 100 103 104 105 105 107 107 108 109 113 11...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255...

input:


output:

4.560000

result:

points 1.0

Test #20:

score: 19
Accepted
time: 6ms
memory: 3976kb

input:

50
60 242
3 4 5 6 9 13 15 15 15 16 16 17 17 20 20 23 23 23 30 33 33 34 36 39 39 42 43 43 45 46 51 52 52 52 53 53 53 53 55 55 55 55 55 55 58 58 58 58 58 60 68 68 68 68 68 68 68 68 68 68 68 69 71 71 72 73 75 79 81 81 83 83 83 83 87 87 88 89 92 92 94 94 95 100 100 103 104 105 105 107 107 108 109 113 11...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255...

input:


output:

4.433333

result:

points 1.0

Test #21:

score: 19
Accepted
time: 6ms
memory: 4016kb

input:

50
63 253
0 0 0 1 2 3 4 4 4 5 5 5 5 6 6 9 11 13 13 13 15 15 15 18 18 18 18 18 18 18 19 19 19 21 22 22 23 23 23 25 25 25 26 28 28 29 30 30 30 30 30 31 34 38 38 44 44 44 49 49 50 50 50 50 50 50 50 50 61 62 62 64 65 66 66 67 67 67 67 68 68 70 70 74 74 74 74 76 77 78 78 78 80 80 82 83 83 83 83 83 85 85 ...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 2...

input:


output:

4.492063

result:

points 1.0

Test #22:

score: 19
Accepted
time: 6ms
memory: 3892kb

input:

50
64 259
0 0 0 1 2 3 4 4 4 5 5 5 5 6 6 9 11 13 13 13 15 15 15 18 18 18 18 18 18 18 19 19 19 21 22 22 23 23 23 25 25 25 26 28 28 29 30 30 30 30 30 31 34 38 38 44 44 44 49 49 50 50 50 50 50 50 50 50 61 62 62 64 65 66 66 67 67 67 67 68 68 70 70 74 74 74 74 76 77 78 78 78 80 80 82 83 83 83 83 83 85 85 ...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255...

input:


output:

4.484375

result:

points 1.0