跳到正文

个人记录

2026.7.18 总结(未完成)

SEF_711约 12 分钟
原文

这是 2026年7月18日 存档的第 1 版,不是当前版本。查看当前版本

文章信息与版本

文章信息

发布
2026年7月18日
收录
2026年7月18日
更新
2026年11月10日
篇幅
约 12 分钟

版本

  1. v4当前
  2. v3
  3. v2
  4. v1

测试基本情况

  • 比赛日期:2026.7.182026.7.18
  • 比赛时长:8:308:30 到 11:3011:30 ,共计 33 个小时
  • 比赛得分:297297
  • 比赛排名:55

测试基本回顾

写题顺序

C→D→B→AC \to D \to B \to A

时间安排
  • AA:148min\texttt{148min}
  • BB:7min\texttt{7min}
  • CC:5min\texttt{5min},但是在做题时出了很多错误,于是浪费我 33min\texttt{33min}!!!
  • DD:20min\texttt{20min}

虽然但是有点离谱

整体状态

挺好的,虽然说我在读 AA 题的时候有 1.41.4 了,但后面 33 题十分简单,直接得吃。

题目复盘

A: droughtdrought

初始思路

本来想着打暴力,结果发现有点难写(?,就骗了分。 。 。

解题过程

读题 →\to 试打暴力 →\to 骗分

考场代码

C++
#include <bits/stdc++.h>
#define int long long
using namespace std;


signed main() {
    freopen("drought.in", "r", stdin);
    freopen("drought.out", "w", stdout);
    int t;
    cout << "14\n16\n-1\n-1\n-1";
    return 0;
}

赛后题解

补题代码

C++

复杂度

本题总结!

B:dicedice

初始思路

这题就读题有点困难,但理解之后十分简单。

我想着每个骰子都只有 44 个面,就枚举构造,然后检查是否合法即可。

解题过程

读题 →\to 打代码

考场代码

C++
#include <bits/stdc++.h>
#define int long long
using namespace std;

const int kN = 5;
int a[kN], b[kN], s[kN];
bool query(int x[], int y[]) {
    int cnt1 = 0, cnt2 = 0;
    for (int i = 1; i <= 4; i++)
        for (int j = 1; j <= 4; j++)
            if (x[i] > y[j])
                cnt1++;
            else if (y[j] > x[i])
                cnt2++;
    return cnt1 > cnt2;
}
void work() {
    for (int i = 1; i <= 4; i++)
        cin >> a[i];
    for (int i = 1; i <= 4; i++)
        cin >> b[i];
    bool flag = 0;
    for (int i = 1; i <= 10; i++)
        for (int j = 1; j <= 10; j++)
            for (int k = 1; k <= 10; k++) {
                if (flag == 1) break;
                for (int o = 1; o <= 10; o++) {
                    if (flag == 1) break;
                    s[1] = i, s[2] = j, s[3] = k, s[4] = o;
                    int cnta = query(a, b) + query(a, s);
                    int cntb = query(b, a) + query(b, s);
                    int cntc = query(s, a) + query(s, b);
                    if (cnta == 1 && cntb == 1 && cntc == 1) {
                        flag = 1;
                    }
                }
            }
    if (flag == 1) cout << "yes\n";
    else cout << "no\n";
}
signed main() {
    freopen("dice.in", "r", stdin);
    freopen("dice.out", "w", stdout);
    int t;
    cin >> t;
    while (t--)
        work();
    return 0;
}

赛后题解

没有一点问题,见↑

补题代码

见上↑

复杂度

O(N2VN)O(N^2 V^N)

本题总结

这道题十分简单,只要你搞清楚题意就行。

C:herdleherdle

初始思路

先分别统计猜测矩阵和答案每个字母的个数,绿色高亮肯定就是判断是不是,黄色的话就是在两个矩阵的公共数量。

解题过程

读题 →\to 写代码 →\to 查错

考场代码

C++
#include <bits/stdc++.h>
#define int long long
using namespace std;

const int kN = 5;
int ans1, ans2;
char a[kN][kN], b[kN][kN];
map<char, int> vis1, vis2;
signed main() {
    freopen("herdle.in", "r", stdin);
    freopen("herdle.out", "w", stdout);
    for (int i = 1; i <= 3; i++)
        for (int j = 1; j <= 3; j++) {
            cin >> a[i][j];
            vis1[a[i][j]]++;
        }
    for (int i = 1; i <= 3; i++)
        for (int j = 1; j <= 3; j++) {
            cin >> b[i][j];
            if (a[i][j] == b[i][j]) {
                ans1++;
                vis1[a[i][j]]--;
                vis2[a[i][j]]--;
            }
            vis2[b[i][j]]++;
        }
    for (char i = 'A'; i <= 'Z'; i++)
        ans2 += min(vis1[i], vis2[i]);
    cout << ans1 << "\n" << ans2;
    return 0;
}

赛后题解

完全没有问题,见上↑

补题代码

见上↑

复杂度

O(N+M)O(N + M)

本题总结

提升了我的调试能力。

D:fpotfpot

初始思路

这个时间差,说白了就是yy坐标的差值。
然后我们要找最大值和最小值,用单调队列维护。

那怎么找花盆的宽度?
首先,暴力想都不用想,直接pass掉!
然后我想,是不是花盆越大越满足需求?那就不用说了,二分即可。

解题过程

读题 →\to 思考正解 →\to 写代码

初始代码

C++
#include <bits/stdc++.h>
#define int long long
using namespace std;

const int kN = 1e5 + 5;
int n, d;
struct node {
    int x, y;
} a[kN];
bool cmp(const node &x, const node &y) {
    return x.x < y.x;
}
bool check(int x) {
    deque<int> q, q2;
    for (int i = 1; i <= n; i++) {
        while (q.empty() == 0 && a[i].y > a[q.back()].y)
            q.pop_back();
        q.push_back(i);
        while (a[i].x - a[q.front()].x > x)
            q.pop_front();
        while (q2.empty() == 0 && a[i].y < a[q2.back()].y)
            q2.pop_back();
        q2.push_back(i);
        while (a[i].x - a[q2.front()].x > x)
            q2.pop_front();
        if (a[q.front()].y - a[q2.front()].y >= d)
            return 1;
    }
    return 0;
}
signed main() {
    freopen("fpot.in", "r", stdin);
    freopen("fpot.out", "w", stdout);
    cin >> n >> d;
    for (int i = 1; i <= n; i++)
        cin >> a[i].x >> a[i].y;
    sort(a + 1, a + 1 + n, cmp);
    int l = 0, r = 1e6 + 1;
    while (l + 1 < r) {
        int mid = (l + r) / 2;
        if (check(mid) == 1) r = mid;
        else l = mid;
    }
    cout << r;
    return 0;
} 

赛后题解

其实就跟我上面差不多,而我忘了一个东西——判-1!!!。

我无疑是非常的“高兴”好吧。话说怎么只有一个点是-1?

当然,这题也可以用ST表。

补题代码

C++
#include <bits/stdc++.h>
#define int long long
using namespace std;

const int kN = 1e5 + 5;
int n, d;
struct node {
    int x, y;
} a[kN];
bool cmp(const node &x, const node &y) {
    return x.x < y.x;
}
bool check(int x) {
    deque<int> q, q2;
    for (int i = 1; i <= n; i++) {
        while (q.empty() == 0 && a[i].y > a[q.back()].y)
            q.pop_back();
        q.push_back(i);
        while (a[i].x - a[q.front()].x > x)
            q.pop_front();
        while (q2.empty() == 0 && a[i].y < a[q2.back()].y)
            q2.pop_back();
        q2.push_back(i);
        while (a[i].x - a[q2.front()].x > x)
            q2.pop_front();
        if (a[q.front()].y - a[q2.front()].y >= d)
            return 1;
    }
    return 0;
}
signed main() {
    freopen("fpot.in", "r", stdin);
    freopen("fpot.out", "w", stdout);
    cin >> n >> d;
    for (int i = 1; i <= n; i++)
        cin >> a[i].x >> a[i].y;
    sort(a + 1, a + 1 + n, cmp);
    int l = 0, r = 1e6 + 1;
    while (l + 1 < r) {
        int mid = (l + r) / 2;
        if (check(mid) == 1) r = mid;
        else l = mid;
    }
    if (l == 1e6) cout << -1;
    else cout << r;
    return 0;
} 
复杂度

O(Nlog⁡2V)O(N \log_2 V)

本题总结

让我知道了读题很重要。 。 。

整体反思

做的较好的地方

基本后面 33 道题都做出来了。

需要改进的地方

我检查的不够到位。(摔键盘)

时间安排总结

其实挺好的,虽然有点“偏心”(?