codeforces round pairs node
Codeforces Round 900 (Div. 3)
目录写在前面ABCDEFG写在最后 写在前面 比赛地址:https://codeforces.com/contest/1878。 前天晚上他妈睡不着觉又不想看漫画打游戏于是到阳台上开把 div3 放松心情。 40min 过了 5 题把剩下两题都口了感觉没意思了于是睡觉。 太菜了还是,现在是 div3 ......
Educational Codeforces Round 122 (Rated for Div. 2)
A. Div. 7 #include<bits/stdc++.h> using namespace std; void solve(){ int n , a , b , c ; cin >> n; c = n % 10 , n /= 10; b = n % 10 , n /= 10; a = n % ......
vue_error_Runtime directive used on component with non-element root node. The directives will not function as intended
翻译: '运行时指令,用于非元素根节点的组件。这些指令将无法发挥预期的作用'; 这个错误发生在我将v-show放在自定义组件上时, 我想是因为自定义组件在渲染时会被自定义组件的内部元素替换, 因此设置是无效的 解决: 在自定义组件外加一个div, 把v-show写在div上 ......
Codeforces Round 627 (Div. 3)
Codeforces Round 627 (Div. 3) A. Yet Another Tetris Problem 解题思路: 最终所有位置减去的数是相同的,也就是说能否通过\(+2\)的方式使所有数相同。 即如果存在两个数之间的差为奇数,那么就不可能同时为\(0\)。 代码: #include ......
Educational Codeforces Round 155 (Rated for Div. 2)
Preface 这天晚上这场因为不明原因(玩CCLCC中)就没有打,只能赛后补一下 这场的EF都不算难初看都有做法,但好家伙E写挂两发,F写个根号做法直接T到天上去了 A. Rigged! 签到题,对于所有的\(e_i\ge e_1\)的\(i\),求出\(S=\max s_i\),根据\(S+1\ ......
Codeforces Round 695 (Div. 2)
练习笔记: A:https://codeforces.com/contest/1467/problem/A 一开始以为是 987654321..... 交了两发WA。慢慢想想就是如果说我是第二个号码放8就是98901234.... 交了就是AC B: https://codeforces.com/c ......
加训日记 Day5——codeforces round 899 再战div2
Day5,9.25,codeforces round 899 div2 ·事实证明自己的思维和手速都还不够快,晚上还晚来了一点 ·B题属实是,上来就想着并查集(菜鸡是这样的)然后发现不会写捏 ·思考了很久(看数据量)感觉是枚举暴力,但是又想不到怎么去枚举 ·一题遗憾离场 ·顺理成章的-26 ......
Node开发(八)Class类
在ES5使用构造函数来创建对象(一直在使用函数来模拟对象) 在ES6中,引入class关键字,可以使用class来定义类 一、Class简介 1.什么是类?类是用来描述具有一些共同的特性和行为的事物类由属性和方法组成2.什么是对象?对象是类的实例3.class class Student { con ......
npm 包从 ~/AppData 解析,而未从项目的 node_modules 中解析
问题描述 js 文件 import * as THREE from "three"; ctrl + 点击 three 跳转到的文件为 C:\Users\21632\AppData\Local\Microsoft\TypeScript\5.2\node_modules\@types\three\ 下的 ......
Problem - 616C - Codeforces
Problem - 616C - Codeforces C. The Labyrinth 如果是直接对\(*\)去跑dfs或者bfs的话无疑是会超时的 既然如此,那我们可以去对 \(.\) 跑搜索,将各个连通的 \(.\) 块标号并计算出连通块内的点的数量,然后去遍历\(*\)的时候只需要上下左右跑 ......
P8512 [Ynoi Easy Round 2021] TEST_152
题外话 纪念一下第一道 Ynoi Easy Round.(上次那个是 Ynoi 模拟赛,什么时候才能做正统 Ynoi 啊/ll 在图老师的逼迫下换了洛谷博客的主题和背景,还挺好看的感觉。 原题传送门 题意 给定一个长度为 \(m\) 的序列,初始全为 \(0\)。再给 \(n\) 个区间赋值操作。 ......
Codeforces Round 900 (Div. 3)
Codeforces Round 900 (Div. 3) A. How Much Does Daytona Cost? 解题思路: 可取一个元素作为子数组,数组中存在\(k\)即可。 代码: #include<bits/stdc++.h> using namespace std; using ll ......
pair<int,int> 有序对使用方法
pair<int, int> 是 C++ 标准库中的一个模板类,用于存储两个值的有序对。它的第一个值的类型是 int,第二个值的类型也是 int。 可以将整个 pair<int , int> 理解为一个有序对数据类型,所以它也只能接受有序对数据类型为了简化代码,可以使用 typedef 或 defi ......
abc212G - Power Pair
G - Power Pair 如果知道了原根的话这题就会简单很多 r是p的原根 \(r^a=x, r^b=y\) 那么$$r^{an} \equiv r^b (mod\ p) $$ 根据原根的性质 \[an \equiv b(mod\ p-1) \]\[an-k(p-1)=b \]令n=p-1 由裴 ......
CF1195 Codeforces Round 574 (Div. 2)
CF1195A Drinks Choosing 先将相同权值的配对直到只剩下一个,然后再配剩下的单个。 #include<iostream> #include<cstdio> using namespace std; const int N=1005; int n,k; int a[N]; int ......
CF1440 Codeforces Round 684 (Div. 2)
CF1440A Buy the String 每个点有两种决策,要么选当前的字符,要么选跟当前字符不同的字符,取个较小值相加。 #include<iostream> #include<cstdio> using namespace std; const int N=1005; int T; int ......
CF1197 Educational Codeforces Round 69 (Rated for Div. 2)
CF1197A DIY Wooden Ladder 答案为 \(\min(a_{n-1},n-2)\)。 #include<iostream> #include<cstdio> #include<algorithm> using namespace std; const int N=100005; ......
CF1447 Codeforces Round 683 (Div. 2, by Meet IT)
CF1447A Add Candies 可以将操作看做将 \(a_i\) 减 \(i\),然后第 \(i\) 次操作 \(i\) 就是合法的。 #include<iostream> #include<cstdio> using namespace std; int T; int n; void so ......
CF1008 Codeforces Round 497 (Div. 2)
CF1008A Romaji 直接模拟。 #include<iostream> #include<cstdio> #include<cstring> using namespace std; const int N=105; int n; char s[N]; int main() { scanf( ......
CF1011 Codeforces Round 499 (Div. 2)
CF1011A Stages 每次记下上一个选的位置,贪心能填就填。 #include<iostream> #include<cstdio> using namespace std; const int N=55; int n,k; char s[N]; int cnt[27]; int main( ......
CF1072 Codeforces Round 517 (Div. 2, based on Technocup 2019 Elimination Round 2)
CF1072A Golden Plate 第 \(i\) 个矩形的周长为 \(2(w - 4(i - 1))+2(h - 4(i - 1))-4\),枚举 \(i\) 求和。 #include<iostream> #include<cstdio> using namespace std; int n ......
CF1079 Codeforces Round 522 (Div. 2, based on Technocup 2019 Elimination Round 3)
CF1079A Kitchen Utensils 令 \(c_i\) 表示餐具 \(i\) 出现的数量,最小的餐具套数为 \(t=\lceil \frac{\max\{c_i\}}{k}\rceil\),按照这个计算就好了。 #include<iostream> #include<cstdio> # ......
CF1020 Codeforces Round 503 (by SIS, Div. 2)
CF1020A New Building for SIS 分类讨论 \(a,b\) 两个端点的几种情况就好了,特判 \(t_a=t_b\) 的情况。 #include<iostream> #include<cstdio> #include<cmath> #include<algorithm> usi ......
CF1162 Codeforces Round 557 (Div. 2) [based on Forethought Future Cup - Final Round]
CF1162A Zoning Restrictions Again 每个位置越高越好,暴力模拟即可。 #include<iostream> #include<cstdio> using namespace std; const int N=55; int n,h,m; int a[N]; int m ......
CF1036 Educational Codeforces Round 50 (Rated for Div. 2)
CF1036A Function Height 答案为 \(\lceil \frac{k}{n}\rceil\)。 #include<iostream> #include<cstdio> using namespace std; long long n,k; int main() { scanf(" ......
CF957 Codeforces Round 472 (rated, Div. 2, based on VK Cup 2018 Round 2)
CF957A Tritonic Iridescence 如果原序列中有两个相同的字符,显然不合法。 如果开头或者结尾为 ?,或者有两个连续的 ?,或者一个 ? 两边的字符不同显然合法。 否则一定不合法。 #include<iostream> #include<cstdio> using namesp ......
CF992 Codeforces Round 489 (Div. 2)
CF992A Nastya and an Array 答案为非零数的个数。 #include<iostream> #include<cstdio> #include<map> using namespace std; const int N=100005; int n; int a[N]; map< ......
CF996 Codeforces Round 492 (Div. 2) [Thanks, uDebug!]
CF996A Hit the Lottery 直接贪心尽可能的分配到 \(k_5\),剩下的依次分配给 \(k_4,k_3,k_2,k_1\)。 #include<iostream> #include<cstdio> using namespace std; int n; int k[6]; int ......
Codeforces Round 900 (Div. 3) - A B C D E
目录A. How Much Does Daytona Cost?B. Aleksa and Stack A. How Much Does Daytona Cost? 判断数 k 包不包含在数组里面即可 B. Aleksa and Stack 选定初始数为2, 3,后面的遍历 法二:全奇数即可,因为奇 ......
[题解] Codeforces Round 900(Div.3) E~F
Codeforces Round 900(Div.3) E~F E. Iva & Pav 因为按位与的结果不会随着越多数字的增加而增加,因此我们可以利用这个性质二分出右端点,只需要一个可以查询区间的数据结构即可。 或者是按位考虑第 \(i\) 个数字的第 \(k\) 位,后缀最近的 \(0\) 的位 ......