Skip to content

Commit 90f6c18

Browse files
committed
modify code
1 parent 77e4c67 commit 90f6c18

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/class174/Code02_MagicGirl1.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public class Code02_MagicGirl1 {
3333
public static int[] v = new int[MAXN];
3434

3535
// pos[1..cntp]是当前序列块的下标
36-
// que[1..cntq]是整包结算的查询编号
36+
// qid[1..cntq]是整包结算的查询编号
3737
public static int[] pos = new int[MAXN];
38-
public static int[] que = new int[MAXN];
38+
public static int[] qid = new int[MAXN];
3939
public static int cntp;
4040
public static int cntq;
4141

@@ -81,7 +81,7 @@ public static void merge(int i, int curPre, int curSuf, int curLen, int curAns)
8181
}
8282

8383
// 整包结算
84-
// que[1..cntq]是查询编号,每条查询整包[l..r]
84+
// qid[1..cntq]是查询编号,每条查询整包[l..r]
8585
// 根据序列块的数字状况,更新每个查询的答案信息
8686
public static void calc(int l, int r) {
8787
for (int i = l; i <= r; i++) {
@@ -90,10 +90,10 @@ public static void calc(int l, int r) {
9090
next[i] = i + 1;
9191
}
9292
radix(pos, arr, cntp);
93-
radix(que, v, cntq);
93+
radix(qid, v, cntq);
9494
int curPre = 0, curSuf = 0, curLen = r - l + 1, curAns = 0;
9595
for (int i = 1, j = 1, idx; i <= cntq; i++) {
96-
while (j <= cntp && arr[pos[j]] <= v[que[i]]) {
96+
while (j <= cntp && arr[pos[j]] <= v[qid[i]]) {
9797
idx = pos[j];
9898
if (last[idx] == l - 1) {
9999
curPre += next[idx] - idx;
@@ -106,7 +106,7 @@ public static void calc(int l, int r) {
106106
next[last[idx]] = next[idx];
107107
j++;
108108
}
109-
merge(que[i], curPre, curSuf, curLen, curAns);
109+
merge(qid[i], curPre, curSuf, curLen, curAns);
110110
}
111111
cntp = cntq = 0;
112112
}
@@ -120,7 +120,7 @@ public static void compute(int l, int r) {
120120
}
121121
} else {
122122
if (x[qi] <= l && r <= y[qi]) {
123-
que[++cntq] = qi;
123+
qid[++cntq] = qi;
124124
} else {
125125
for (int i = Math.max(x[qi], l); i <= Math.min(y[qi], r); i++) {
126126
if (arr[i] <= v[qi]) {

src/class174/Code02_MagicGirl2.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
//int v[MAXN];
2828
//
2929
//int pos[MAXN];
30-
//int que[MAXN];
30+
//int qid[MAXN];
3131
//int cntp;
3232
//int cntq;
3333
//
@@ -69,10 +69,10 @@
6969
// nxt[i] = i + 1;
7070
// }
7171
// radix(pos, arr, cntp);
72-
// radix(que, v, cntq);
72+
// radix(qid, v, cntq);
7373
// int curPre = 0, curSuf = 0, curLen = r - l + 1, curAns = 0;
7474
// for (int i = 1, j = 1, idx; i <= cntq; i++) {
75-
// while (j <= cntp && arr[pos[j]] <= v[que[i]]) {
75+
// while (j <= cntp && arr[pos[j]] <= v[qid[i]]) {
7676
// idx = pos[j];
7777
// if (lst[idx] == l - 1) {
7878
// curPre += nxt[idx] - idx;
@@ -85,7 +85,7 @@
8585
// nxt[lst[idx]] = nxt[idx];
8686
// j++;
8787
// }
88-
// merge(que[i], curPre, curSuf, curLen, curAns);
88+
// merge(qid[i], curPre, curSuf, curLen, curAns);
8989
// }
9090
// cntp = cntq = 0;
9191
//}
@@ -99,7 +99,7 @@
9999
// }
100100
// } else {
101101
// if (x[qi] <= l && r <= y[qi]) {
102-
// que[++cntq] = qi;
102+
// qid[++cntq] = qi;
103103
// } else {
104104
// for (int i = max(x[qi], l); i <= min(y[qi], r); i++) {
105105
// if (arr[i] <= v[qi]) {

0 commit comments

Comments
 (0)