摘要:
#include<bits/stdc++.h> using namespace std; int main() { int a,b,maxx = 0,ans; //maxx是最大上课时间,ans是最不开心的一天 for(int i = 1; i <= 7; i++) { cin >> a >> b; 阅读全文
摘要:
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5+10,inf = 0x3f3f3f3f; struct node{ int t,p,f; }; node a[N]; int n, 阅读全文
摘要:
解决思路 广度优先搜索 (BFS):使用 BFS 从起点 x 开始搜索,找到到达终点 y 的最短路径。 队列:使用队列存储当前节点和步数。 访问标记:使用数组 vis 标记节点是否被访问过,防止重复访问。 #include<bits/stdc++.h> #define ll long long us 阅读全文
摘要:
解决思路 读取输入:读取数组和查询数。 二分查找:对每个查询数进行二分查找,找到其在数组中第一次出现的位置。 输出结果:输出每个查询数在数组中第一次出现的位置。 #include <bits/stdc++.h> #define ll long long using namespace std; co 阅读全文