今天六点起的,好困,F没写,想睡觉,醒了一定补

A

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
#include<bits/stdc++.h>
using namespace std;
#define int long long
int read()
{
int x = 0, f = 1;
char ch = getchar();
while(ch < '0' || ch > '9')
{
if(ch == '-') f = -1;
ch = getchar();
}
while(ch >= '0' && ch <= '9')
{
x = x * 10 + ch - '0';
ch = getchar();
}
return x * f;
}


signed main()
{
int r = read();
cout << 3 * r * r << endl;
return 0;
}

B

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
#include<bits/stdc++.h>
using namespace std;
#define int long long
int read()
{
int x = 0, f = 1;
char ch = getchar();
while(ch < '0' || ch > '9')
{
if(ch == '-') f = -1;
ch = getchar();
}
while(ch >= '0' && ch <= '9')
{
x = x * 10 + ch - '0';
ch = getchar();
}
return x * f;
}


signed main()
{
int n = read(), d = read();
int res = (n / (2 * d + 1));
if(n > res * (2 * d + 1)) res++;
cout << res << endl;
return 0;
}

C

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
#include<bits/stdc++.h>
using namespace std;
#define int long long
int read()
{
int x = 0, f = 1;
char ch = getchar();
while(ch < '0' || ch > '9')
{
if(ch == '-') f = -1;
ch = getchar();
}
while(ch >= '0' && ch <= '9')
{
x = x * 10 + ch - '0';
ch = getchar();
}
return x * f;
}


signed main()
{
int n = read();
vector<pair<int, int>> a(n);
for(int i = 0; i < n; i++)
{
int x = read();
a[i] = {x, i};
}
sort(a.begin(), a.end());
for(int i = 0; i < n; i++)
{
if(i == a[n - 1].second)
cout << a[n - 2].first << endl;
else cout << a[n - 1].first << endl;
}
return 0;
}

D

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
#include<bits/stdc++.h>
using namespace std;
#define int long long
int read()
{
int x = 0, f = 1;
char ch = getchar();
while(ch < '0' || ch > '9')
{
if(ch == '-') f = -1;
ch = getchar();
}
while(ch >= '0' && ch <= '9')
{
x = x * 10 + ch - '0';
ch = getchar();
}
return x * f;
}


signed main()
{
int n = read(), k = 1;
vector<int> a(n + 1), b(n + 1), ans(n + 1);
for(int i = 1; i <= n; i++) a[i] = read();
for(int i = n; i >= 1; i--)
{
bool f = false;
for(int j = i << 1; j <= n; j += i)
{
if(b[j])
{
f = !f;
}
}
if(f ^ a[i])
{
b[i] = 1;
ans[k++] = i;
}
}
cout << k - 1 << endl;
for(int i = k - 1; i >= 1; i--)
{
cout << ans[i] << ' ';
}
return 0;
}

E

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
#include<bits/stdc++.h>
using namespace std;
#define int long long
int read()
{
int x = 0, f = 1;
char ch = getchar();
while(ch < '0' || ch > '9')
{
if(ch == '-') f = -1;
ch = getchar();
}
while(ch >= '0' && ch <= '9')
{
x = x * 10 + ch - '0';
ch = getchar();
}
return x * f;
}

const int N = 1e5 + 10;

int a[N];

signed main()
{
int n = read();
int res = 0;
for(int i = 1; i <= n; i++)
{
int x = read();
auto k = upper_bound(a + 1, a + res + 1, x, greater<int>()) - a;
if(k > res) a[++res] = x;
else a[k] = x;
}
cout << res << endl;
return 0;
}