codeforces and round mocha

Rabbit 2024 鸡兔同笼计算器下载 Hen and rabbit cage calculator 2024 download

计算鸡兔同笼问题,能算结果,也能算初始条件。支持中文和英文的界面。 Calculate the chicken rabbit cage problem, be able to calculate the results and initial conditions. Supports interfa... ......
2024 计算器 calculator download Rabbit

CF1896D Ones and Twos 题解

CF1896D 如果只有单次询问其实可以双指针,但是这个难以进行拓展。 考虑找点性质。 发现 \(a_i,v\in\{1,2\}\),从值域上下手。发现若存在和为 \(S\) 的方案,则一定有和为 \(S-2\) 的方案,因为可以直接 \(-2\) 或 \(-1-1\)。 然后就变为找最大的和为奇/ ......
题解 1896D 1896 Ones Twos

codeforces刷题(1100):1904B_div2

B、Collecting Game 跳转原题点击此:该题地址 1、题目大意 获得一个由n位正整数组成的数组。你可以选择选择任意一个数作为你的判断值。然后任意一个 \(\le\) 它的数可以被选中加入你的分数(注意判断值不算在里面),同时该数被移除数组。你的任务是,对于该数组中的每个数,都将其作为判断 ......
codeforces B_div 1100 1904 div

LibreOJ#535. 「LibreOJ Round #6」花火

LibreOJ#535. 「LibreOJ Round #6」花火 \(n\) 个烟火排成一排,从左到右高度分别为 \(h_1,h_2,\cdots,h_n\),这些高度两两不同。 每次 Yoko 可以选择两个相邻的烟火交换,这样的交换可以进行任意多次。 每次 Yoko 还可以选择两个不相邻的烟火交 ......
LibreOJ Round 535

【CF30E】Tricky and Clever Password 题解(manacher + exKMP)

manacher + exKMP + 二分。 感觉是最粗暴的方法,想出来之后自己硬莽了 4k,荣获题解区最长。 Solution 约定:下文所提及到的所有的回文串,均指奇长度回文串。 显然把题目拆成两个部分,中间的回文串,以及两边相同的连续子串。考虑一下从哪个入手比较好。 忘记是咋想的了,易得从两边 ......
题解 Password manacher Tricky Clever

CodeForces 1917E Construct Matrix

洛谷传送门 CF 传送门 \(2 \nmid k\) 显然无解。 若 \(4 \mid k\),发现给一个全 \(2 \times 2\) 子矩形全部异或 \(1\) 不会对行异或和和列异或和造成影响。那么我们找到 \(\frac{k}{4}\) 个全 \(0\) 的 \(2 \times 2\) ......
CodeForces Construct Matrix 1917E 1917

codeforces刷题(1100):1905B_div2

B、Begginer's Zelda 跳转原题点击此:此题地址 1、题目大意 给你一个子树,你可任意选择两个节点\(u、v\),这两个节点之间的所有节点(包括\(u、v\))都将结合变为一个新的节点。要求你通过该操作将所有的节点变为只有一个节点,求最小的操作数。 2、题目解析 由题意可得:当\(u、 ......
codeforces B_div 1100 1905 div

CodeForces 1917F Construct Tree

洛谷传送门 CF 传送门 考虑形式化地描述这个问题。先把 \(l\) 排序。然后相当于是否存在一个 \(\{1, 2, \ldots, n\}\) 的子集 \(S\),使得: \(\sum\limits_{i \in S} l_i = d\)。 \(\exists T \subseteq S, \m ......
CodeForces Construct 1917F 1917 Tree

Thoughts and ideas about how to apply LLMs in specific domains like clinic/law/finance

Applying LLMs in Specific Domains As a university student who has just completed fine-tuning TinyLLaMA-1b with clinical instruction data using the QLo ......
Thoughts specific domains finance clinic

Codeforces Round 915 (div2) E

E. Tree Queries [题目链接](https://codeforces.com/contest/1904/problem/EProblem - E - Codeforces) 题意概括: 给定一棵大小为 \(n\) 的树,回答如下询问,询问之间相互独立: 给定一个点 \(x\) 与 \( ......
Codeforces Round div2 915 div

codeforces刷题(1100):1917B_div2

模板 B、Erase First or Second Letter 跳转原题点击此:该题地址 1、题目大意 给你一个字符串,可以执行任意次以下操作,生成最终的字符串(不可为空),问你能生成的不重复字符串数为多少。 操作一:删除字符串第一个字符; 操作二:删除字符串第二个字符。 2、题目解析 发现,操 ......
codeforces B_div 1100 1917 div

[题解]CF1811D Umka and a Long Flight

思路 假设原题目中的 \(n\) 在本文中为 \(num\),则原长方形的长 \(m = f_{num + 1}\) 和宽 \(n = f_{num}\)。 显然对于最初始的长方形,显然是要将一个 \(f_{num} \times f_{num}\) 的长方形丢进去的,并且要么放最左边,要么放在最右 ......
题解 Flight 1811D 1811 Umka

特殊的bug:element 0 of tensors does not require grad and does not have a grad_fn

很多帖子都说了,设置requires_grad_()就行。 但是我这次遇到的不一样,设置了都不行。 我是这种情况,在前面设置了torch.no_grad():,又在这个的作用域下进行了requires_grad_(),这是不起作用的。 简单版: with torch.no_grad(): model ......
does grad not element grad_fn

Codeforces 1909G - Pumping Lemma

这个题思考角度很多,做法也很多。这里介绍一种 @asmend 和我讲的做法。 设 \(d=m-n\),那么我们枚举 \(|x|=i,|y|=j\),设 \(s,t\) 的 LCP 长为 \(l_1\),LCS 长为 \(l_2\),那么可以得到这组 \((i,j)\) 合法的充要条件是: \(i\l ......
Codeforces Pumping 1909G Lemma 1909

sql: between and

SELECT * FROM ( SELECT t.*, ROWNUM rn FROM hr.bi_history t ) WHERE rn BETWEEN 5 AND 10; ......
between sql and

[引]Power Automate Use variables and the % notation

Variable manipulation and the % notation - Power Automate | Microsoft Learn 变量操作和 % 表示法 - Power Automate | Microsoft Learn In this articleHardcoded va ......
variables Automate notation Power Use

hdfs报错:There are 0 datanode(s) running and 0 node(s) are excluded in this operation

namenode的日志还是打印There are 0 datanode(s) running and 0 node(s) are excluded in this operation.吗 报错信息如下所示。其中,【X】是当前正在运行的DataNode数量,【Y】是被排除在此操作之外的DataNode ......
are operation datanode excluded running

Codeforces1917F - Construct Tree

Codeforces1917F - Construct Tree Problems 给一个长度为 \(n\) 的序列 \(l\) 和 \(d\)。 要求判断是否可以构造出一颗节点数为 \(n+1\) 的树,满足 \(l\) 的每一个元素唯一对应为一条边的长度,并使整棵树的直径长度恰好为 \(d\)。 ......
Codeforces Construct 1917F 1917 Tree

CodeForces 1906K Deck-Building Game

洛谷传送门 CF 传送门 UNR #2 黎明前的巧克力。 枚举两个人选的卡的并集 \(S\),那么当 \(\bigoplus\limits_{i \in S} a_i = 0\) 时 \(S\) 有贡献 \(2^{|S|}\)。 考虑将 \(2^{|S|}\) 分摊到每个元素上,也就是每个元素有 \ ......
Deck-Building CodeForces Building 1906K 1906

CF1051C Vasya and Big Integers 题解

Problem - 1051E - Codeforces Vasya and Big Integers - 洛谷 感谢女队提交记录推荐给我的一道题 \(Orz\) 首先 \(O(n^2)\) 的 \(dp\) 是 simple 的,如果你没看出来你可能是像我一样把题目看错了 设 \(dp_i\) 表 ......
题解 Integers 1051C Vasya 1051

Python - pandas 报错:ValueError: 'HIS_批准文号' is both an index level and a column label, which is ambiguous.

问题描述 file:[Terminal] ValueError: 'HIS_批准文号' is both an index level and a column label, which is ambiguous. ValueError: cannot insert 招采_批准文号, already ......
文号 ValueError ambiguous Python pandas

Codeforces1917E - Construct Matrix

Codeforces1917E - Construct Matrix 首先考虑因为 \(n\) 为偶数,所以 \(k\) 为奇数时不可能满足条件。 其次,如果 \(4|k\),那么实际上在矩阵中一直放 \(2\times 2\) 的全为 \(1\) 的矩阵就可以了。 随后,如果 \(k \equiv ......
Codeforces Construct Matrix 1917E 1917

Codeforces Round 917 (Div. 2)

基本情况 A题秒了,B题卡了一年。 B. Erase First or Second Letter Problem - B - Codeforces 卡题分析 两方面原因 没有变通,一开始的思路是公式算出总字串数再想办法找重复的减掉,但搞了一个小时都不可行,应该早点换成正着来找的思路。 没有更深入的 ......
Codeforces Round 917 Div

codeforces刷题(1100):1907C_div3

C、Removal of Unattractive Pairs 跳转原题点击此:[该题地址](Problem - 1907C - Codeforces) 1、题目大意 给定一个字符串,可以删除相邻的两个不相等的字符。问你删除后能得到最小的字符串长度为多少。 2、题目解析 因为只要两个不相等的字符相邻 ......
codeforces C_div 1100 1907 div

CF contest 1909 Pinely Round 3 (Div. 1 + Div. 2) 题解(Vanilla的掉分赛)

[Pinely Round 3 (Div. 1 + Div. 2) - Codeforces](https://codeforces.com/contest/1909) $$ \color{purple}\large\textbf{世界上只有一种真正的英雄主义,} $$ $$ \color{red}... ......
题解 Div contest Vanilla Pinely

Pinely Round 3 (Div. 1 + Div. 2)

A 构造题,分两种情况考虑 上下都行,左右选一个 左右都行,上下选一个 void solve() { int n; cin >> n; vector<pair<int, int> > a(n); for(auto &t : a) cin >> t.x >> t.y; sort(a.begin(), ......
Div Pinely Round

CodeForces 1909D Split Plus K

洛谷传送门 CF 传送门 设最后每个数都相等时为 \(t\)。那么一次操作变成了合并两个数 \(x, y\),再增加 \(x + y - k\)。于是每个 \(a_i\) 可以被表示成 \(b_i t - (b_i - 1)k\) 的形式,化简得 \(a_i - k = b_i (t - k)\)。 ......
CodeForces 1909D Split 1909 Plus

CodeForces 1909E Multiple Lamps

洛谷传送门 CF 传送门 感觉这个题比较难蚌。 发现按 \(1 \sim n\) 最后可以把 \(1 \sim n\) 中的所有平方数点亮。所以 \(n \ge 20\) 就直接输出 \(1 \sim n\)。 考虑 \(n \le 19\)。猜测合法的方案(即按完后亮灯数 \(\le \left\ ......
CodeForces Multiple 1909E Lamps 1909

CodeForces 1909F2 Small Permutation Problem (Hard Version)

洛谷传送门 CF 传送门 感觉这个题还是挺不错的。 考虑 F1。考察 \(a_i\) 差分后的意义,发现 \(a_i - a_{i - 1}\) 就是 \((\sum\limits_{j = 1}^{i - 1} [p_j = i]) + p_i \le i\)。 考虑将其转化为棋盘问题。在 \(( ......

Pinely Round 3 (Div. 1 + Div. 2) A~D

A. Distinct Buttons // #include <bits/stdc++.h> #include <iostream> #include <string> #include <cstring> #include <vector> #include <algorithm> #inclu ......
Div Pinely Round
共4000篇  :6/134页 首页上一页6下一页尾页