QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#24439#3507. Broken Device 2Qingyu5 8ms3860kbC++201.2kb2022-03-30 20:02:392023-09-14 02:27:04

Judging History

This is the latest submission verdict.

  • [2023-09-14 02:27:04]
  • 管理员手动重测本题所有提交记录
  • Verdict: 5
  • Time: 8ms
  • Memory: 3860kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-01-22 10:33:11]
  • Judged
  • Verdict: 5
  • Time: 18ms
  • Memory: 3736kb
  • [2022-03-30 20:02:39]
  • Submitted

Anna

#include "Anna.h"
#include <bits/stdc++.h>

namespace {

int variable_example = 0;

auto valToVector(int64_t x) {
	for (int len = 0; ; ++len) {
		if (x > 2 * len) x -= 2 * len + 1;
		else {
			std::vector<int> a(len), b(len);
			int part_a = std::min(len, (int)x);
			int part_b = x - part_a;
			for (int j = 0; j < part_a; ++j)
				a[j] = 1;
			for (int j = 0; j < part_b; ++j)
				b[j] = 1;
			return std::make_pair(a, b);
		}
	}
	throw;
}

}

int Declare() {
  return 2000;
}


std::pair<std::vector<int>, std::vector<int> > Anna(long long A) {
	long long t = A / 4'000'000;
	auto [X, Y] = valToVector(A - t * 4'000'000);
	int a = (t >> 1 & 1), b = t & 1;
	std::vector<int> _X, _Y;
	_X.push_back(a), _Y.push_back(a);
	for (int x : X) _X.push_back(x);
	for (int y : Y) _Y.push_back(y);
	_X.push_back(b), _Y.push_back(b);
	return std::make_pair(_X, _Y);
}

Bruno

#include "Bruno.h"
#include <bits/stdc++.h>

namespace {

int variable_example = 0;

}

long long Bruno(std::vector<int> u) {
	int a = u.front(), b = u.back();
	int len = u.size() / 2 - 2;
	int ones = 0;
	for (int x : u)
		ones += x;
	ones -= a * 2 + b * 2;

	int64_t ans = 0;
	for (int i = 0; i < len; ++i)
		ans += 2 * i + 1;
	ans += ones;
	ans += (a * 2 + b) * 4'000'000;
	return ans;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 3ms
memory: 3820kb

input:

1000
6
000000
6
010000
6
010100
8
00000000
8
00010000
8
00001100
8
00111000
8
01011100
10
0000000000
10
0001000000
10
0000011000
10
0011001000
10
0011001100
10
0111011000
10
0011111100
12
000000000000
12
000010000000
12
000001010000
12
001001010000
12
000000011110
12
001100111000
12
001111011000
12
...

output:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
...

input:


output:

2000

result:

ok m = 2000

Test #2:

score: 5
Accepted
time: 4ms
memory: 3772kb

input:

1000
66
011011111111111111111010111101000000000101111010000110111100101100
66
001111111111111110011011111110011101001001001011110110001110010000
66
010111111111111111111111111110010010010011010001111001101011000000
66
010111111111111111111111111111111101000010110010110011100100000000
66
001111111111...

output:

1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
...

input:


output:

2000

result:

ok m = 2000

Subtask #2:

score: 0
Wrong Answer

Test #3:

score: 0
Wrong Answer
time: 8ms
memory: 3860kb

input:

1000
3096
01110111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

2392149
3237369
2749856
2195337
1287710
2355845
3335395
3368329
3788433
3809503
2138066
3919234
3445205
1969808
2611344
2738622
102224
3755713
692366
1999357
1791368
1080377
2887807
292605
3650162
2047893
2886267
1927376
3812776
1734518
521926
417160
3517895
3437895
1741109
2515055
2130145
1493727
1...

input:


output:


result:

wrong output format Unexpected end of file - int32 expected

Subtask #3:

score: 0
Skipped

Subtask #4:

score: 0
Skipped

Subtask #5:

score: 0
Skipped

Subtask #6:

score: 0
Skipped