Educational Codeforces Round 70 题解】的更多相关文章

噩梦场. 题目出奇的难,好像一群外国老哥看 A 看着看着就哭了-- A 找到 \(b\) 最低的 \(1\),这个 \(1\) 肯定要跟 A 中的一个 \(1\) 搭配,而且是能搭配的 \(1\) 中最低的. #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> PII; const int maxn=100010,mod=998244353; #define…
比赛链接:https://codeforc.es/contest/1202 A. You Are Given Two Binary Strings... 题意:给出两个二进制数\(f(x)\)和\(f(y)\),定义一个二进制数\(s_k=f(x)+2^k\cdot f(y)\),询问\(k\)取何值时\(s_k\)的反向字符串(将二进制数看作01串)字典序最小. 分析:首先,我们需要知道对于一个二进制数乘2,相当于将该数整体左移一位,因此我们只需要找到\(f(y)\)最右侧的1的位置\(pos…
A. k-Factorization 题意:给你一个n,问你这个数能否分割成k个大于1的数的乘积. 题解:因为n的取值范围很小,所以感觉dfs应该不会有很多种可能-- #include<bits/stdc++.h> using namespace std; long long n; int k; vector<int> ans; void dfs(int x,long long now,int st){ if(x==k&&now==n){ for(int i=0;i…
题解 CF1082A [Vasya and Book] 史上最难A题,没有之一 从题意可以看出,翻到目标页只有三种办法 先从\(x\)到\(1\),再从\(1\)到\(y\) 先从\(x\)到\(n\),再从\(n\)到\(y\) 直接从\(x\)到\(y\) 三种的必要条件分别是 \((y-1)\mod d \equiv 0\) \((n-y)\mod d \equiv 0\) \(|x-y|\mod d \equiv 0\) 所以如果上面三种都不满足的话就输出\(-1\) 不然就取最小的输出…
题目链接:https://codeforc.es/contest/1076 A. Minimizing the String 题意:给出一个字符串,最多删掉一个字母,输出操作后字典序最小的字符串. 题解:若存在一个位置 i 满足 a[i] > a[i+1],若不删除 a[i] 则后续操作不可能更优. #include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long lo…
传送门 Div 2的比赛,前四题还有那么多人过,应该是SB题,就不讲了. 这场比赛一堆计数题,很舒服.(虽然我没打) E. The Top Scorer 其实这题也不难,不知道为什么这么少人过. 考虑枚举那人的分数和有多少人和他同分,推一下就会发现我们只需要知道\(calc(sum,n,top)\)表示\(sum\)分,分给\(n\)个人,分数小于\(top\),的方案数. 好像不是很好直接搞,考虑容斥,枚举一下至少有几个人不满足条件即可. #include<bits/stdc++.h> na…
A.Find Divisible 沙比题 显然l和2*l可以直接满足条件. 代码 #include<iostream> #include<cctype> #include<cstdio> #include<cstring> #include<string> #include<cmath> #include<ctime> #include<cstdlib> #include<algorithm> #d…
A: 考你会不会除法 //By SiriusRen #include <bits/stdc++.h> using namespace std; #define int long long int n,k; signed main(){ scanf("%I64d%I64d",&n,&k); *(k+)); printf()); } B: 按照题意模拟 竟然挂了三次...... //By SiriusRen #include <bits/stdc++.h&…
这次真的好难...... 我这个绿名蒟蒻真的要崩溃了555... 我第二题就不会写...... 暴力搜索MLE得飞起. 好像用到最短路?然而我并没有学过,看来这个知识点又要学. 后面的题目赛中都没看,今天早上看了一下D发现还是能写的. A.You Are Given Two Binary Strings... 简单来说,对f(y)乘以2的k次,实际上就是把这个串左移k位.要使反转的串的字典序最小,就要让f(y)最后的1与f(x)的最后的1的位置对齐. #include<bits/stdc++.h…
目录 Contest Info Solutions A. You Are Given Two Binary Strings... B. You Are Given a Decimal String... C. You Are Given a WASD-string... D. Print a 1337-string... E. You Are Given Some Strings... Contest Info Practice Link Solved A B C D E F 5/6 Ø Ø Ø…