跳到正文

个人记录

模拟赛总结(2026-7-14)

_ideal_freedom_pop_约 5 分钟
原文

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

文章信息与版本

文章信息

发布
2026年7月14日
收录
2026年7月15日
更新
2026年11月17日
篇幅
约 5 分钟

版本

  1. v2当前
  2. v1

一、比赛基本情况

  • 比赛日期:2026-7-14
  • 比赛时长:3个小时
  • 比赛得分:0
  • 比赛排名:28

二、比赛整体回顾

先做了比较简单的第二和第三题,然后没做出来第一和第四题。但最后没一道题 ACAC 因为 freopenfreopen 里面的内容写错了

三、题目复盘

T1:Bakery S

  • 本题得分:0
  • 开始时间:8:40
  • 结束时间:9:00
  • 总用时:20分钟

刚看到题目时就感觉很乱,最后没思路,没写

补题代码

C++

复杂度:

  • 时间复杂度:
  • 空间复杂度:

本题总结: 记录本题出现的问题、值得保留的做法以及赛后的主要收获。

T2:Shell Game B

  • 本题得分:0
  • 开始时间:9:00
  • 结束时间:9:35
  • 总用时:35分钟
  • 初始思路: 由于这道题不会超时,就直接用枚举。一共只有3个坚果壳,就统计鹅卵石在每个坚果壳能出现的次数(1,2,3,开始依次枚举),最后找出最大值。

考场解题过程:

考场代码:

C++
#include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
const int N=1e5+5;
int n,a[N],b[N],g[N],vis[N],sum;
int dfs(int x){
    memset(vis,0,sizeof vis);
    vis[x]=1;
    sum=0;
    for(int i=1;i<=n;i++){
        swap(vis[a[i]],vis[b[i]]);
        if(vis[g[i]]==1){
            sum++;
        }
    }
    return sum;
}
signed main(){
    //freopen("r","shell.in",stdin);
    //freopen("w","shell.out",stdout);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i]>>b[i]>>g[i];
    }
    cout<<max(max(dfs(1),dfs(2)),dfs(3));
    return 0;
}

(freopen写错了,所以考试的时候是0分。后面补题时这个代码是满分)

复杂度:

  • 时间复杂度:O(n)
  • 空间复杂度:O(n)

本题总结: 这道题想清楚思路,代码写起来就不难

T3:Guess the Animals

  • 本题得分:0
  • 开始时间:9:35
  • 结束时间:9:45
  • 总用时:10分钟
  • 初始思路: 用个桶记录每个动物的特点出现的次数,最后再统计每个动物特点出现的重复数,看哪个最多就输出哪个,然后再加个1

考场解题过程:

考场代码:

C++
#include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
const int N=1e5+5;
int n,a[N],sum=INT_MIN;
map<string,int>mp;
signed main(){
    cin>>n;
    for(int i=1;i<=n;i++){
        string s;
        int m;
        cin>>s>>m;
        for(int j=1;j<=m;j++){
            string x;
            cin>>x;
            mp[x]++;
            sum=max(sum,mp[x]);
        }
    }
    cout<<sum;
    return 0;
}

补题代码:

C++
#include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
const int N=1e2+5;
int n,b[N],maxx=INT_MIN;
string a[N][N];
signed main(){
    cin>>n;
    for(int i=1;i<=n;i++){
        string s;
        cin>>s>>b[i];
        for(int j=1;j<=b[i];j++){
            cin>>a[i][j];
        }
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            int sum=0;
            if(i!=j){
                for(int k=1;k<=b[i];k++){
                    for(int l=1;l<=b[j];l++){
                        if(a[i][k]==a[j][l]){
                            sum++;
                        }
                    }
                }
                maxx=max(maxx,sum);
            }
        }
    }
    cout<<maxx+1;
    return 0;
}

赛后题解 复杂度

  • 时间复杂度:O(n)
  • 空间复杂度:O(n)

本题总结: 这道题不止只要记录一个最大值,要多个,考试的时候只用了一个

T4:Pogo-Cow S 加强版

  • 本题得分:
  • 开始时间:
  • 结束时间:
  • 总用时: 初始思路 考场解题过程 考场代码 // 在此粘贴考场代码 赛后题解 补题代码 // 在此粘贴考场代码 复杂度 时间复杂度: 本题总结 四、整体反思 做得较好的地方 需要改进的地方 时间安排总结