1 2 3 4 5 ··· 12 下一页

2024年6月8日

摘要: 对于所有长度为 \(n\) 且总和为 \(m\) 的任意正整数序列 \(a\),求 \(\sum\prod a_i \bmod~ 998244353\) 。 限制: \(1 \leqslant n, m \leqslant 2 \times 10^5\) 算法分析 做法一:积的和典型 一方面,满足 阅读全文
posted @ 2024-06-08 13:34 V_Melville 阅读(1) 评论(0) 推荐(0) 编辑

2024年6月7日

摘要: ABC265G. 012 Inversion 延迟线段树 每个点需要维护以下信息: \(0/1/2\) 的个数 有序对 \((0, 0)\), \((0, 1)\), \((0, 2)\),\((1, 0)\),\((1, 1)\),\((1, 2)\),\((2, 0)\),\((2, 1)\), 阅读全文
posted @ 2024-06-07 21:43 V_Melville 阅读(2) 评论(0) 推荐(0) 编辑

2024年6月3日

摘要: A. Subsegment Reverse 模拟 代码实现 n, l, r = map(int, input().split()) l -= 1 a = list(range(1, n+1)) a[l:r] = a[l:r][::-1] print(*a) B. Nutrients 模拟 代码实现 阅读全文
posted @ 2024-06-03 21:59 V_Melville 阅读(22) 评论(5) 推荐(1) 编辑

2024年5月25日

摘要: A. Who Ate the Cake? 模拟 代码实现 a, b = map(int, input().split()) if a == b: print(-1) else: print(6-a-b) B. Piano 2 模拟 代码实现 #include <bits/stdc++.h> #def 阅读全文
posted @ 2024-05-25 23:30 V_Melville 阅读(72) 评论(0) 推荐(0) 编辑

2024年5月18日

摘要: A. Exponential Plant 模拟 代码实现 h = int(input()) now, day = 0, 0 while now <= h: now += 1<<day day += 1 print(day) B. AtCoder Janken 2 模拟 代码实现 #include < 阅读全文
posted @ 2024-05-18 23:47 V_Melville 阅读(13) 评论(0) 推荐(0) 编辑
 
摘要: T3. 挑剔的美食家 作为一名挑剔的美食家,小猴对食物是很讲究的,哪怕摆在面前的只有若干香蕉和苹果,小猴依然有他的讲究。 已知目前已有 \(n\) 根香蕉和 \(m\) 个苹果,小猴制定了以下规则来决定自己的食用顺序: 每个香蕉都被认为是独特的个体,可以理解为编号为 \(1 \sim n\) 的香蕉 阅读全文
posted @ 2024-05-18 18:15 V_Melville 阅读(2) 评论(0) 推荐(0) 编辑

2024年5月16日

摘要: T6. 燃料 小明要开车从家里前往远方的城市 \(C\),他家到城市的路程是 \(L\) 公里。他的车每开 \(1\) 公里需要消耗 \(1\) 升汽油,车的油箱最多只能装 \(V\) 升汽油,出发前他的车是加满汽油的。 路途中有 \(n\) 个加油站,第 \(i\) 个加油站离小明家的路程是 \( 阅读全文
posted @ 2024-05-16 23:03 V_Melville 阅读(1) 评论(0) 推荐(0) 编辑

2024年5月4日

摘要: A. AtCoder Line 判断 \(z\) 是否出现在 \(x\) 和 \(y\) 之间即可 代码实现 n, x, y, z = map(int, input().split()) if x > y: x, y = y, x if x < z < y: print('Yes') else: p 阅读全文
posted @ 2024-05-04 23:44 V_Melville 阅读(41) 评论(0) 推荐(0) 编辑

2024年4月21日

摘要: G题暴力有点难绷。。 T1:Past ABCs 考虑后三个字符构成的十进制数即可 注意ABC000也要考虑 代码实现 s = input() id = int(s[3:]) if 1 <= id <= 349 and id != 316: print('Yes') else: print('No') 阅读全文
posted @ 2024-04-21 00:28 V_Melville 阅读(4) 评论(0) 推荐(0) 编辑

2024年4月6日

摘要: T1:Penalty Kick 模拟 代码实现 #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string ans; for (int i = 1; i <= n; ++i) { if (i%3 阅读全文
posted @ 2024-04-06 23:54 V_Melville 阅读(23) 评论(0) 推荐(0) 编辑
1 2 3 4 5 ··· 12 下一页