摘要: A. Programming Contest 签到题. 输入输出读完应该就懂了: 从y1枚举到y2,若枚举的年份不在停办年份里则答案加一 void solve() { int n,m; cin >> n; vector<int> a(N),year(N); cin >> m; for(int i = 阅读全文
posted @ 2023-06-26 17:28 Ke_scholar 阅读(19) 评论(0) 推荐(0)
摘要: E. Expenditure Reduction 从左右往右找到包含B字符的最近位置,然后从这个位置有从右到左找回去找到包含完所有B字符的位置,这个区间就是答案 #include <bits/stdc++.h> #define inf 0x3f3f3f3f #define endl '\n' #de 阅读全文
posted @ 2023-06-24 17:22 Ke_scholar 阅读(14) 评论(0) 推荐(0)
摘要: 题目链接 Problem A. Drill Wood to Make Fire S * V >= n即可 #include<bits/stdc++.h> #define int long long #define endl '\n' using namespace std; const int N 阅读全文
posted @ 2023-06-01 23:06 Ke_scholar 阅读(43) 评论(0) 推荐(0)
摘要: A. Antiamuny wants to learn binary search 签到题. #include <map> #include <set> #include <cmath> #include <queue> #include <stack> #include <cstdio> #inc 阅读全文
posted @ 2023-06-01 22:03 Ke_scholar 阅读(87) 评论(0) 推荐(0)
摘要: A. The Text Splitting 题意:给出字符串长度,给出p和q两种切割方式,任选其中一种,把字符串分割输出结果。 题解:先进行判断,p和q是否能整个的分割n,利用p和q的函数关系判断(见代码),再计算有几个p几个q,再进行输出即可 void solve() { cin >> n >> 阅读全文
posted @ 2023-06-01 18:12 Ke_scholar 阅读(16) 评论(0) 推荐(0)
摘要: Problem A. 签到啦 从大到小排序,累加大于行李w时输出下标即可 int ans; void solve() { cin >> n >> m; int ans = 0; vector<int> a(n); for(int i = 0;i < n;i ++){ cin >> a[i]; } s 阅读全文
posted @ 2023-05-14 13:32 Ke_scholar 阅读(44) 评论(0) 推荐(0)
摘要: 前言 更详细题解可以参考咱学长的( 2023 SMU RoboCom-CAIP 选拔赛.zip A. 小斧头 f_k 表示满足条件的j = k 的(i,j)对的数量.如上图中第四行即为f1至f5的元素,f1 = 1即有(1,1)满足条件,f2 = 2即有(1,2),(2,2)满足条件,后面同理,然后 阅读全文
posted @ 2023-05-14 13:06 Ke_scholar 阅读(30) 评论(0) 推荐(0)
摘要: M. Different Billing #include <map> #include <set> #include <cmath> #include <queue> #include <cstdio> #include <vector> #include <climits> #include < 阅读全文
posted @ 2023-05-14 12:49 Ke_scholar 阅读(18) 评论(0) 推荐(0)
摘要: B. Contest Preparation 对n<=m和n==0时特判一下 #include <iostream> #include <cstdio> #include <algorithm> #include <string> #include <cstring> #include <vecto 阅读全文
posted @ 2023-05-14 12:47 Ke_scholar 阅读(36) 评论(0) 推荐(0)
摘要: A. Remove Duplicates 题意大概就是从左到右数字最先数完的最先输出 所以我们可以在输入每个数时记录每个数的出现次数,然后在循环一遍,每次该数字的次数减1,当数字的次数只剩1的时候就输出这个数字. #include <bits/stdc++.h> //#define inf 0x3f 阅读全文
posted @ 2023-05-04 21:56 Ke_scholar 阅读(13) 评论(0) 推荐(0)