摘要: 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 阅读(119) 评论(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 阅读(45) 评论(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 阅读(60) 评论(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 阅读(60) 评论(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 阅读(48) 评论(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 阅读(72) 评论(0) 推荐(0)
摘要: A. Remove Duplicates 题意大概就是从左到右数字最先数完的最先输出 所以我们可以在输入每个数时记录每个数的出现次数,然后在循环一遍,每次该数字的次数减1,当数字的次数只剩1的时候就输出这个数字. #include <bits/stdc++.h> //#define inf 0x3f 阅读全文
posted @ 2023-05-04 21:56 Ke_scholar 阅读(38) 评论(0) 推荐(0)
摘要: A. Wrong Subtraction 在k次操作里, 将n的最后一位数减1,如果是0就去掉,模拟一下就好了. #include <bits/stdc++.h> //#define inf 0x3f3f3f3f #define endl '\n' #define int long long usi 阅读全文
posted @ 2023-04-26 00:38 Ke_scholar 阅读(42) 评论(0) 推荐(0)
摘要: 题目详情 - L1-1 人与神 (pintia.cn) 换成php直接输出( To iterate is human, to recurse divine. 题目详情 - L1-2 两小时学完C语言 (pintia.cn) void solve() { cin >> n >> k >> m; cou 阅读全文
posted @ 2023-04-16 16:49 Ke_scholar 阅读(51) 评论(0) 推荐(0)
摘要: 题目详情 - L1-1 今天我要赢 (pintia.cn) void solve() { cout << "I'm gonna win! Today!" << endl; cout << "2022-04-23" << endl; } 题目详情 - L1-2 种钻石 (pintia.cn) void 阅读全文
posted @ 2023-04-11 23:24 Ke_scholar 阅读(55) 评论(0) 推荐(0)