[CSP-S 2022 T1] 假期计划 #include <cstdio> #include <vector> #include <queue> #include <algorithm> using namespace std; typedef long long LL; const int N = 2505; vector<int> G[N]; int dis[N], top3[N][3]; bool vis[N], ok[N][N]; LL s[N]; int main() { int n, ...
intb[maxn][3]; voidbfs(ints){ for(inti =1;i <= n;i++)d[s][i] =-1; queue<int> que; que.push(s);d[s][s] =0; while(!que.empty()){ intu = que.front(); que.pop(); if(d[s][u] == k)continue
本题主要是贪心思想和双端队列的使用,如果不熟悉STL中的双端队列,也可以手动模拟。关键是对问题的转化,难度上来说,我认为与T1相当。
2. 新赛道-2024年CSP-J/S 十一连测(四)-T1(99) 3. P9750 [CSP-J 2023] 一元二次方程题目总结(99) 4. A Way to Practice Competitive Programming(一种程序设计竞赛的训练方 译日:永田正彦)(95) 5. 新赛道-2024.8 CSP-J组月赛-T4(94) Copyright...