5月4日这天,是LYJ迎来LHY考试的一天
从8:10——11:10,共三个小时
首先,看了看T1,觉得是一个思维题,果断只写了个10分的代码便直接跳过。
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
#define int long long
int T, n, a[N];
bool flag = 1, vis[N];
signed main() {
cin >> T;
while(T--) {
scanf("%lld", &n);
for (int i = 1;i <= n;i++) {
scanf("%lld", &a[i]);
}
if (n <= 3) {
printf("%lld\n", *max_element(a + 1, a + n + 1));
continue;
}
cout << 2 * n * a[1] - 5 * a[1] << endl;
}
return 0;
}```
接着,开始看T2,发觉这个是一个垃圾题目,便A了
```cpp
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
#define int long long
int n, q, a[N], x, cnt[N], zhi[N];
int fh1(int y) {
while(!(y & 1)) {
y >>= 1;
}
return y;
}
signed main() {
scanf("%lld", &n);
for (int i = 1;i <= n;i++) {
scanf("%lld", &a[i]);
if (a[i] % 2 == 1) {
cnt[i] = cnt[i - 1] + 1;
zhi[i] = a[i];
} else {
cnt[i] =

最低0.47元/天 解锁文章
428

被折叠的 条评论
为什么被折叠?



