Loading

随笔分类 -  刷题笔记----------

上一页 1 2 3 4 5 6 7 8 ··· 25 下一页
摘要:比赛链接:Here 1001 - Mod, Or and Everything 签到, 打表发现与 2的次方相关联 int main() { cin.tie(nullptr)->sync_with_stdio(false); int _; for (cin >> _; _--;) { ll n; c 阅读全文
posted @ 2021-07-21 16:44 RioTian 阅读(428) 评论(2) 推荐(0)
摘要:比赛链接:Here A - Arithmetic Sequence (good) 注意细节 int main() { cin.tie(nullptr)->sync_with_stdio(false); ll a, b, c; cin >> a >> b >> c; ll x = 2 * b - a 阅读全文
posted @ 2021-07-20 16:47 RioTian 阅读(155) 评论(1) 推荐(0)
摘要:比赛链接:Here A - Cabbages 略 B - Bouzu Mekuri 略 C - Colorful Candies 用map维护连续一段区间的不同元素即可。 int main() { cin.tie(nullptr)->sync_with_stdio(false); int n, k; 阅读全文
posted @ 2021-07-20 16:01 RioTian 阅读(308) 评论(0) 推荐(0)
摘要:比赛链接:Here 1530A. Binary Decimal 现在规定一种只由0和1组成的数字,我们称这种数字为二进制数字,例如10,1010111,给定一个数n,求该数字最少由多少个二进制数字组成. 水题, 每取一个二进制数字,可以使得原数字n上各位都减小1或者0,为了使次数尽可能地小,那么当原 阅读全文
posted @ 2021-07-20 14:10 RioTian 阅读(112) 评论(0) 推荐(0)
摘要:比赛链接:Here 1546A - AquaMoon and Two Arrays 选定两个数组元素执行以下操作: \(a_i,a_j (1\le i,j \le n)\) 一个 +1 另一个 -1, 前提是两个数都要结果非负 请问在执行若干次后使得数组 \(a\) 等于 数组 \(b\) 先统计两 阅读全文
posted @ 2021-07-12 15:59 RioTian 阅读(103) 评论(0) 推荐(1)
摘要:比赛链接:Here 1547A. Shortest Path with Obstacle 3个点 \(A,B,F\) ,前提 \(F\) 点为不可经过点,问 \(A\to B\) 最短路径长度 A题没什么难度,注意同列和同行在两者之间的情况即可 【AC Code】 int main() { cin. 阅读全文
posted @ 2021-07-11 15:46 RioTian 阅读(152) 评论(0) 推荐(0)
摘要:比赛链接:Here 1543A. Exciting Bets math, 给定两个数字 \(a,b (a,b \le 1e18)\) 和以下两种操作: \(a + 1,b+1\) \(a-1,b-1\ if\ a > 0\) 并且 $ b > 0$ 请问经过最少多少次操作能使得 \(GCD(a,b) 阅读全文
posted @ 2021-07-08 16:17 RioTian 阅读(173) 评论(0) 推荐(0)
摘要:比赛链接:Here 1539A. Contest Start 让我们找出哪些参与者会干扰参与者i。这些是数字在 \(i+1\) 和 $i+min(t/x,n)$之间的参与者。所以第一个最大值 \((0,n−t/x)\) 参与者将获得 \(t/x\) 不满意,下一个参与者将比上一个参与者少获得 \(1 阅读全文
posted @ 2021-07-07 20:35 RioTian 阅读(84) 评论(0) 推荐(0)
摘要:比赛链接:Here 1541A. Pretty Permutations 给定 \(1,2,3,4,...n\) 序列,让每一个数字都不处于原来的位置,但总的移动距离要最小 \(n\) 为偶数的情况 \(1,2,3,4 \to 2,1,4,3\) \(n\) 为奇数的情况 \(1,2,3,4,5 \ 阅读全文
posted @ 2021-07-07 19:40 RioTian 阅读(106) 评论(2) 推荐(1)
摘要:比赛链接:Here AB水题,跳过 C - Swappable 在数组中找到满足条件的数对 \((i,j)\) \(1 \le i < j \le N (N\in[2,3e5])\) \(A_i \not= A_j\) 一道经典利用 map 减少搜索规模的题, 先假设每个数互不相同:ans = n 阅读全文
posted @ 2021-07-06 23:43 RioTian 阅读(447) 评论(1) 推荐(0)
摘要:比赛链接:Here A - Rolling Dice 水题 一个六面的骰子,请问摇动 \(A\) 次最后的点数和能否为 \(B\) 如果 \(B \in [a,6a]\) 输出 YES C++ void solve() { int a, b; cin >> a >> b; if (a * 1 <= 阅读全文
posted @ 2021-07-05 20:47 RioTian 阅读(258) 评论(2) 推荐(0)
摘要:A - 凯少与素数 签到 & 思维题, 要使每一对数字 \((i,j)\) 的最大公约数都等于 1,简单来说区间相邻的两个数一定 \(gcd(i,j) = 1\) 并且 \((r - l)\) 为奇数保证区间每一个数都能用于构成整数对 【AC Code】 #include <bits/stdc++. 阅读全文
posted @ 2021-07-01 21:52 RioTian 阅读(58) 评论(0) 推荐(0)
摘要:补题链接:Here 1538A. Stone Game 数组 \(a\) 的大小为 \(n\) ,请问每次可以删除最左和最右侧的元素,请问最少执行多少次能删除掉数组中的最大值和最小值 (\(1\le a_i\le n\)) 在输入的时候确定最大值和最小值的下标, 4种情况 比较从左边删除和右边删除的 阅读全文
posted @ 2021-06-12 16:10 RioTian 阅读(156) 评论(0) 推荐(0)
摘要:补题链接:Here 1535A. Fair Playoff 四名选手参加了季后赛。比赛按以下方案进行:第一名选手与第二名选手比赛,第三名选手与第四名选手比赛,然后两人中的获胜者进入决赛。 众所周知,在两个选手之间的比赛中,技术更高的一个将获胜。第 \(i\) 位玩家的技能等于 \(s_i\) ,所有 阅读全文
posted @ 2021-06-08 15:03 RioTian 阅读(104) 评论(0) 推荐(0)
摘要:补题链接:Here A - Rock-paper-scissors 石头剪刀布,两方是一样的则输出该值,否则输出该值 int s[4] = {0, 1, 2}; void solve() { int x, y; cin >> x >> y; if (x == y) cout << x; else { 阅读全文
posted @ 2021-06-08 14:23 RioTian 阅读(265) 评论(0) 推荐(0)
摘要:给20级学弟学妹们带带榜单 A - 凯少的动作序列 枚举情况替换即可 #include <bits/stdc++.h> using namespace std; using ll = long long; void solve() { int n; string s; cin >> n >> s; 阅读全文
posted @ 2021-06-04 21:04 RioTian 阅读(57) 评论(0) 推荐(0)
摘要:补题链接:Here A. League of Legends 签到题,求和判断即可 ll suma, sumb; void solve() { ll x; for (int i = 1; i <= 5; ++i)cin >> x, suma += x; for (int i = 1; i <= 5; 阅读全文
posted @ 2021-06-04 17:40 RioTian 阅读(153) 评论(0) 推荐(0)
摘要:补题链接:Here A - 2nd Greatest Distance 二维坐标图中有 \(n\) 个房子,现在规定两房子距离定义为: \(max(|x_i−x_j|,|y_i−y_j|)\) 求第二大的距离值 【解法一】对 \(x,y\) 进行排序寻找 #define f first #defin 阅读全文
posted @ 2021-06-01 21:09 RioTian 阅读(142) 评论(0) 推荐(0)
摘要:补题链接:Here 1523A. Game of Life 生命游戏定义 本题中改编为一维坐标上的生命游戏 即使 \(m(m\in[1,1e9])\) 的范围很大,但每次进化不会超过 \(n\) 次,因为如果我们进化结果与上一代是相同的则说明游戏结束了,但我们只有 \(n\) 格。所以最多进行 \( 阅读全文
posted @ 2021-06-01 10:20 RioTian 阅读(111) 评论(0) 推荐(0)
摘要:蓝桥杯历年国赛真题汇总:Here 统一声明 如果不写默认带有常用头文件 如果不表明主函数默认表示在 void solve(){} 默认使用 using namespace std; ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); using l 阅读全文
posted @ 2021-05-31 19:40 RioTian 阅读(1043) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 8 ··· 25 下一页