Skip to content

Commit ccf4b11

Browse files
Problem212&241&2478&248 upd (#83)
* Update problem 211 and 220 * Update problem 239&241 * 243&247&248submit and 239&241 statement's upd * 239 statement upd * Problem212&241&247&248upd
1 parent b71654b commit ccf4b11

File tree

31 files changed

+467794
-16417
lines changed

31 files changed

+467794
-16417
lines changed

algorithmic/problems/212/chk.cc

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
using namespace std;
77

8-
const int N = 5002021;
8+
const int N = 202021;
99
bool vis[N * 50];
10-
int n, m, L, R, Sx, Sy, qn, q[N], x[N], y[N], vis1[N];
10+
int n, m, L, R, Sx, Sy, qn, q[N], x[N], y[N], vis1[N],stk[N];
1111

1212
int _abs(int x) {
1313
return (x < 0) ? (-x) : x;
@@ -101,20 +101,31 @@ int main(int argc, char* argv[]) {
101101

102102
// Check row completion constraint
103103
memset(vis1, 0, sizeof(vis1));
104+
int top=0;
104105
for (int i = 1; i <= cnt; i++) {
105106
if (y[i] < L || y[i] > R) continue;
106107
if (vis1[x[i]]) continue;
107108
vis1[x[i]] = 1;
109+
stk[++top]=x[i];
108110
// When first entering row x[i]'s required area, must complete all required cells in that row
109111
for (int j = L; j <= R; j++) {
110112
int idx = j - L + i;
111113
if (idx > cnt) break;
112-
if ((y[idx] < L || y[idx] > R) && x[idx] == x[i]) {
114+
if(x[idx] != x[i])
115+
quitf(_wa, "Row %d: after entering required area, cannot leave before completing all required cells", x[i]);
116+
if (y[idx] < L || y[idx] > R) {
113117
quitf(_wa, "Row %d: after entering required area, cannot leave before completing all required cells", x[i]);
114118
}
115119
}
116120
}
117121

122+
if(top!=n)
123+
quitf(_wa, "Required cell is not visited");
124+
int nw=1;
125+
for(int i=1;i<=qn;i++){
126+
while(nw<=top && q[i]!=stk[nw])++nw;
127+
if(stk[nw]!=q[i])quitf(_wa, "Your clearance sequence does not contain the required subsequence");
128+
}
118129
// Calculate score (0-10 points)
119130
double points = 0;
120131
if (cnt <= mxstp) {

algorithmic/problems/241/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ memory: 512m
1111
# The subtasks section
1212
subtasks:
1313
- score: 100
14-
n_cases: 4 # Test cases: 1.in, 2.in, ..., 10.in in testdata/
14+
n_cases: 5 # Test cases: 1.in, 2.in, ..., 10.in in testdata/

algorithmic/problems/241/statement.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Your score is calculated based on the number of (&,|) $m$, and $m_0$(number of (
7474
if $m \leq m_0$, you receive full score (1.0).
7575
if $m>2 * m_0$, you receive 0 score.
7676
otherwise Score = $(2 * m_0 - m) / (m_0)$, linearly decreasing from 1.0 to 0.0.
77+
The score for a test point is the minimum score among all test data within it
7778

7879
Time limit:
7980
2 seconds
Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
11
Yes
22
F
33
No
4-
No
5-
No
6-
No
7-
No
8-
No
9-
No
10-
Yes
11-
(a&b)
12-
No
134
Yes
145
a
15-
No
16-
Yes
17-
b
18-
No
19-
Yes
20-
(a|b)
216
Yes
227
T
Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,9 @@
1-
16
2-
2
3-
0000
4-
2
5-
1000
6-
2
7-
0100
8-
2
9-
1100
10-
2
11-
0010
12-
2
13-
1010
14-
2
15-
0110
16-
2
17-
1110
18-
2
19-
0001
20-
2
21-
1001
22-
2
23-
0101
24-
2
25-
1101
26-
2
27-
0011
28-
2
29-
1011
30-
2
31-
0111
32-
2
33-
1111
1+
4
2+
1
3+
00
4+
1
5+
10
6+
1
7+
01
8+
1
9+
11
Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,22 @@
11
Yes
2-
((((((((a&b)&c)&d)|((((a&b)&c)|(((a&b)|((a|b)&c))&d))&e))|(((((a&b)&c)|(((a&b)|((a|b)&c))&d))|((((a&b)|((a|b)&c))|(((a|b)|c)&d))&e))&f))|((((((a&b)&c)|(((a&b)|((a|b)&c))&d))|((((a&b)|((a|b)&c))|(((a|b)|c)&d))&e))|(((((a&b)|((a|b)&c))|(((a|b)|c)&d))|((((a|b)|c)|d)&e))&f))&g))|(((((((a&b)&c)|(((a&b)|((a|b)&c))&d))|((((a&b)|((a|b)&c))|(((a|b)|c)&d))&e))|(((((a&b)|((a|b)&c))|(((a|b)|c)&d))|((((a|b)|c)|d)&e))&f))|((((((a&b)|((a|b)&c))|(((a|b)|c)&d))|((((a|b)|c)|d)&e))|(((((a|b)|c)|d)|e)&f))&g))&h))|((((((((a&b)&c)|(((a&b)|((a|b)&c))&d))|((((a&b)|((a|b)&c))|(((a|b)|c)&d))&e))|(((((a&b)|((a|b)&c))|(((a|b)|c)&d))|((((a|b)|c)|d)&e))&f))|((((((a&b)|((a|b)&c))|(((a|b)|c)&d))|((((a|b)|c)|d)&e))|(((((a|b)|c)|d)|e)&f))&g))|(((((((a&b)|((a|b)&c))|(((a|b)|c)&d))|((((a|b)|c)|d)&e))|(((((a|b)|c)|d)|e)&f))|((((((a|b)|c)|d)|e)|f)&g))&h))&i))
2+
F
3+
No
4+
No
5+
No
6+
No
7+
No
8+
No
9+
No
10+
Yes
11+
(a&b)
12+
No
13+
Yes
14+
a
15+
No
16+
Yes
17+
b
18+
No
19+
Yes
20+
(a|b)
21+
Yes
22+
T
Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1-
1
2-
9
3-
00000000000000010000000100010111000000010001011100010111011111110000000100010111000101110111111100010111011111110111111111111111000000010001011100010111011111110001011101111111011111111111111100010111011111110111111111111111011111111111111111111111111111110000000100010111000101110111111100010111011111110111111111111111000101110111111101111111111111110111111111111111111111111111111100010111011111110111111111111111011111111111111111111111111111110111111111111111111111111111111111111111111111111111111111111111
1+
16
2+
2
3+
0000
4+
2
5+
1000
6+
2
7+
0100
8+
2
9+
1100
10+
2
11+
0010
12+
2
13+
1010
14+
2
15+
0110
16+
2
17+
1110
18+
2
19+
0001
20+
2
21+
1001
22+
2
23+
0101
24+
2
25+
1101
26+
2
27+
0011
28+
2
29+
1011
30+
2
31+
0111
32+
2
33+
1111

0 commit comments

Comments
 (0)