提交 e9bf3dd9 编写于 作者: 每日一练社区's avatar 每日一练社区

update solution.md

上级 01198da4
...@@ -11,19 +11,19 @@ ...@@ -11,19 +11,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
18 18
``` ```
## 选项 ## 选项
...@@ -31,18 +31,18 @@ ...@@ -31,18 +31,18 @@
### A ### A
```c ```cpp
19 19
``` ```
### B ### B
```c ```cpp
20 20
``` ```
### C ### C
```c ```cpp
21 21
``` ```
...@@ -11,20 +11,20 @@ ...@@ -11,20 +11,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
long pow_2(int b) long pow_2(int b)
{ {
long x = 2; long x = 2;
...@@ -55,7 +55,7 @@ int main() ...@@ -55,7 +55,7 @@ int main()
### A ### A
```c ```cpp
long pow_2(int b) long pow_2(int b)
{ {
long x = 2; long x = 2;
...@@ -84,7 +84,7 @@ int main() ...@@ -84,7 +84,7 @@ int main()
### B ### B
```c ```cpp
int gcd(int a, int b) int gcd(int a, int b)
{ {
return a % b ? gcd(b, a % b) : b; return a % b ? gcd(b, a % b) : b;
...@@ -101,7 +101,7 @@ int main() ...@@ -101,7 +101,7 @@ int main()
### C ### C
```c ```cpp
int gcd(int a, int b) int gcd(int a, int b)
{ {
while (b > 0) while (b > 0)
......
...@@ -50,20 +50,20 @@ ...@@ -50,20 +50,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
int main() int main()
{ {
int n; int n;
...@@ -91,7 +91,7 @@ int main() ...@@ -91,7 +91,7 @@ int main()
### A ### A
```c ```cpp
int main() int main()
{ {
int n, max = 0, min = 0; int n, max = 0, min = 0;
...@@ -126,7 +126,7 @@ int main() ...@@ -126,7 +126,7 @@ int main()
### B ### B
```c ```cpp
int n; int n;
int Max(int m[10005]) int Max(int m[10005])
...@@ -183,7 +183,7 @@ int main() ...@@ -183,7 +183,7 @@ int main()
### C ### C
```c ```cpp
int main() int main()
{ {
int n; int n;
......
...@@ -22,20 +22,20 @@ x星的国王有个怪癖,他只喜欢数字3,5和7。 ...@@ -22,20 +22,20 @@ x星的国王有个怪癖,他只喜欢数字3,5和7。
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
typedef long long LL; typedef long long LL;
const LL MAX = 59084709587505; const LL MAX = 59084709587505;
int main() int main()
...@@ -65,7 +65,7 @@ int main() ...@@ -65,7 +65,7 @@ int main()
### A ### A
```c ```cpp
#define LL long long #define LL long long
LL maxs = 59084709587505; LL maxs = 59084709587505;
set<LL> q; set<LL> q;
...@@ -98,7 +98,7 @@ int main() ...@@ -98,7 +98,7 @@ int main()
### B ### B
```c ```cpp
typedef long long LL; typedef long long LL;
const LL Max = 59084709587505; const LL Max = 59084709587505;
int a[3] = {3, 5, 7}; int a[3] = {3, 5, 7};
...@@ -132,7 +132,7 @@ int main(void) ...@@ -132,7 +132,7 @@ int main(void)
### C ### C
```c ```cpp
int main() int main()
{ {
set<long long> st; set<long long> st;
......
...@@ -21,20 +21,20 @@ ...@@ -21,20 +21,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
const int N = 10010; const int N = 10010;
int k; int k;
...@@ -77,7 +77,7 @@ int main() ...@@ -77,7 +77,7 @@ int main()
### A ### A
```c ```cpp
typedef long long ll; typedef long long ll;
const ll maxn = 1e6 + 50; const ll maxn = 1e6 + 50;
ll a[maxn]; ll a[maxn];
...@@ -129,7 +129,7 @@ int main() ...@@ -129,7 +129,7 @@ int main()
### B ### B
```c ```cpp
const int N = 10001; const int N = 10001;
int prime[N]{0}; int prime[N]{0};
...@@ -184,7 +184,7 @@ int main() ...@@ -184,7 +184,7 @@ int main()
### C ### C
```c ```cpp
typedef long long LL; typedef long long LL;
set<int> all; set<int> all;
......
...@@ -63,20 +63,20 @@ ...@@ -63,20 +63,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
#define ll long long #define ll long long
#define inf 0x7fffffff #define inf 0x7fffffff
const int N = 1e5 + 10; const int N = 1e5 + 10;
...@@ -127,7 +127,7 @@ int main() ...@@ -127,7 +127,7 @@ int main()
### A ### A
```c ```cpp
#define mem(a, b) memset(a, b, sizeof(a)) #define mem(a, b) memset(a, b, sizeof(a))
#define mod 1000000009 #define mod 1000000009
...@@ -292,7 +292,7 @@ int main() ...@@ -292,7 +292,7 @@ int main()
### B ### B
```c ```cpp
#define mod 1000000009 #define mod 1000000009
const int N = 100010; const int N = 100010;
typedef long long LL; typedef long long LL;
...@@ -365,7 +365,7 @@ int main() ...@@ -365,7 +365,7 @@ int main()
### C ### C
```c ```cpp
int main() int main()
{ {
int n, k; int n, k;
......
...@@ -66,20 +66,20 @@ ...@@ -66,20 +66,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
int a[100000]; int a[100000];
int main() int main()
{ {
...@@ -112,7 +112,7 @@ int main() ...@@ -112,7 +112,7 @@ int main()
### A ### A
```c ```cpp
int convert(string s) int convert(string s)
{ {
stringstream str; stringstream str;
...@@ -159,7 +159,7 @@ int main() ...@@ -159,7 +159,7 @@ int main()
### B ### B
```c ```cpp
int a[10005]; int a[10005];
int main() int main()
{ {
...@@ -200,7 +200,7 @@ int main() ...@@ -200,7 +200,7 @@ int main()
### C ### C
```c ```cpp
int ans[10005]; int ans[10005];
char str[100001]; char str[100001];
......
...@@ -12,20 +12,20 @@ ...@@ -12,20 +12,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
int a[2014]; int a[2014];
int main() int main()
{ {
...@@ -58,7 +58,7 @@ int main() ...@@ -58,7 +58,7 @@ int main()
### A ### A
```c ```cpp
int main() int main()
{ {
string s = "abcdefghijklmnopqrs"; string s = "abcdefghijklmnopqrs";
...@@ -83,7 +83,7 @@ int main() ...@@ -83,7 +83,7 @@ int main()
### B ### B
```c ```cpp
int main() int main()
{ {
char a[2015]; char a[2015];
...@@ -108,7 +108,7 @@ int main() ...@@ -108,7 +108,7 @@ int main()
### C ### C
```c ```cpp
int main() int main()
{ {
vector<char> vc1; vector<char> vc1;
......
...@@ -29,7 +29,7 @@ yx1 ...@@ -29,7 +29,7 @@ yx1
请从以下四个选项中选择空白处的内容。 请从以下四个选项中选择空白处的内容。
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -66,19 +66,19 @@ int main() ...@@ -66,19 +66,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
if (min > sum) if (min > sum)
{ {
min = sum; min = sum;
...@@ -95,7 +95,7 @@ int main() ...@@ -95,7 +95,7 @@ int main()
### A ### A
```c ```cpp
if (min < sum) if (min < sum)
{ {
min = sum; min = sum;
...@@ -110,7 +110,7 @@ int main() ...@@ -110,7 +110,7 @@ int main()
### B ### B
```c ```cpp
if (min > sum) if (min > sum)
{ {
max = sum; max = sum;
...@@ -125,7 +125,7 @@ int main() ...@@ -125,7 +125,7 @@ int main()
### C ### C
```c ```cpp
if (min > sum) if (min > sum)
{ {
min = sum; min = sum;
......
...@@ -55,20 +55,20 @@ bbccccddaaaacccc ...@@ -55,20 +55,20 @@ bbccccddaaaacccc
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
const int N = 1010; const int N = 1010;
int cnt[26]; int cnt[26];
char a[N]; char a[N];
...@@ -100,7 +100,7 @@ int main() ...@@ -100,7 +100,7 @@ int main()
### A ### A
```c ```cpp
int main() int main()
{ {
char s[1000]; char s[1000];
...@@ -130,7 +130,7 @@ int main() ...@@ -130,7 +130,7 @@ int main()
### B ### B
```c ```cpp
int cnt[1001]; int cnt[1001];
int main() int main()
{ {
...@@ -165,7 +165,7 @@ int main() ...@@ -165,7 +165,7 @@ int main()
### C ### C
```c ```cpp
int a[26]; int a[26];
int main() int main()
......
...@@ -17,19 +17,19 @@ X出生后每隔3分钟分裂一次(数目加倍),Y出生后每隔2分钟 ...@@ -17,19 +17,19 @@ X出生后每隔3分钟分裂一次(数目加倍),Y出生后每隔2分钟
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
94371840 94371840
``` ```
...@@ -37,18 +37,18 @@ X出生后每隔3分钟分裂一次(数目加倍),Y出生后每隔2分钟 ...@@ -37,18 +37,18 @@ X出生后每隔3分钟分裂一次(数目加倍),Y出生后每隔2分钟
### A ### A
```c ```cpp
167772160 167772160
``` ```
### B ### B
```c ```cpp
47185920 47185920
``` ```
### C ### C
```c ```cpp
92160 92160
``` ```
...@@ -21,20 +21,20 @@ ...@@ -21,20 +21,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
int main() int main()
{ {
int count2 = 0, count5 = 0; int count2 = 0, count5 = 0;
...@@ -63,7 +63,7 @@ int main() ...@@ -63,7 +63,7 @@ int main()
### A ### A
```c ```cpp
int main() int main()
{ {
...@@ -86,7 +86,7 @@ int main() ...@@ -86,7 +86,7 @@ int main()
### B ### B
```c ```cpp
int a[] = {5650, 4542, 3554, 473, 946, 4114, 3871, 9073, 90, 4329, int a[] = {5650, 4542, 3554, 473, 946, 4114, 3871, 9073, 90, 4329,
2758, 7949, 6113, 5659, 5245, 7432, 3051, 4434, 6704, 3594, 2758, 7949, 6113, 5659, 5245, 7432, 3051, 4434, 6704, 3594,
9937, 1173, 6866, 3397, 4759, 7557, 3070, 2287, 1453, 9899, 9937, 1173, 6866, 3397, 4759, 7557, 3070, 2287, 1453, 9899,
...@@ -115,7 +115,7 @@ int main() ...@@ -115,7 +115,7 @@ int main()
### C ### C
```c ```cpp
int main() int main()
{ {
int t_cnt, f_cnt, data = 0; int t_cnt, f_cnt, data = 0;
......
...@@ -13,19 +13,19 @@ ...@@ -13,19 +13,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
2017-08-05 2017-08-05
``` ```
...@@ -33,18 +33,18 @@ ...@@ -33,18 +33,18 @@
### A ### A
```c ```cpp
2017-09-05 2017-09-05
``` ```
### B ### B
```c ```cpp
2017-08-06 2017-08-06
``` ```
### C ### C
```c ```cpp
2017-09-06 2017-09-06
``` ```
...@@ -11,19 +11,19 @@ ...@@ -11,19 +11,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
761 761
``` ```
...@@ -31,18 +31,18 @@ ...@@ -31,18 +31,18 @@
### A ### A
```c ```cpp
759 759
``` ```
### B ### B
```c ```cpp
760 760
``` ```
### C ### C
```c ```cpp
769 769
``` ```
...@@ -13,19 +13,19 @@ ...@@ -13,19 +13,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
3880 3880
``` ```
...@@ -33,18 +33,18 @@ ...@@ -33,18 +33,18 @@
### A ### A
```c ```cpp
3400 3400
``` ```
### B ### B
```c ```cpp
3920 3920
``` ```
### C ### C
```c ```cpp
3900 3900
``` ```
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
以下代码实现了这一功能,请你填补空白处的内容: 以下代码实现了这一功能,请你填补空白处的内容:
```c ```cpp
#include <iostream> #include <iostream>
using namespace std; using namespace std;
...@@ -74,19 +74,19 @@ int main() ...@@ -74,19 +74,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
n /= 10; n /= 10;
``` ```
...@@ -94,18 +94,18 @@ int main() ...@@ -94,18 +94,18 @@ int main()
### A ### A
```c ```cpp
n %= 10; n %= 10;
``` ```
### B ### B
```c ```cpp
break; break;
``` ```
### C ### C
```c ```cpp
continue; continue;
``` ```
...@@ -12,19 +12,19 @@ ...@@ -12,19 +12,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
1025 1025
``` ```
...@@ -32,18 +32,18 @@ ...@@ -32,18 +32,18 @@
### A ### A
```c ```cpp
1024 1024
``` ```
### B ### B
```c ```cpp
512 512
``` ```
### C ### C
```c ```cpp
513 513
``` ```
...@@ -60,7 +60,7 @@ ts id ...@@ -60,7 +60,7 @@ ts id
下面的程序实现了这一功能,请你补全空白处的内容: 下面的程序实现了这一功能,请你补全空白处的内容:
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -101,19 +101,19 @@ int main() ...@@ -101,19 +101,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
cnt[logs[j].y]--, j++; cnt[logs[j].y]--, j++;
``` ```
...@@ -121,18 +121,18 @@ cnt[logs[j].y]--, j++; ...@@ -121,18 +121,18 @@ cnt[logs[j].y]--, j++;
### A ### A
```c ```cpp
cnt[logs[j].y]--; j++; cnt[logs[j].y]--; j++;
``` ```
### B ### B
```c ```cpp
cnt[logs[j].y]++, j++; cnt[logs[j].y]++, j++;
``` ```
### C ### C
```c ```cpp
cnt[logs[j].y]++; j++; cnt[logs[j].y]++; j++;
``` ```
...@@ -20,19 +20,19 @@ ...@@ -20,19 +20,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
int vis[10]; int vis[10];
int ans = 0; int ans = 0;
bool s(int i) bool s(int i)
...@@ -90,7 +90,7 @@ int main() ...@@ -90,7 +90,7 @@ int main()
### A ### A
```c ```cpp
bool isOk(int result, int t1, int t2) bool isOk(int result, int t1, int t2)
{ {
bool flag1[10] = {0}, flag2[10] = {0}; bool flag1[10] = {0}, flag2[10] = {0};
...@@ -150,7 +150,7 @@ int main() ...@@ -150,7 +150,7 @@ int main()
### B ### B
```c ```cpp
int main() int main()
{ {
int v[5], i; int v[5], i;
...@@ -191,7 +191,7 @@ int main() ...@@ -191,7 +191,7 @@ int main()
### C ### C
```c ```cpp
#define MAX_N 1005 #define MAX_N 1005
bool judge1(int n) bool judge1(int n)
......
...@@ -6,19 +6,19 @@ ...@@ -6,19 +6,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
5217 5217
``` ```
...@@ -26,18 +26,18 @@ ...@@ -26,18 +26,18 @@
### A ### A
```c ```cpp
5218 5218
``` ```
### B ### B
```c ```cpp
5216 5216
``` ```
### C ### C
```c ```cpp
5210 5210
``` ```
...@@ -8,19 +8,19 @@ ...@@ -8,19 +8,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
26 26
``` ```
...@@ -28,18 +28,18 @@ ...@@ -28,18 +28,18 @@
### A ### A
```c ```cpp
24 24
``` ```
### B ### B
```c ```cpp
25 25
``` ```
### C ### C
```c ```cpp
27 27
``` ```
...@@ -11,19 +11,19 @@ A 国估计被测的民众的感染率大概是 1%,呈均匀分布。请问 k ...@@ -11,19 +11,19 @@ A 国估计被测的民众的感染率大概是 1%,呈均匀分布。请问 k
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
10 10
``` ```
...@@ -31,18 +31,18 @@ A 国估计被测的民众的感染率大概是 1%,呈均匀分布。请问 k ...@@ -31,18 +31,18 @@ A 国估计被测的民众的感染率大概是 1%,呈均匀分布。请问 k
### A ### A
```c ```cpp
8 8
``` ```
### B ### B
```c ```cpp
9 9
``` ```
### C ### C
```c ```cpp
12 12
``` ```
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
请填补空白处的内容。 请填补空白处的内容。
```c ```cpp
#include <stdio.h> #include <stdio.h>
int main() int main()
{ {
...@@ -30,19 +30,19 @@ int main() ...@@ -30,19 +30,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
i % 2 == 0 i % 2 == 0
``` ```
## 选项 ## 选项
...@@ -50,18 +50,18 @@ i % 2 == 0 ...@@ -50,18 +50,18 @@ i % 2 == 0
### A ### A
```c ```cpp
i % 2 == 1 i % 2 == 1
``` ```
### B ### B
```c ```cpp
i / 2 == 0 i / 2 == 0
``` ```
### C ### C
```c ```cpp
i / 2 == 1 i / 2 == 1
``` ```
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
以下程序实现了该功能,请你补全空白处代码: 以下程序实现了该功能,请你补全空白处代码:
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -65,19 +65,19 @@ int main() ...@@ -65,19 +65,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
sum[i] = (sum[i - 1] + son[i]) % k; sum[i] = (sum[i - 1] + son[i]) % k;
``` ```
...@@ -85,18 +85,18 @@ sum[i] = (sum[i - 1] + son[i]) % k; ...@@ -85,18 +85,18 @@ sum[i] = (sum[i - 1] + son[i]) % k;
### A ### A
```c ```cpp
sum[i] = (sum[i] + son[i]) % k; sum[i] = (sum[i] + son[i]) % k;
``` ```
### B ### B
```c ```cpp
sum[i] = (sum[i - 1] + son[i]) % k - 1; sum[i] = (sum[i - 1] + son[i]) % k - 1;
``` ```
### C ### C
```c ```cpp
sum[i] = (sum[i - 1] + son[i - 1]) % k; sum[i] = (sum[i - 1] + son[i - 1]) % k;
``` ```
...@@ -19,19 +19,19 @@ A,2,3,4,5,6,7,8,9 共9张纸牌排成一个正三角形(A按1计算)。要 ...@@ -19,19 +19,19 @@ A,2,3,4,5,6,7,8,9 共9张纸牌排成一个正三角形(A按1计算)。要
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
144 144
``` ```
...@@ -39,18 +39,18 @@ A,2,3,4,5,6,7,8,9 共9张纸牌排成一个正三角形(A按1计算)。要 ...@@ -39,18 +39,18 @@ A,2,3,4,5,6,7,8,9 共9张纸牌排成一个正三角形(A按1计算)。要
### A ### A
```c ```cpp
124 124
``` ```
### B ### B
```c ```cpp
128 128
``` ```
### C ### C
```c ```cpp
132 132
``` ```
...@@ -57,20 +57,20 @@ ...@@ -57,20 +57,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
int search(int i); int search(int i);
int n; int n;
int a[10000] = {0}; int a[10000] = {0};
...@@ -121,7 +121,7 @@ int search(int i) ...@@ -121,7 +121,7 @@ int search(int i)
### A ### A
```c ```cpp
int main() int main()
{ {
int n, a[10005]; int n, a[10005];
...@@ -144,7 +144,7 @@ int main() ...@@ -144,7 +144,7 @@ int main()
### B ### B
```c ```cpp
int main() int main()
{ {
int n; int n;
...@@ -175,7 +175,7 @@ int main() ...@@ -175,7 +175,7 @@ int main()
### C ### C
```c ```cpp
int main() int main()
{ {
int n; int n;
......
...@@ -19,19 +19,19 @@ ...@@ -19,19 +19,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
639172 639172
``` ```
...@@ -39,18 +39,18 @@ ...@@ -39,18 +39,18 @@
### A ### A
```c ```cpp
629173 629173
``` ```
### B ### B
```c ```cpp
691372 691372
``` ```
### C ### C
```c ```cpp
627193 627193
``` ```
...@@ -1026,19 +1026,19 @@ REPEAT 9: ...@@ -1026,19 +1026,19 @@ REPEAT 9:
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
403 403
``` ```
...@@ -1046,18 +1046,18 @@ REPEAT 9: ...@@ -1046,18 +1046,18 @@ REPEAT 9:
### A ### A
```c ```cpp
400 400
``` ```
### B ### B
```c ```cpp
401 401
``` ```
### C ### C
```c ```cpp
402 402
``` ```
...@@ -18,19 +18,19 @@ ...@@ -18,19 +18,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
171700 171700
``` ```
...@@ -38,18 +38,18 @@ ...@@ -38,18 +38,18 @@
### A ### A
```c ```cpp
166650 166650
``` ```
### B ### B
```c ```cpp
176851 176851
``` ```
### C ### C
```c ```cpp
182104 182104
``` ```
...@@ -13,19 +13,19 @@ ...@@ -13,19 +13,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
624 624
``` ```
...@@ -33,18 +33,18 @@ ...@@ -33,18 +33,18 @@
### A ### A
```c ```cpp
626 626
``` ```
### B ### B
```c ```cpp
622 622
``` ```
### C ### C
```c ```cpp
628 628
``` ```
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
以下程序实现了这一功能,请你补全空白处的内容: 以下程序实现了这一功能,请你补全空白处的内容:
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -84,19 +84,19 @@ int main() ...@@ -84,19 +84,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
p.first = (s[j][1] - s[i][1]) / (s[i][0] - s[j][0]); p.first = (s[j][1] - s[i][1]) / (s[i][0] - s[j][0]);
``` ```
...@@ -104,18 +104,18 @@ p.first = (s[j][1] - s[i][1]) / (s[i][0] - s[j][0]); ...@@ -104,18 +104,18 @@ p.first = (s[j][1] - s[i][1]) / (s[i][0] - s[j][0]);
### A ### A
```c ```cpp
p.first = (s[j][1] - s[i][1]) / (s[i][1] - s[j][1]); p.first = (s[j][1] - s[i][1]) / (s[i][1] - s[j][1]);
``` ```
### B ### B
```c ```cpp
p.first = (s[j][0] - s[i][0]) / (s[i][0] - s[j][0]); p.first = (s[j][0] - s[i][0]) / (s[i][0] - s[j][0]);
``` ```
### C ### C
```c ```cpp
p.first = (s[j][0] - s[i][0]) / (s[i][1] - s[j][1]); p.first = (s[j][0] - s[i][0]) / (s[i][1] - s[j][1]);
``` ```
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
请你填补空白处的内容: 请你填补空白处的内容:
```c ```cpp
#include <stdio.h> #include <stdio.h>
void f(int x) void f(int x)
...@@ -57,19 +57,19 @@ int main() ...@@ -57,19 +57,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
x = x & (x + 1); x = x & (x + 1);
``` ```
...@@ -77,18 +77,18 @@ x = x & (x + 1); ...@@ -77,18 +77,18 @@ x = x & (x + 1);
### A ### A
```c ```cpp
x = x & (x - 1); x = x & (x - 1);
``` ```
### B ### B
```c ```cpp
x = x && (x - 1); x = x && (x - 1);
``` ```
### C ### C
```c ```cpp
x = x && (x + 1); x = x && (x + 1);
``` ```
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
以下程序实现了这一功能,请你补全空白处内容: 以下程序实现了这一功能,请你补全空白处内容:
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -122,19 +122,19 @@ int main() ...@@ -122,19 +122,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
int mid = l + r >> 1; int mid = l + r >> 1;
``` ```
...@@ -142,18 +142,18 @@ int mid = l + r >> 1; ...@@ -142,18 +142,18 @@ int mid = l + r >> 1;
### A ### A
```c ```cpp
int mid = l + (r >> 1); int mid = l + (r >> 1);
``` ```
### B ### B
```c ```cpp
int mid = l + r; int mid = l + r;
``` ```
### C ### C
```c ```cpp
int mid = l + r + 1; int mid = l + r + 1;
``` ```
...@@ -55,20 +55,20 @@ C = [C1, C2, ... CN], ...@@ -55,20 +55,20 @@ C = [C1, C2, ... CN],
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
int main() int main()
{ {
int n; int n;
...@@ -120,7 +120,7 @@ int main() ...@@ -120,7 +120,7 @@ int main()
### A ### A
```c ```cpp
const int maxn = 1e5 + 10; const int maxn = 1e5 + 10;
typedef long long ll; typedef long long ll;
int a[maxn]; int a[maxn];
...@@ -156,7 +156,7 @@ int main() ...@@ -156,7 +156,7 @@ int main()
### B ### B
```c ```cpp
#define ll long long #define ll long long
using namespace std; using namespace std;
...@@ -224,7 +224,7 @@ int main() ...@@ -224,7 +224,7 @@ int main()
### C ### C
```c ```cpp
typedef long long LL; typedef long long LL;
const int N = 1e5 + 10; const int N = 1e5 + 10;
......
...@@ -13,19 +13,19 @@ ...@@ -13,19 +13,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
1499441040 1499441040
``` ```
...@@ -33,18 +33,18 @@ ...@@ -33,18 +33,18 @@
### A ### A
```c ```cpp
1949990009 1949990009
``` ```
### B ### B
```c ```cpp
914140441 914140441
``` ```
### C ### C
```c ```cpp
1101001 1101001
``` ```
...@@ -8,19 +8,19 @@ y年m月d日是哪一年的第几天。 ...@@ -8,19 +8,19 @@ y年m月d日是哪一年的第几天。
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
189 189
``` ```
## 选项 ## 选项
...@@ -28,18 +28,18 @@ y年m月d日是哪一年的第几天。 ...@@ -28,18 +28,18 @@ y年m月d日是哪一年的第几天。
### A ### A
```c ```cpp
188 188
``` ```
### B ### B
```c ```cpp
190 190
``` ```
### C ### C
```c ```cpp
191 191
``` ```
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
请从以下四个选项中选择正确的代码填补空白处,实现方阵转置功能。 请从以下四个选项中选择正确的代码填补空白处,实现方阵转置功能。
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -64,19 +64,19 @@ int main() ...@@ -64,19 +64,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
for (j = 0; j < m; j++) for (j = 0; j < m; j++)
...@@ -91,7 +91,7 @@ int main() ...@@ -91,7 +91,7 @@ int main()
### A ### A
```c ```cpp
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
for (j = 0; j < m; j++) for (j = 0; j < m; j++)
...@@ -104,7 +104,7 @@ int main() ...@@ -104,7 +104,7 @@ int main()
### B ### B
```c ```cpp
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
for (j = 0; j < m; j++) for (j = 0; j < m; j++)
...@@ -117,7 +117,7 @@ int main() ...@@ -117,7 +117,7 @@ int main()
### C ### C
```c ```cpp
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
for (j = 0; j < m; j++) for (j = 0; j < m; j++)
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
请从以下四个选项中选择正确答案,填补在空白处,使得代码能运行后能产生正确的结果。 请从以下四个选项中选择正确答案,填补在空白处,使得代码能运行后能产生正确的结果。
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -51,19 +51,19 @@ int main(int argc, char *argv[]) ...@@ -51,19 +51,19 @@ int main(int argc, char *argv[])
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
n2 / base + n3 / base + n4 % base n2 / base + n3 / base + n4 % base
``` ```
## 选项 ## 选项
...@@ -71,18 +71,18 @@ n2 / base + n3 / base + n4 % base ...@@ -71,18 +71,18 @@ n2 / base + n3 / base + n4 % base
### A ### A
```c ```cpp
n2 % base + n3 / base + n4 / base n2 % base + n3 / base + n4 / base
``` ```
### B ### B
```c ```cpp
n2 / base + n3 % base + n4 / base n2 / base + n3 % base + n4 / base
``` ```
### C ### C
```c ```cpp
n2 / base + n3 / base + n4 / base n2 / base + n3 / base + n4 / base
``` ```
...@@ -24,20 +24,20 @@ ...@@ -24,20 +24,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
int bei[10]; int bei[10];
map<long long, int> mp; map<long long, int> mp;
...@@ -95,7 +95,7 @@ int main() ...@@ -95,7 +95,7 @@ int main()
### A ### A
```c ```cpp
const int N = 1e3 + 5; const int N = 1e3 + 5;
int a[15] = {9, 2, 1, 3, 8, 5, 6, 7, 4}, res = 0, vis[12], temp1; int a[15] = {9, 2, 1, 3, 8, 5, 6, 7, 4}, res = 0, vis[12], temp1;
bool fun(int x) bool fun(int x)
...@@ -151,7 +151,7 @@ int main() ...@@ -151,7 +151,7 @@ int main()
### B ### B
```c ```cpp
int st[10], res[10], book[10], cnt; int st[10], res[10], book[10], cnt;
int cal(int l, int r) int cal(int l, int r)
...@@ -218,7 +218,7 @@ int main() ...@@ -218,7 +218,7 @@ int main()
### C ### C
```c ```cpp
typedef long long LL; typedef long long LL;
const int N = 15; const int N = 15;
bool vis[N]; bool vis[N];
......
...@@ -21,20 +21,20 @@ ...@@ -21,20 +21,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
int d, a1[4]; int d, a1[4];
int d1(int *a1) int d1(int *a1)
...@@ -87,7 +87,7 @@ int main() ...@@ -87,7 +87,7 @@ int main()
### A ### A
```c ```cpp
int main() int main()
{ {
float n; float n;
...@@ -113,7 +113,7 @@ int main() ...@@ -113,7 +113,7 @@ int main()
### B ### B
```c ```cpp
int cm(int a, int b) int cm(int a, int b)
{ {
int temp; int temp;
...@@ -159,7 +159,7 @@ int main() ...@@ -159,7 +159,7 @@ int main()
### C ### C
```c ```cpp
int main(void) int main(void)
{ {
float a, b, c, d; float a, b, c, d;
......
...@@ -51,20 +51,20 @@ o 6 ...@@ -51,20 +51,20 @@ o 6
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
int main() int main()
{ {
char a[1005]; char a[1005];
...@@ -95,7 +95,7 @@ int main() ...@@ -95,7 +95,7 @@ int main()
### A ### A
```c ```cpp
#define MAX 1010 #define MAX 1010
int s[MAX]; int s[MAX];
...@@ -138,7 +138,7 @@ int main() ...@@ -138,7 +138,7 @@ int main()
### B ### B
```c ```cpp
char m[1005]; char m[1005];
int n[1005]; int n[1005];
char c; char c;
...@@ -198,7 +198,7 @@ int main() ...@@ -198,7 +198,7 @@ int main()
### C ### C
```c ```cpp
int main() int main()
{ {
int a[128] = {0}; int a[128] = {0};
......
...@@ -46,19 +46,19 @@ ...@@ -46,19 +46,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
0.6180339887498948482045868343656381177203091798057628621354486227052604628189024497072072041893911375 0.6180339887498948482045868343656381177203091798057628621354486227052604628189024497072072041893911375
``` ```
...@@ -66,18 +66,18 @@ ...@@ -66,18 +66,18 @@
### A ### A
```c ```cpp
0.6180339887498948482045868343656389332927878467731611281824609112882717278172075687340936512886003869 0.6180339887498948482045868343656389332927878467731611281824609112882717278172075687340936512886003869
``` ```
### B ### B
```c ```cpp
0.6180339887498948482045868343656381177203091798057628621354486227052604628189024496923340122463725713 0.6180339887498948482045868343656381177203091798057628621354486227052604628189024496923340122463725713
``` ```
### C ### C
```c ```cpp
0.6180339887498948482045868343656382367107301981874040757690591496236273680999331990382076023866480180 0.6180339887498948482045868343656382367107301981874040757690591496236273680999331990382076023866480180
``` ```
...@@ -130,19 +130,19 @@ WSDAUGUTVWCVHEMOIRJJGTANUWTSAIXXEVZTBDHPGSRHHVWCDZVZYRJTLONIJVXEATHQXOUKBIGZONFR ...@@ -130,19 +130,19 @@ WSDAUGUTVWCVHEMOIRJJGTANUWTSAIXXEVZTBDHPGSRHHVWCDZVZYRJTLONIJVXEATHQXOUKBIGZONFR
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
41 41
``` ```
...@@ -150,18 +150,18 @@ WSDAUGUTVWCVHEMOIRJJGTANUWTSAIXXEVZTBDHPGSRHHVWCDZVZYRJTLONIJVXEATHQXOUKBIGZONFR ...@@ -150,18 +150,18 @@ WSDAUGUTVWCVHEMOIRJJGTANUWTSAIXXEVZTBDHPGSRHHVWCDZVZYRJTLONIJVXEATHQXOUKBIGZONFR
### A ### A
```c ```cpp
38 38
``` ```
### B ### B
```c ```cpp
39 39
``` ```
### C ### C
```c ```cpp
40 40
``` ```
...@@ -47,7 +47,7 @@ LCXYZ ...@@ -47,7 +47,7 @@ LCXYZ
以下程序实现了这一功能,请你补全空白处内容: 以下程序实现了这一功能,请你补全空白处内容:
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -81,19 +81,19 @@ int main() ...@@ -81,19 +81,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
re = re + char(temp + 'A' - 1); re = re + char(temp + 'A' - 1);
i += 2; i += 2;
``` ```
...@@ -102,21 +102,21 @@ i += 2; ...@@ -102,21 +102,21 @@ i += 2;
### A ### A
```c ```cpp
re = re + char(temp + 'A' - 1); re = re + char(temp + 'A' - 1);
i += 1; i += 1;
``` ```
### B ### B
```c ```cpp
re = re + char(temp + 'A'); re = re + char(temp + 'A');
i += 1; i += 1;
``` ```
### C ### C
```c ```cpp
re = re + char(temp + 'A'); re = re + char(temp + 'A');
i += 2; i += 2;
``` ```
...@@ -54,20 +54,20 @@ o****o**** ...@@ -54,20 +54,20 @@ o****o****
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
char a[1005], b[1005]; char a[1005], b[1005];
int len, i = 0, ans = 0; int len, i = 0, ans = 0;
...@@ -92,7 +92,7 @@ int main() ...@@ -92,7 +92,7 @@ int main()
### A ### A
```c ```cpp
char a[1005], b[1005]; char a[1005], b[1005];
struct node struct node
...@@ -156,7 +156,7 @@ int main() ...@@ -156,7 +156,7 @@ int main()
### B ### B
```c ```cpp
int main() int main()
{ {
string a; string a;
...@@ -194,7 +194,7 @@ int main() ...@@ -194,7 +194,7 @@ int main()
### C ### C
```c ```cpp
int main() int main()
{ {
string a, b; string a, b;
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
请您补全以下代码: 请您补全以下代码:
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -58,19 +58,19 @@ int main(int argc, char **argv) ...@@ -58,19 +58,19 @@ int main(int argc, char **argv)
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
if (str[i] <= '9' && str[i] >= '0') if (str[i] <= '9' && str[i] >= '0')
{ {
number++; number++;
...@@ -89,7 +89,7 @@ int main(int argc, char **argv) ...@@ -89,7 +89,7 @@ int main(int argc, char **argv)
### A ### A
```c ```cpp
if ('0' <= str[i] <= '0') if ('0' <= str[i] <= '0')
{ {
number++; number++;
...@@ -106,7 +106,7 @@ int main(int argc, char **argv) ...@@ -106,7 +106,7 @@ int main(int argc, char **argv)
### B ### B
```c ```cpp
if (str[i] <= '9' & str[i] >= '0') if (str[i] <= '9' & str[i] >= '0')
{ {
number++; number++;
...@@ -123,7 +123,7 @@ int main(int argc, char **argv) ...@@ -123,7 +123,7 @@ int main(int argc, char **argv)
### C ### C
```c ```cpp
if (str[i] < '9' && str[i] > '0') if (str[i] < '9' && str[i] > '0')
{ {
number++; number++;
......
...@@ -57,20 +57,20 @@ This is a story about Alice and Bob. Alice wants to send a private message to Bo ...@@ -57,20 +57,20 @@ This is a story about Alice and Bob. Alice wants to send a private message to Bo
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
int main() int main()
{ {
int k; int k;
...@@ -143,7 +143,7 @@ int main() ...@@ -143,7 +143,7 @@ int main()
### A ### A
```c ```cpp
int cnt, k; int cnt, k;
bool temp = true; bool temp = true;
char f[2][20] = {"Alice", "Bob"}; char f[2][20] = {"Alice", "Bob"};
...@@ -187,7 +187,7 @@ int main() ...@@ -187,7 +187,7 @@ int main()
### B ### B
```c ```cpp
#define mem(a, b) memset(a, b, sizeof a) #define mem(a, b) memset(a, b, sizeof a)
#define PII pair<int, int> #define PII pair<int, int>
#define ll long long #define ll long long
...@@ -261,7 +261,7 @@ int main() ...@@ -261,7 +261,7 @@ int main()
### C ### C
```c ```cpp
int len; int len;
string s; string s;
bool check(int i) bool check(int i)
......
...@@ -36,7 +36,7 @@ HHHellllloo ...@@ -36,7 +36,7 @@ HHHellllloo
以下程序实现了这一功能,请你填补空白处内容: 以下程序实现了这一功能,请你填补空白处内容:
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -73,19 +73,19 @@ int main() ...@@ -73,19 +73,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
s2[top++] = s1[i - 1]; s2[top++] = s1[i - 1];
``` ```
...@@ -93,18 +93,18 @@ s2[top++] = s1[i - 1]; ...@@ -93,18 +93,18 @@ s2[top++] = s1[i - 1];
### A ### A
```c ```cpp
s2[++top] = s1[i - 1]; s2[++top] = s1[i - 1];
``` ```
### B ### B
```c ```cpp
s2[++top] = s1[i + 1]; s2[++top] = s1[i + 1];
``` ```
### C ### C
```c ```cpp
s2[top++] = s1[i + 1]; s2[top++] = s1[i + 1];
``` ```
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
以下程序实现了这一功能,请你补全空白处的内容: 以下程序实现了这一功能,请你补全空白处的内容:
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -33,19 +33,19 @@ int main() ...@@ -33,19 +33,19 @@ int main()
## aop ## aop
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
s.insert(str.substr(i, j - i + 1)); s.insert(str.substr(i, j - i + 1));
``` ```
...@@ -53,18 +53,18 @@ s.insert(str.substr(i, j - i + 1)); ...@@ -53,18 +53,18 @@ s.insert(str.substr(i, j - i + 1));
### A ### A
```c ```cpp
s.insert(str.substr(i, j + i + 1)); s.insert(str.substr(i, j + i + 1));
``` ```
### B ### B
```c ```cpp
s.insert(str.substr(i, j - i - 1)); s.insert(str.substr(i, j - i - 1));
``` ```
### C ### C
```c ```cpp
s.insert(str.substr(i, j - i)); s.insert(str.substr(i, j - i));
``` ```
...@@ -46,19 +46,19 @@ ...@@ -46,19 +46,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
#define MAX 110 #define MAX 110
#define INF 0x3f3f3f3f #define INF 0x3f3f3f3f
#define EXP 1e-9 #define EXP 1e-9
...@@ -198,7 +198,7 @@ int main() ...@@ -198,7 +198,7 @@ int main()
### A ### A
```c ```cpp
const int inf = 0x3fffffff; const int inf = 0x3fffffff;
const int maxn = 100100; const int maxn = 100100;
...@@ -337,7 +337,7 @@ int main() ...@@ -337,7 +337,7 @@ int main()
### B ### B
```c ```cpp
int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int data[8]; int data[8];
void guizheng() void guizheng()
...@@ -418,7 +418,7 @@ int main() ...@@ -418,7 +418,7 @@ int main()
### C ### C
```c ```cpp
int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
bool check(int year) bool check(int year)
......
...@@ -8,7 +8,7 @@ StringInGrid函数会在一个指定大小的格子中打印指定的字符串 ...@@ -8,7 +8,7 @@ StringInGrid函数会在一个指定大小的格子中打印指定的字符串
以下程序实现了这一功能,请你补全空白处内容: 以下程序实现了这一功能,请你补全空白处内容:
```c ```cpp
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
void StringInGrid(int width, int height, const char *s) void StringInGrid(int width, int height, const char *s)
...@@ -56,19 +56,19 @@ int main() ...@@ -56,19 +56,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
(width - strlen(buf) - 2) / 2, "", buf, (width - strlen(buf) - 2) / 2, "" (width - strlen(buf) - 2) / 2, "", buf, (width - strlen(buf) - 2) / 2, ""
``` ```
...@@ -76,18 +76,18 @@ int main() ...@@ -76,18 +76,18 @@ int main()
### A ### A
```c ```cpp
(width - strlen(buf) - 1) / 2, "", buf, (width - strlen(buf) - 1) / 2, "" (width - strlen(buf) - 1) / 2, "", buf, (width - strlen(buf) - 1) / 2, ""
``` ```
### B ### B
```c ```cpp
(width - strlen(buf) + 1) / 2, "", buf, (width - strlen(buf) + 1) / 2, "" (width - strlen(buf) + 1) / 2, "", buf, (width - strlen(buf) + 1) / 2, ""
``` ```
### C ### C
```c ```cpp
(width - strlen(buf) - 2), "", buf, (width - strlen(buf) - 2), "" (width - strlen(buf) - 2), "", buf, (width - strlen(buf) - 2), ""
``` ```
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
请你补全空白处的内容: 请你补全空白处的内容:
```c ```cpp
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
...@@ -52,19 +52,19 @@ int main() ...@@ -52,19 +52,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
a[i][j] = a[i - 1][j - 1] + 1; a[i][j] = a[i - 1][j - 1] + 1;
``` ```
...@@ -72,18 +72,18 @@ a[i][j] = a[i - 1][j - 1] + 1; ...@@ -72,18 +72,18 @@ a[i][j] = a[i - 1][j - 1] + 1;
### A ### A
```c ```cpp
a[i][j] = a[i - 1][j - 1]; a[i][j] = a[i - 1][j - 1];
``` ```
### B ### B
```c ```cpp
a[i][j] = a[i - 1][j] + 1; a[i][j] = a[i - 1][j] + 1;
``` ```
### C ### C
```c ```cpp
a[i][j] = a[i][j - 1] + 1; a[i][j] = a[i][j - 1] + 1;
``` ```
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -58,13 +58,13 @@ using namespace std; ...@@ -58,13 +58,13 @@ using namespace std;
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
int main() int main()
{ {
int n, ans = 0; int n, ans = 0;
...@@ -99,7 +99,7 @@ int main() ...@@ -99,7 +99,7 @@ int main()
### A ### A
```c ```cpp
int visit[10] = {0}; int visit[10] = {0};
int s[10]; int s[10];
int ans = 0; int ans = 0;
...@@ -159,7 +159,7 @@ int main() ...@@ -159,7 +159,7 @@ int main()
### B ### B
```c ```cpp
int parse(const char *arr, int pos, int len) int parse(const char *arr, int pos, int len)
{ {
int ans = 0; int ans = 0;
...@@ -209,7 +209,7 @@ int main() ...@@ -209,7 +209,7 @@ int main()
### C ### C
```c ```cpp
int a[10] = {0}; int a[10] = {0};
int Division(int m) int Division(int m)
{ {
......
...@@ -18,7 +18,7 @@ C国最多可以派出2人。 ...@@ -18,7 +18,7 @@ C国最多可以派出2人。
请你补全代码中空白的部分: 请你补全代码中空白的部分:
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -59,19 +59,19 @@ int main() ...@@ -59,19 +59,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
f(a, k + 1, m - i, b); f(a, k + 1, m - i, b);
``` ```
## 选项 ## 选项
...@@ -79,18 +79,18 @@ f(a, k + 1, m - i, b); ...@@ -79,18 +79,18 @@ f(a, k + 1, m - i, b);
### A ### A
```c ```cpp
f(a, k, m - i, b); f(a, k, m - i, b);
``` ```
### B ### B
```c ```cpp
f(a, k - 1, m - i, b); f(a, k - 1, m - i, b);
``` ```
### C ### C
```c ```cpp
f(a, k + 1, m + i, b); f(a, k + 1, m + i, b);
``` ```
...@@ -62,7 +62,7 @@ ran=6 ...@@ -62,7 +62,7 @@ ran=6
请你补全程序,实现该图形的打印。 请你补全程序,实现该图形的打印。
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -109,19 +109,19 @@ int main() ...@@ -109,19 +109,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
f(a, rank - 1, row, col + w / 2); f(a, rank - 1, row, col + w / 2);
``` ```
## 选项 ## 选项
...@@ -129,18 +129,18 @@ f(a, rank - 1, row, col + w / 2); ...@@ -129,18 +129,18 @@ f(a, rank - 1, row, col + w / 2);
### A ### A
```c ```cpp
f(a, rank, row, col + w / 2); f(a, rank, row, col + w / 2);
``` ```
### B ### B
```c ```cpp
f(a, rank - 1, row, col + w); f(a, rank - 1, row, col + w);
``` ```
### C ### C
```c ```cpp
f(a, rank + 1, row, col + w / 2); f(a, rank + 1, row, col + w / 2);
``` ```
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
下面的代码实现了这一功能,请你补全代码中的空白处: 下面的代码实现了这一功能,请你补全代码中的空白处:
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -75,19 +75,19 @@ int main() ...@@ -75,19 +75,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
return b ? gcd(b, a % b) : a; return b ? gcd(b, a % b) : a;
``` ```
## 选项 ## 选项
...@@ -95,18 +95,18 @@ return b ? gcd(b, a % b) : a; ...@@ -95,18 +95,18 @@ return b ? gcd(b, a % b) : a;
### A ### A
```c ```cpp
return b ? gcd(b, a) : a; return b ? gcd(b, a) : a;
``` ```
### B ### B
```c ```cpp
return b ? gcd(b, a / b) : a; return b ? gcd(b, a / b) : a;
``` ```
### C ### C
```c ```cpp
return b ? gcd(b, a + b) : a; return b ? gcd(b, a + b) : a;
``` ```
...@@ -50,20 +50,20 @@ Fibonacci数列的递推公式为:Fn=Fn-1+Fn-2,其中F1=F2=1。 ...@@ -50,20 +50,20 @@ Fibonacci数列的递推公式为:Fn=Fn-1+Fn-2,其中F1=F2=1。
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
int fib(int n) int fib(int n)
{ {
if (n < 3) if (n < 3)
...@@ -84,7 +84,7 @@ int main() ...@@ -84,7 +84,7 @@ int main()
### A ### A
```c ```cpp
int fib(int N) int fib(int N)
{ {
if (N <= 0) if (N <= 0)
...@@ -113,7 +113,7 @@ int main() ...@@ -113,7 +113,7 @@ int main()
### B ### B
```c ```cpp
int main() int main()
{ {
int n, b; int n, b;
...@@ -136,7 +136,7 @@ int main() ...@@ -136,7 +136,7 @@ int main()
### C ### C
```c ```cpp
int f[1000000 + 1]; int f[1000000 + 1];
void meter(int n) void meter(int n)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
以下的方法就是一种。请你填补空白处的内容: 以下的方法就是一种。请你填补空白处的内容:
```c ```cpp
#include <stdio.h> #include <stdio.h>
int len(int x) int len(int x)
{ {
...@@ -33,19 +33,19 @@ int main() ...@@ -33,19 +33,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
return f(x / 10, k); return f(x / 10, k);
``` ```
...@@ -53,18 +53,18 @@ int main() ...@@ -53,18 +53,18 @@ int main()
### A ### A
```c ```cpp
return f(x % 10, k); return f(x % 10, k);
``` ```
### B ### B
```c ```cpp
return f(x, k); return f(x, k);
``` ```
### C ### C
```c ```cpp
return f(x, k / 10); return f(x, k / 10);
``` ```
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
请你补全代码: 请你补全代码:
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -79,19 +79,19 @@ int main(int argc, char **argv) ...@@ -79,19 +79,19 @@ int main(int argc, char **argv)
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
v2 = evaluate(x + v1.n + 1); v2 = evaluate(x + v1.n + 1);
``` ```
...@@ -99,18 +99,18 @@ v2 = evaluate(x + v1.n + 1); ...@@ -99,18 +99,18 @@ v2 = evaluate(x + v1.n + 1);
### A ### A
```c ```cpp
v2 = evaluate(x + v1.n); v2 = evaluate(x + v1.n);
``` ```
### B ### B
```c ```cpp
v2 = evaluate(v1.n); v2 = evaluate(v1.n);
``` ```
### C ### C
```c ```cpp
v2 = evaluate(v1.n + 1); v2 = evaluate(v1.n + 1);
``` ```
...@@ -10,7 +10,7 @@ A A 2 2 3 3 4 4, 一共4对扑克牌。请你把它们排成一行。 ...@@ -10,7 +10,7 @@ A A 2 2 3 3 4 4, 一共4对扑克牌。请你把它们排成一行。
以下程序实现了这一功能,请你补全空白处内容: 以下程序实现了这一功能,请你补全空白处内容:
```c ```cpp
#include <iostream> #include <iostream>
using namespace std; using namespace std;
int n = 0; int n = 0;
...@@ -62,19 +62,19 @@ int main() ...@@ -62,19 +62,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
pailie(str, k + 1, m); pailie(str, k + 1, m);
``` ```
...@@ -82,18 +82,18 @@ pailie(str, k + 1, m); ...@@ -82,18 +82,18 @@ pailie(str, k + 1, m);
### A ### A
```c ```cpp
pailie(str, k, m); pailie(str, k, m);
``` ```
### B ### B
```c ```cpp
pailie(str, k - 1, m); pailie(str, k - 1, m);
``` ```
### C ### C
```c ```cpp
pailie(str, k + 1, m + 1); pailie(str, k + 1, m + 1);
``` ```
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
以下代码实现了这一功能,请你填补空白处内容: 以下代码实现了这一功能,请你填补空白处内容:
```c ```cpp
#include <iostream> #include <iostream>
using namespace std; using namespace std;
...@@ -42,19 +42,19 @@ int main() ...@@ -42,19 +42,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
return f(x + 1, y) + f(x, y + 1); return f(x + 1, y) + f(x, y + 1);
``` ```
...@@ -62,18 +62,18 @@ return f(x + 1, y) + f(x, y + 1); ...@@ -62,18 +62,18 @@ return f(x + 1, y) + f(x, y + 1);
### A ### A
```c ```cpp
return f(x - 1, y) + f(x, y - 1); return f(x - 1, y) + f(x, y - 1);
``` ```
### B ### B
```c ```cpp
return f(x + 1, y) + f(x, y - 1); return f(x + 1, y) + f(x, y - 1);
``` ```
### C ### C
```c ```cpp
return f(x + 1, y + 1) + f(x + 1, y + 1); return f(x + 1, y + 1) + f(x + 1, y + 1);
``` ```
...@@ -67,7 +67,7 @@ CPU消耗 < 1000ms ...@@ -67,7 +67,7 @@ CPU消耗 < 1000ms
下面的代码实现了这一功能,请你补全空白处缺失的代码: 下面的代码实现了这一功能,请你补全空白处缺失的代码:
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -128,19 +128,19 @@ int main() ...@@ -128,19 +128,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
dp[i] = (C(s[i] - 1, s[i * 2 + 1]) * dp[i * 2 + 1]) % mod * dp[i * 2] % mod; dp[i] = (C(s[i] - 1, s[i * 2 + 1]) * dp[i * 2 + 1]) % mod * dp[i * 2] % mod;
``` ```
## 选项 ## 选项
...@@ -148,18 +148,18 @@ dp[i] = (C(s[i] - 1, s[i * 2 + 1]) * dp[i * 2 + 1]) % mod * dp[i * 2] % mod; ...@@ -148,18 +148,18 @@ dp[i] = (C(s[i] - 1, s[i * 2 + 1]) * dp[i * 2 + 1]) % mod * dp[i * 2] % mod;
### A ### A
```c ```cpp
dp[i] = (C(s[i], s[i * 2 + 1]) * dp[i * 2 + 1]) % mod * dp[i * 2 + 1] % mod; dp[i] = (C(s[i], s[i * 2 + 1]) * dp[i * 2 + 1]) % mod * dp[i * 2 + 1] % mod;
``` ```
### B ### B
```c ```cpp
dp[i] = (C(s[i] - 1, s[i * 2]) * dp[i * 2]) % mod * dp[i * 2] % mod; dp[i] = (C(s[i] - 1, s[i * 2]) * dp[i * 2]) % mod * dp[i * 2] % mod;
``` ```
### C ### C
```c ```cpp
dp[i] = (C(s[i] + 1, s[i * 2 + 1]) * dp[i * 2 + 1]) % mod * dp[i * 2] % mod; dp[i] = (C(s[i] + 1, s[i * 2 + 1]) * dp[i * 2 + 1]) % mod * dp[i * 2] % mod;
``` ```
...@@ -66,20 +66,20 @@ ...@@ -66,20 +66,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
int m, n; int m, n;
int len = 0; int len = 0;
int main() int main()
...@@ -124,7 +124,7 @@ int main() ...@@ -124,7 +124,7 @@ int main()
### A ### A
```c ```cpp
int main() int main()
{ {
vector<int> a; vector<int> a;
...@@ -171,7 +171,7 @@ int main() ...@@ -171,7 +171,7 @@ int main()
### B ### B
```c ```cpp
int a[500005]; int a[500005];
int main() int main()
...@@ -213,7 +213,7 @@ int main() ...@@ -213,7 +213,7 @@ int main()
### C ### C
```c ```cpp
struct num struct num
{ {
int order; int order;
......
...@@ -14,19 +14,19 @@ ...@@ -14,19 +14,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
1580 1580
``` ```
## 选项 ## 选项
...@@ -34,18 +34,18 @@ ...@@ -34,18 +34,18 @@
### A ### A
```c ```cpp
1579 1579
``` ```
### B ### B
```c ```cpp
1582 1582
``` ```
### C ### C
```c ```cpp
1581 1581
``` ```
...@@ -8,19 +8,19 @@ ...@@ -8,19 +8,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
16 16
``` ```
## 选项 ## 选项
...@@ -28,18 +28,18 @@ ...@@ -28,18 +28,18 @@
### A ### A
```c ```cpp
17 17
``` ```
### B ### B
```c ```cpp
18 18
``` ```
### C ### C
```c ```cpp
19 19
``` ```
...@@ -10,19 +10,19 @@ ...@@ -10,19 +10,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
8879 8879
``` ```
...@@ -30,18 +30,18 @@ ...@@ -30,18 +30,18 @@
### A ### A
```c ```cpp
8888 8888
``` ```
### B ### B
```c ```cpp
8880 8880
``` ```
### C ### C
```c ```cpp
8808 8808
``` ```
...@@ -60,20 +60,20 @@ n 个小朋友站成一排。 ...@@ -60,20 +60,20 @@ n 个小朋友站成一排。
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
#define ll long long #define ll long long
using namespace std; using namespace std;
int const MAX = 1e5 + 5; int const MAX = 1e5 + 5;
...@@ -151,7 +151,7 @@ int main() ...@@ -151,7 +151,7 @@ int main()
### A ### A
```c ```cpp
typedef long long LL; typedef long long LL;
const int N = 1e6 + 10; const int N = 1e6 + 10;
int h[N], s[N], tr[N]; int h[N], s[N], tr[N];
...@@ -197,7 +197,7 @@ int main() ...@@ -197,7 +197,7 @@ int main()
### B ### B
```c ```cpp
struct childInfo struct childInfo
{ {
int location; int location;
...@@ -280,7 +280,7 @@ int main() ...@@ -280,7 +280,7 @@ int main()
### C ### C
```c ```cpp
struct childInfo struct childInfo
{ {
int location; int location;
......
...@@ -80,20 +80,20 @@ ...@@ -80,20 +80,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
typedef long long ll; typedef long long ll;
#define int ll #define int ll
#define rep(i, a, n) for (int i = a; i < (int)n; i++) #define rep(i, a, n) for (int i = a; i < (int)n; i++)
...@@ -168,7 +168,7 @@ signed main() ...@@ -168,7 +168,7 @@ signed main()
### A ### A
```c ```cpp
#define ll long long #define ll long long
const int N = 3e5; const int N = 3e5;
ll a[N], s[N]; ll a[N], s[N];
...@@ -217,7 +217,7 @@ int main() ...@@ -217,7 +217,7 @@ int main()
### B ### B
```c ```cpp
const int MAXN = 300010; const int MAXN = 300010;
int nums[MAXN]; int nums[MAXN];
...@@ -329,7 +329,7 @@ int main() ...@@ -329,7 +329,7 @@ int main()
### C ### C
```c ```cpp
typedef long long LL; typedef long long LL;
const int INF = 0x3f3f3f3f; const int INF = 0x3f3f3f3f;
const double Pi = acos(-1); const double Pi = acos(-1);
......
...@@ -69,7 +69,7 @@ a5: 2出现过,最后一次为原序列的a3,在a3后、a5前有1种数字 ...@@ -69,7 +69,7 @@ a5: 2出现过,最后一次为原序列的a3,在a3后、a5前有1种数字
以下程序实现了这一功能,请你补全空白处的内容: 以下程序实现了这一功能,请你补全空白处的内容:
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -143,19 +143,19 @@ int main() ...@@ -143,19 +143,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
query(a, b, (k << 1) + 1, l, mid) + query(a, b, (k + 1) << 1, mid, r) query(a, b, (k << 1) + 1, l, mid) + query(a, b, (k + 1) << 1, mid, r)
``` ```
...@@ -163,18 +163,18 @@ query(a, b, (k << 1) + 1, l, mid) + query(a, b, (k + 1) << 1, mid, r) ...@@ -163,18 +163,18 @@ query(a, b, (k << 1) + 1, l, mid) + query(a, b, (k + 1) << 1, mid, r)
### A ### A
```c ```cpp
query(a, b, (k >> 1) + 1, l, mid) + query(a, b, (k + 1) >> 1, mid, r) query(a, b, (k >> 1) + 1, l, mid) + query(a, b, (k + 1) >> 1, mid, r)
``` ```
### B ### B
```c ```cpp
query(a, b, k << 1, l, mid) + query(a, b, k << 1, mid, r) query(a, b, k << 1, l, mid) + query(a, b, k << 1, mid, r)
``` ```
### C ### C
```c ```cpp
query(a, b, (k << 1) + 1, l, mid) + query(a, b, (k + 1) >> 1, mid, r) query(a, b, (k << 1) + 1, l, mid) + query(a, b, (k + 1) >> 1, mid, r)
``` ```
...@@ -41,19 +41,19 @@ ...@@ -41,19 +41,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
387420489 387420489
``` ```
...@@ -61,18 +61,18 @@ ...@@ -61,18 +61,18 @@
### A ### A
```c ```cpp
10000000000 10000000000
``` ```
### B ### B
```c ```cpp
16777216 16777216
``` ```
### C ### C
```c ```cpp
43046721 43046721
``` ```
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
以下程序实现了这一功能,请你补全空白处的内容: 以下程序实现了这一功能,请你补全空白处的内容:
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -166,19 +166,19 @@ int main() ...@@ -166,19 +166,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
bp[get(i, j, k)] += s[get(x, y, z)] * t; bp[get(i, j, k)] += s[get(x, y, z)] * t;
``` ```
...@@ -186,18 +186,18 @@ bp[get(i, j, k)] += s[get(x, y, z)] * t; ...@@ -186,18 +186,18 @@ bp[get(i, j, k)] += s[get(x, y, z)] * t;
### A ### A
```c ```cpp
bp[get(i, j, k)] = s[get(x, y, z)] * t; bp[get(i, j, k)] = s[get(x, y, z)] * t;
``` ```
### B ### B
```c ```cpp
bp[get(i, j, k)] *= s[get(x, y, z)] * t; bp[get(i, j, k)] *= s[get(x, y, z)] * t;
``` ```
### C ### C
```c ```cpp
bp[get(i, j, k)] = s[get(x, y, z)] + t; bp[get(i, j, k)] = s[get(x, y, z)] + t;
``` ```
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
以下程序实现了该功能,请你补全空白处内容: 以下程序实现了该功能,请你补全空白处内容:
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -160,19 +160,19 @@ int main() ...@@ -160,19 +160,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
if (direction == Dup) if (direction == Dup)
nRow -= 1; nRow -= 1;
else if (direction == Dright) else if (direction == Dright)
...@@ -187,7 +187,7 @@ else ...@@ -187,7 +187,7 @@ else
### A ### A
```c ```cpp
if (direction == Dup) if (direction == Dup)
nRow += 1; nRow += 1;
else if (direction == Dright) else if (direction == Dright)
...@@ -201,7 +201,7 @@ else ...@@ -201,7 +201,7 @@ else
### B ### B
```c ```cpp
if (direction == Dup) if (direction == Dup)
nRow += 1; nRow += 1;
else if (direction == Dright) else if (direction == Dright)
...@@ -214,7 +214,7 @@ else ...@@ -214,7 +214,7 @@ else
### C ### C
```c ```cpp
if (direction == Dup) if (direction == Dup)
nRow -= 1; nRow -= 1;
else if (direction == Dright) else if (direction == Dright)
......
...@@ -39,7 +39,7 @@ X和Y ...@@ -39,7 +39,7 @@ X和Y
以下程序实现了该功能,请你补全空白处内容: 以下程序实现了该功能,请你补全空白处内容:
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -69,19 +69,19 @@ int main() ...@@ -69,19 +69,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
sum += (long long)y > 0 ? (2 * y + y + x) : (6 * y - y - x); sum += (long long)y > 0 ? (2 * y + y + x) : (6 * y - y - x);
``` ```
...@@ -89,18 +89,18 @@ sum += (long long)y > 0 ? (2 * y + y + x) : (6 * y - y - x); ...@@ -89,18 +89,18 @@ sum += (long long)y > 0 ? (2 * y + y + x) : (6 * y - y - x);
### A ### A
```c ```cpp
sum += (long long)y > 0 ? (2 * y + x) : (6 * y - y - x); sum += (long long)y > 0 ? (2 * y + x) : (6 * y - y - x);
``` ```
### B ### B
```c ```cpp
sum += (long long)y > 0 ? (2 * y + y + x) : (6 * y - x); sum += (long long)y > 0 ? (2 * y + y + x) : (6 * y - x);
``` ```
### C ### C
```c ```cpp
sum += (long long)y > 0 ? (2 * y + x) : (6 * y - x); sum += (long long)y > 0 ? (2 * y + x) : (6 * y - x);
``` ```
...@@ -52,19 +52,19 @@ ...@@ -52,19 +52,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
string s; string s;
void init() void init()
{ {
...@@ -122,7 +122,7 @@ int main() ...@@ -122,7 +122,7 @@ int main()
### A ### A
```c ```cpp
int main() int main()
{ {
int n; int n;
...@@ -271,7 +271,7 @@ int main() ...@@ -271,7 +271,7 @@ int main()
### B ### B
```c ```cpp
int a[3005], n; int a[3005], n;
char m[1300][1300]; char m[1300][1300];
void init() void init()
...@@ -345,7 +345,7 @@ int main() ...@@ -345,7 +345,7 @@ int main()
### C ### C
```c ```cpp
string str; string str;
stringstream ss; stringstream ss;
......
...@@ -58,7 +58,7 @@ X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X ...@@ -58,7 +58,7 @@ X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X
以下的代码可以计算出点子称的示数,请你补全它: 以下的代码可以计算出点子称的示数,请你补全它:
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -97,19 +97,19 @@ int main() ...@@ -97,19 +97,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
a[i + 1][j + 1] += (0.5 * a[i][j]); a[i + 1][j + 1] += (0.5 * a[i][j]);
``` ```
## 选项 ## 选项
...@@ -117,18 +117,18 @@ a[i + 1][j + 1] += (0.5 * a[i][j]); ...@@ -117,18 +117,18 @@ a[i + 1][j + 1] += (0.5 * a[i][j]);
### A ### A
```c ```cpp
a[i + 1][j] += (0.5 * a[i][j]); a[i + 1][j] += (0.5 * a[i][j]);
``` ```
### B ### B
```c ```cpp
a[i][j + 1] += (0.5 * a[i][j]); a[i][j + 1] += (0.5 * a[i][j]);
``` ```
### C ### C
```c ```cpp
a[i + 1][j + 1] = (0.5 * a[i][j]); a[i + 1][j + 1] = (0.5 * a[i][j]);
``` ```
...@@ -46,20 +46,20 @@ ...@@ -46,20 +46,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
bool cmp(pair<int, int> a, pair<int, int> b) bool cmp(pair<int, int> a, pair<int, int> b)
{ {
return a.first > b.first; return a.first > b.first;
...@@ -106,7 +106,7 @@ int main() ...@@ -106,7 +106,7 @@ int main()
### A ### A
```c ```cpp
int main() int main()
{ {
int n, k; int n, k;
...@@ -138,7 +138,7 @@ int main() ...@@ -138,7 +138,7 @@ int main()
### B ### B
```c ```cpp
typedef struct typedef struct
{ {
int h, w; int h, w;
...@@ -192,7 +192,7 @@ int main() ...@@ -192,7 +192,7 @@ int main()
### C ### C
```c ```cpp
int co[100100][2]; int co[100100][2];
int coun(int n, int x) int coun(int n, int x)
......
...@@ -24,20 +24,20 @@ ...@@ -24,20 +24,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
int main() int main()
{ {
int num1[7] = {0, 1, 2, 5, 6, 8, 9}; int num1[7] = {0, 1, 2, 5, 6, 8, 9};
...@@ -97,7 +97,7 @@ int main() ...@@ -97,7 +97,7 @@ int main()
### A ### A
```c ```cpp
void i2s(int num, string &str) void i2s(int num, string &str)
{ {
stringstream ss; stringstream ss;
...@@ -179,7 +179,7 @@ int main() ...@@ -179,7 +179,7 @@ int main()
### B ### B
```c ```cpp
#define ll long long #define ll long long
using namespace std; using namespace std;
int flag(int n) int flag(int n)
...@@ -236,7 +236,7 @@ int main() ...@@ -236,7 +236,7 @@ int main()
### C ### C
```c ```cpp
int num[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; int num[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
int dnum[] = {0, 1, 2, -1, -1, 5, 9, -1, 8, 6}; int dnum[] = {0, 1, 2, -1, -1, 5, 9, -1, 8, 6};
int main() int main()
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
以下程序可以实现该功能,请你计算该程序的算法复杂度: 以下程序可以实现该功能,请你计算该程序的算法复杂度:
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -74,19 +74,19 @@ int main() ...@@ -74,19 +74,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
O(n^1.5) O(n^1.5)
``` ```
## 选项 ## 选项
...@@ -94,18 +94,18 @@ O(n^1.5) ...@@ -94,18 +94,18 @@ O(n^1.5)
### A ### A
```c ```cpp
O(n^3) O(n^3)
``` ```
### B ### B
```c ```cpp
O(n^2) O(n^2)
``` ```
### C ### C
```c ```cpp
O(n^2.5) O(n^2.5)
``` ```
...@@ -26,19 +26,19 @@ ...@@ -26,19 +26,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
80 80
``` ```
## 选项 ## 选项
...@@ -46,18 +46,18 @@ ...@@ -46,18 +46,18 @@
### A ### A
```c ```cpp
90 90
``` ```
### B ### B
```c ```cpp
70 70
``` ```
### C ### C
```c ```cpp
78 78
``` ```
...@@ -41,20 +41,20 @@ ...@@ -41,20 +41,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
int main() int main()
{ {
int n; int n;
...@@ -95,7 +95,7 @@ int main() ...@@ -95,7 +95,7 @@ int main()
### A ### A
```c ```cpp
int main() int main()
{ {
int n, m, count = 0, t = 0; int n, m, count = 0, t = 0;
...@@ -144,7 +144,7 @@ int main() ...@@ -144,7 +144,7 @@ int main()
### B ### B
```c ```cpp
int n; int n;
int a[100]; int a[100];
int main() int main()
...@@ -201,7 +201,7 @@ int main() ...@@ -201,7 +201,7 @@ int main()
### C ### C
```c ```cpp
int main() int main()
{ {
int n; int n;
......
...@@ -26,20 +26,20 @@ ...@@ -26,20 +26,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
int main() int main()
{ {
float a[4][4] = {0, 0.1, 0.3, 0.5, 0.9, 0, 0.7, 0.4, 0.7, 0.3, 0, 0.2, 0.5, 0.6, 0.8, 0}; float a[4][4] = {0, 0.1, 0.3, 0.5, 0.9, 0, 0.7, 0.4, 0.7, 0.3, 0, 0.2, 0.5, 0.6, 0.8, 0};
...@@ -66,7 +66,7 @@ int main() ...@@ -66,7 +66,7 @@ int main()
### A ### A
```c ```cpp
int main() int main()
{ {
int i, j; int i, j;
...@@ -92,7 +92,7 @@ int main() ...@@ -92,7 +92,7 @@ int main()
### B ### B
```c ```cpp
double p[3]; double p[3];
int main() int main()
{ {
...@@ -116,7 +116,7 @@ int main() ...@@ -116,7 +116,7 @@ int main()
### C ### C
```c ```cpp
double rate[4][4] = { double rate[4][4] = {
{0, 0.1, 0.3, 0.5}, {0, 0.1, 0.3, 0.5},
{0.9, 0, 0.7, 0.4}, {0.9, 0, 0.7, 0.4},
......
...@@ -54,20 +54,20 @@ J大臣想知道:他从某一个城市出发,中间不休息,到达另一 ...@@ -54,20 +54,20 @@ J大臣想知道:他从某一个城市出发,中间不休息,到达另一
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
struct edge struct edge
{ {
int to, cost; int to, cost;
...@@ -116,7 +116,7 @@ int main() ...@@ -116,7 +116,7 @@ int main()
### A ### A
```c ```cpp
const int maxd = 10000 + 50; const int maxd = 10000 + 50;
struct Point struct Point
...@@ -166,7 +166,7 @@ int main() ...@@ -166,7 +166,7 @@ int main()
### B ### B
```c ```cpp
#define _for(i, a, b) for (int i = a; i < b; i++) #define _for(i, a, b) for (int i = a; i < b; i++)
#define _unfor(i, a, b) for (int i = a; i >= b; i--) #define _unfor(i, a, b) for (int i = a; i >= b; i--)
#define RI(a) scanf("%d", &a) #define RI(a) scanf("%d", &a)
...@@ -239,7 +239,7 @@ int main() ...@@ -239,7 +239,7 @@ int main()
### C ### C
```c ```cpp
#define mem(a, b) memset(a, b, sizeof(a)) #define mem(a, b) memset(a, b, sizeof(a))
#define ll long long #define ll long long
const double eps = 3e-8; const double eps = 3e-8;
......
...@@ -18,20 +18,20 @@ ...@@ -18,20 +18,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
const int MAXN = 1e7; const int MAXN = 1e7;
int arr[9] = {4, 3, 2, 1, 0, 8, 7, 6, 5}; int arr[9] = {4, 3, 2, 1, 0, 8, 7, 6, 5};
...@@ -120,7 +120,7 @@ int main() ...@@ -120,7 +120,7 @@ int main()
### A ### A
```c ```cpp
string start = "012345678"; string start = "012345678";
string e = "087654321"; string e = "087654321";
int main() int main()
...@@ -165,7 +165,7 @@ int main() ...@@ -165,7 +165,7 @@ int main()
### B ### B
```c ```cpp
struct node struct node
{ {
string str; string str;
...@@ -216,7 +216,7 @@ int main() ...@@ -216,7 +216,7 @@ int main()
### C ### C
```c ```cpp
int dir[] = {1, -1, 2, -2}; int dir[] = {1, -1, 2, -2};
unordered_map<string, int> dist; unordered_map<string, int> dist;
string S = "12345678X", T = "87654321X"; string S = "12345678X", T = "87654321X";
......
...@@ -67,20 +67,20 @@ ...@@ -67,20 +67,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
int main() int main()
{ {
int n = 0; int n = 0;
...@@ -179,7 +179,7 @@ int main() ...@@ -179,7 +179,7 @@ int main()
### A ### A
```c ```cpp
int const N = 10010; int const N = 10010;
using namespace std; using namespace std;
int n, m; int n, m;
...@@ -263,7 +263,7 @@ int main() ...@@ -263,7 +263,7 @@ int main()
### B ### B
```c ```cpp
const int N = 10010; const int N = 10010;
int p[N], d[N]; int p[N], d[N];
int find(int x) int find(int x)
...@@ -312,7 +312,7 @@ int main() ...@@ -312,7 +312,7 @@ int main()
### C ### C
```c ```cpp
const int maxn = 10005; const int maxn = 10005;
int a[maxn][maxn]; int a[maxn][maxn];
int dfs_vis[maxn]; int dfs_vis[maxn];
......
...@@ -40,20 +40,20 @@ ...@@ -40,20 +40,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
long long n, s, a, b; long long n, s, a, b;
long long sum; long long sum;
long long cnt = 0; long long cnt = 0;
...@@ -100,7 +100,7 @@ int main(void) ...@@ -100,7 +100,7 @@ int main(void)
### A ### A
```c ```cpp
#define MAXN 1100 #define MAXN 1100
#define MOD 100000007 #define MOD 100000007
using namespace std; using namespace std;
...@@ -147,7 +147,7 @@ int main() ...@@ -147,7 +147,7 @@ int main()
### B ### B
```c ```cpp
int n, s, a, b; int n, s, a, b;
int num; int num;
...@@ -185,7 +185,7 @@ int main() ...@@ -185,7 +185,7 @@ int main()
### C ### C
```c ```cpp
const int MAXN = 1050; const int MAXN = 1050;
typedef long long ll; typedef long long ll;
......
...@@ -59,7 +59,7 @@ jihgfeeddccbbaa ...@@ -59,7 +59,7 @@ jihgfeeddccbbaa
下面的程序实现了这一功能,请你补全空白处内容: 下面的程序实现了这一功能,请你补全空白处内容:
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
const int maxn = 1e6 + 5; const int maxn = 1e6 + 5;
...@@ -166,19 +166,19 @@ int main() ...@@ -166,19 +166,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
dfs2(pre + len, x - 1, aft - len, rest, res); dfs2(pre + len, x - 1, aft - len, rest, res);
``` ```
...@@ -186,18 +186,18 @@ dfs2(pre + len, x - 1, aft - len, rest, res); ...@@ -186,18 +186,18 @@ dfs2(pre + len, x - 1, aft - len, rest, res);
### A ### A
```c ```cpp
dfs2(pre + len, x, aft - len, rest, res); dfs2(pre + len, x, aft - len, rest, res);
``` ```
### B ### B
```c ```cpp
dfs2(pre + len, x - 1, aft - 1, rest, res); dfs2(pre + len, x - 1, aft - 1, rest, res);
``` ```
### C ### C
```c ```cpp
dfs2(pre + len, x - 1, aft, rest, res); dfs2(pre + len, x - 1, aft, rest, res);
``` ```
...@@ -23,19 +23,19 @@ ...@@ -23,19 +23,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
509 509
``` ```
## 选项 ## 选项
...@@ -43,18 +43,18 @@ ...@@ -43,18 +43,18 @@
### A ### A
```c ```cpp
508 508
``` ```
### B ### B
```c ```cpp
510 510
``` ```
### C ### C
```c ```cpp
600 600
``` ```
...@@ -21,19 +21,19 @@ A + —- + ——–- = 10 ...@@ -21,19 +21,19 @@ A + —- + ——–- = 10
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
29 29
``` ```
## 选项 ## 选项
...@@ -41,18 +41,18 @@ A + —- + ——–- = 10 ...@@ -41,18 +41,18 @@ A + —- + ——–- = 10
### A ### A
```c ```cpp
28 28
``` ```
### B ### B
```c ```cpp
30 30
``` ```
### C ### C
```c ```cpp
31 31
``` ```
...@@ -14,7 +14,7 @@ masks = [9090400, 8499400, 5926800, 8547000, 4958200, 4422600, 5751200, 4175600, ...@@ -14,7 +14,7 @@ masks = [9090400, 8499400, 5926800, 8547000, 4958200, 4422600, 5751200, 4175600,
下面的代码实现了这一功能,请你填补空白处的内容。 下面的代码实现了这一功能,请你填补空白处的内容。
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -50,19 +50,19 @@ int main() ...@@ -50,19 +50,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
dfs(u + 1, s1, s2 + num[u]); dfs(u + 1, s1, s2 + num[u]);
``` ```
## 选项 ## 选项
...@@ -70,18 +70,18 @@ int main() ...@@ -70,18 +70,18 @@ int main()
### A ### A
```c ```cpp
dfs(u, s1, s2 + num[u]); dfs(u, s1, s2 + num[u]);
``` ```
### B ### B
```c ```cpp
dfs(u + 1, s1 + num[u], s2 + num[u]); dfs(u + 1, s1 + num[u], s2 + num[u]);
``` ```
### C ### C
```c ```cpp
dfs(u + 1, s1 + num[u], s2); dfs(u + 1, s1 + num[u], s2);
``` ```
...@@ -30,19 +30,19 @@ ...@@ -30,19 +30,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
768 768
``` ```
...@@ -51,18 +51,18 @@ ...@@ -51,18 +51,18 @@
### A ### A
```c ```cpp
767 767
``` ```
### B ### B
```c ```cpp
769 769
``` ```
### C ### C
```c ```cpp
770 770
``` ```
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
下面的代码实现了这一功能,请你补全空白处。 下面的代码实现了这一功能,请你补全空白处。
```c ```cpp
const int maxn = 100005; const int maxn = 100005;
int numv[maxn]; int numv[maxn];
...@@ -69,19 +69,19 @@ int main() ...@@ -69,19 +69,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
a = (v[idx] * v[idx - 1] + dfs(idx - 2) + numv[idx - 2] * (v[idx] + v[idx - 1])); a = (v[idx] * v[idx - 1] + dfs(idx - 2) + numv[idx - 2] * (v[idx] + v[idx - 1]));
``` ```
## 选项 ## 选项
...@@ -89,18 +89,18 @@ a = (v[idx] * v[idx - 1] + dfs(idx - 2) + numv[idx - 2] * (v[idx] + v[idx - 1])) ...@@ -89,18 +89,18 @@ a = (v[idx] * v[idx - 1] + dfs(idx - 2) + numv[idx - 2] * (v[idx] + v[idx - 1]))
### A ### A
```c ```cpp
a = (v[idx] * v[idx - 1] + dfs(idx - 2)); a = (v[idx] * v[idx - 1] + dfs(idx - 2));
``` ```
### B ### B
```c ```cpp
a = (dfs(idx - 2) + numv[idx - 2] * (v[idx] + v[idx - 1])); a = (dfs(idx - 2) + numv[idx - 2] * (v[idx] + v[idx - 1]));
``` ```
### C ### C
```c ```cpp
a = (v[idx] * v[idx - 1] + dfs(idx - 1) + numv[idx + 2] * (v[idx] + v[idx - 1])); a = (v[idx] * v[idx - 1] + dfs(idx - 1) + numv[idx + 2] * (v[idx] + v[idx - 1]));
``` ```
...@@ -15,20 +15,20 @@ ...@@ -15,20 +15,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
int ans = 0; int ans = 0;
int sum = 0; int sum = 0;
vector<int> a(40, 0); vector<int> a(40, 0);
...@@ -63,7 +63,7 @@ int main() ...@@ -63,7 +63,7 @@ int main()
### A ### A
```c ```cpp
int ans = 0; int ans = 0;
void dfs(int k, int n) void dfs(int k, int n)
{ {
...@@ -88,7 +88,7 @@ int main() ...@@ -88,7 +88,7 @@ int main()
### B ### B
```c ```cpp
int countt = 0; int countt = 0;
void f(int stair, int step) void f(int stair, int step)
...@@ -116,7 +116,7 @@ int main(void) ...@@ -116,7 +116,7 @@ int main(void)
### C ### C
```c ```cpp
#define LEFT 0 #define LEFT 0
#define RIGHT 1 #define RIGHT 1
using namespace std; using namespace std;
......
...@@ -18,19 +18,19 @@ ...@@ -18,19 +18,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
int main() int main()
{ {
int a[15] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 2, 2, 2, 2}; int a[15] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 2, 2, 2, 2};
...@@ -68,7 +68,7 @@ int main() ...@@ -68,7 +68,7 @@ int main()
### A ### A
```c ```cpp
int res = 0; int res = 0;
void f(int dian, int hua, int jiu) void f(int dian, int hua, int jiu)
...@@ -94,7 +94,7 @@ int main(int argc, char **argv) ...@@ -94,7 +94,7 @@ int main(int argc, char **argv)
### B ### B
```c ```cpp
int main() int main()
{ {
int ans = 0; int ans = 0;
...@@ -127,7 +127,7 @@ int main() ...@@ -127,7 +127,7 @@ int main()
### C ### C
```c ```cpp
int cnt; int cnt;
void dfs(int a, int b, int sum, int u, int flag) void dfs(int a, int b, int sum, int u, int flag)
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
下面的程序实现了这一功能,请你补全空白处: 下面的程序实现了这一功能,请你补全空白处:
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
...@@ -123,19 +123,19 @@ int main() ...@@ -123,19 +123,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
dfs(tx, ty, step + 1); dfs(tx, ty, step + 1);
``` ```
...@@ -143,18 +143,18 @@ int main() ...@@ -143,18 +143,18 @@ int main()
### A ### A
```c ```cpp
dfs(tx, ty, step); dfs(tx, ty, step);
``` ```
### B ### B
```c ```cpp
dfs(tx + 1, ty + 1, step + 1); dfs(tx + 1, ty + 1, step + 1);
``` ```
### C ### C
```c ```cpp
dfs(tx - 1, ty - 1, step + 1); dfs(tx - 1, ty - 1, step + 1);
``` ```
...@@ -18,7 +18,7 @@ x星球有很多高耸入云的高塔,刚好可以用来做耐摔测试。塔 ...@@ -18,7 +18,7 @@ x星球有很多高耸入云的高塔,刚好可以用来做耐摔测试。塔
下面的程序实现了这一功能,请你补全空白处的代码: 下面的程序实现了这一功能,请你补全空白处的代码:
```c ```cpp
#include <iostream> #include <iostream>
using namespace std; using namespace std;
int num[5][1010] = {0}; int num[5][1010] = {0};
...@@ -51,19 +51,19 @@ int main() ...@@ -51,19 +51,19 @@ int main()
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
res = min(res, max(dp(k - 1, i - 1), dp(k, n - i)) + 1); res = min(res, max(dp(k - 1, i - 1), dp(k, n - i)) + 1);
``` ```
## 选项 ## 选项
...@@ -71,18 +71,18 @@ res = min(res, max(dp(k - 1, i - 1), dp(k, n - i)) + 1); ...@@ -71,18 +71,18 @@ res = min(res, max(dp(k - 1, i - 1), dp(k, n - i)) + 1);
### A ### A
```c ```cpp
res = min(res, max(dp(k, i - 1), dp(k, n - i)) + 1); res = min(res, max(dp(k, i - 1), dp(k, n - i)) + 1);
``` ```
### B ### B
```c ```cpp
res = min(res, max(dp(k - 1, i), dp(k, n - i)) + 1); res = min(res, max(dp(k - 1, i), dp(k, n - i)) + 1);
``` ```
### C ### C
```c ```cpp
res = min(res, max(dp(k - 1, i - n), dp(k, n - i)) + 1); res = min(res, max(dp(k - 1, i - n), dp(k, n - i)) + 1);
``` ```
...@@ -66,20 +66,20 @@ X 国王有一个地宫宝库,是 n×m 个格子的矩阵,每个格子放一 ...@@ -66,20 +66,20 @@ X 国王有一个地宫宝库,是 n×m 个格子的矩阵,每个格子放一
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
const int N = 55, M = 15, mod = 1e9 + 7; const int N = 55, M = 15, mod = 1e9 + 7;
int w[N][N]; int w[N][N];
...@@ -136,7 +136,7 @@ int main() ...@@ -136,7 +136,7 @@ int main()
### A ### A
```c ```cpp
int n, m, k; int n, m, k;
int data[55][55]; int data[55][55];
typedef long long LL; typedef long long LL;
...@@ -230,7 +230,7 @@ int main() ...@@ -230,7 +230,7 @@ int main()
### B ### B
```c ```cpp
int n, m, k; int n, m, k;
int data[55][55]; int data[55][55];
...@@ -284,7 +284,7 @@ int main() ...@@ -284,7 +284,7 @@ int main()
### C ### C
```c ```cpp
const int N = 55; const int N = 55;
const int MOD = 1e9 + 7; const int MOD = 1e9 + 7;
int dp[N][N][13][14]; int dp[N][N][13][14];
......
...@@ -68,20 +68,20 @@ ...@@ -68,20 +68,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
其他三个都不对 其他三个都不对
``` ```
...@@ -89,7 +89,7 @@ using namespace std; ...@@ -89,7 +89,7 @@ using namespace std;
### A ### A
```c ```cpp
int main() int main()
{ {
vector<int> Hole(5); vector<int> Hole(5);
...@@ -153,7 +153,7 @@ int main() ...@@ -153,7 +153,7 @@ int main()
### B ### B
```c ```cpp
int Solution() int Solution()
{ {
int n, sum = 0, L[5] = {0}, m, M, W[5][10] = {0}, le, P, res = 0; int n, sum = 0, L[5] = {0}, m, M, W[5][10] = {0}, le, P, res = 0;
...@@ -224,7 +224,7 @@ int main() ...@@ -224,7 +224,7 @@ int main()
### C ### C
```c ```cpp
constexpr size_t MAXN = 55, MAXS = 305, MAXM = 1e4 + 5; constexpr size_t MAXN = 55, MAXS = 305, MAXM = 1e4 + 5;
int n[MAXN], cnt[5], Lv[MAXM], p[MAXM], w[MAXM][MAXN]; int n[MAXN], cnt[5], Lv[MAXM], p[MAXM], w[MAXM][MAXN];
int dp[MAXM][MAXS]; int dp[MAXM][MAXS];
......
...@@ -43,20 +43,20 @@ ...@@ -43,20 +43,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
#define ll long long #define ll long long
using namespace std; using namespace std;
...@@ -111,7 +111,7 @@ int main() ...@@ -111,7 +111,7 @@ int main()
### A ### A
```c ```cpp
#define FOR0(a, b) for (int i = a; i < b; ++i) #define FOR0(a, b) for (int i = a; i < b; ++i)
#define FORE(a, b) for (int i = a; i <= b; ++i) #define FORE(a, b) for (int i = a; i <= b; ++i)
typedef long long ll; typedef long long ll;
...@@ -153,7 +153,7 @@ int main() ...@@ -153,7 +153,7 @@ int main()
### B ### B
```c ```cpp
int n, k, ans = 0; int n, k, ans = 0;
int temp[3], num[100005], vis[100005] = {0}; int temp[3], num[100005], vis[100005] = {0};
...@@ -194,7 +194,7 @@ int main() ...@@ -194,7 +194,7 @@ int main()
### C ### C
```c ```cpp
int N, k; int N, k;
int main() int main()
{ {
......
...@@ -76,19 +76,19 @@ ...@@ -76,19 +76,19 @@
### before ### before
```c ```cpp
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
其他三项都是错的 其他三项都是错的
``` ```
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
### A ### A
```c ```cpp
const int Mod = 1e9 + 7; const int Mod = 1e9 + 7;
int c[2010][2010]; int c[2010][2010];
int main() int main()
...@@ -128,7 +128,7 @@ int main() ...@@ -128,7 +128,7 @@ int main()
### B ### B
```c ```cpp
#define modk(x) (((x) >= k) ? ((x)-k) : (x)) #define modk(x) (((x) >= k) ? ((x)-k) : (x))
const int maxn = 2005; const int maxn = 2005;
int c[maxn][maxn], n, m, k, T; int c[maxn][maxn], n, m, k, T;
...@@ -181,7 +181,7 @@ int main() ...@@ -181,7 +181,7 @@ int main()
### C ### C
```c ```cpp
const int Mod = 1e9 + 7; const int Mod = 1e9 + 7;
const int inv_2 = 5e8 + 4; const int inv_2 = 5e8 + 4;
......
...@@ -45,20 +45,20 @@ ...@@ -45,20 +45,20 @@
### before ### before
```c ```cpp
#include <bits/stdc++.h> #include <bits/stdc++.h>
using namespace std; using namespace std;
``` ```
### after ### after
```c ```cpp
``` ```
## 答案 ## 答案
```c ```cpp
const int N = 105, M = (1 << 20) + 10; const int N = 105, M = (1 << 20) + 10;
int n, m, k, x, a[N], dp[M]; int n, m, k, x, a[N], dp[M];
...@@ -104,7 +104,7 @@ int main() ...@@ -104,7 +104,7 @@ int main()
### A ### A
```c ```cpp
int n, m, k; int n, m, k;
int dp[1 << 20]; int dp[1 << 20];
vector<int> a; vector<int> a;
...@@ -149,7 +149,7 @@ int main() ...@@ -149,7 +149,7 @@ int main()
### B ### B
```c ```cpp
const int maxn = (1 << 20) + 52; const int maxn = (1 << 20) + 52;
const int inf = 9; const int inf = 9;
int a[505], n, m, k, dp[2][maxn]; int a[505], n, m, k, dp[2][maxn];
...@@ -204,7 +204,7 @@ int main() ...@@ -204,7 +204,7 @@ int main()
### C ### C
```c ```cpp
int dp[1 << 20]; int dp[1 << 20];
int ST[100]; int ST[100];
int main() int main()
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册