知乎評價:如何評價2025年第八屆GXCPC廣西大學生程序設計大賽暨中國-東盟國際大學生程序設計大賽?
榜單:牛客比賽排名
題目鏈接:第八屆廣西大學生程序設計大賽暨2025邀請賽
TIP:提交處可查看別人過題代碼
難度 | 簽到題 | 普通題 | 中等題 | 難題 |
---|---|---|---|---|
題號 | A D H | B | E G J K L | C F I |
情況 | ? | ? | - | - |
全部資料:一至八屆 GXCPC廣西大學生程序設計競賽 題目與題解
文章目錄
- 簽到題
- A. Additive Combinatorics
- 題目大意:
- 解題思路:
- 參考代碼c++:
- D. DeepSeek, DeepThink!
- 題目大意:
- 解題思路:
- 參考代碼c++:
- H. Hollow Knight: Silksong
- 題目大意:
- 解題思路:
- 參考代碼c++:
- 普通題
- B. Beats
- 題目大意:
- 解題思路:
- 參考代碼c++:
簽到題
A. Additive Combinatorics
A. Additive Combinatorics
加性組合
題目大意:
判斷 C 是否是 A 和 B 的和集
解題思路:
官方題解PPT還沒看到
博主補充:
雙重循環,計算每一對元素的和,將和存入集合(集合會自動排序和去重)
參考代碼c++:
#include<bits/stdc++.h>
using namespace std;int main() {int n1, n2, n3, x;cin >> n1 >> n2 >> n3;vector<int> a(n1), b(n2);for (int &x : a) cin >> x;for (int &x : b) cin >> x;set<int> c;while (n3--) cin >> x, c.insert(x);set<int> temp;for (int i : a) for (int j : b) temp.insert(i + j);cout << (temp == c ? "YES" : "NO");
}
D. DeepSeek, DeepThink!
D. DeepSeek, DeepThink!
深度求索,深度思考!
題目大意:
修改輸入的值(開頭首字母改小寫,末尾?改.),前面拼接一段值,最后輸出
解題思路:
官方題解PPT還沒看到
博主補充:
沒啥好說的,字符串處理方式多種多樣
參考代碼c++:
#include<bits/stdc++.h>
using namespace std;int main() {string s;getline(cin, s);s.front() = tolower(s.front());s.back() = '.';cout << "Okay, so I want to figure out " << s;
}
H. Hollow Knight: Silksong
H. Hollow Knight: Silksong
空洞騎士:絲之歌
題目大意:
其實就是,計算還有多少天發布游戲
解題思路:
官方題解PPT還沒看到
博主補充:
想簡化代碼有很多種方式,閏年計算可以簡化,
參考代碼c++:
#include <iostream>
using namespace std;bool is_leap(int year) {return (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0);
}int main() {int y, m, d;cin >> y >> m >> d;const int end_days = 261; // 2025-09-18是當年的第261天int total = 0;// 計算起始日期在當年的天數int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};if (is_leap(y)) days[2] = 29;int start = d;for (int i = 1; i < m; ++i) start += days[i];if (y == 2025) {total = end_days - start;} else {total = (is_leap(y) ? 366 : 365) - start; // 剩余天數for (int yr = y + 1; yr < 2025; ++yr) { // 中間年份total += is_leap(yr) ? 366 : 365;}total += end_days; // 加上2025年的天數}cout << total << endl;return 0;
}
普通題
B. Beats
B. Beats
節拍
題目大意:
每個節拍開始的瞬間,不能有某個音符正在播放但還沒有結束
解題思路:
官方題解PPT還沒看到
博主補充:
記錄前綴和,然后循環里判斷(前綴和的寫法可以優化)
參考代碼c++:
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n,a[200010],s[200010];
map<int,bool>m;
signed main(){cin>>n;for(int i=1;i<=n;i++)cin>>a[i],s[i]=s[i-1]+a[i],m[s[i]]=1;for(int i=1;i<=n;i++){int k=s[i];for(int j=2;;j++){if(k*j>=s[n]){cout<<k;return 0;}if(!m.count(k*j))break;}}
}