Codeforces Round #801 (Div. 2) and EPIC Institute of Technology Round C - Zero Path 在这道题目中,不可以真正地进行寻找必须另想办法. 考虑到只能向右面还有下面走,所以对于一个点,它只可能有已经走过的点转移过来,这让我想起来动态规划. 动态规划考虑最优解,这里所需要求的是0,不可以直接考虑是否与0相接近,需要考虑其他解法. 最大值以及最小值是唯一的,所以可以通过动态规划,最终求出目的地的最大数字以及最小数字. 证明…
Codeforces Round #801 (Div. 2) C(规律证明) 题目链接: 传送门QAQ 题意: 给定一个\(n * m\)的矩阵,矩阵的每个单元的值为1或-1,问从\((1,1)\)开始出发,每次只可以向下和向右走,问到终点\((n * m)\)时,是否可以总值为1. 分析: 题意很简单,本题的重点是在于,是否知道一个这样的结论: 首先定义 \(mn[i][j]\)为在\((i,j)\)处能拿到最少数量的1. \(mx[i][j]\)为在\((i,j)\)处能拿到最多数量的1.…
Codeforces Round #517 (Div. 2, based on Technocup 2019 Elimination Round 2) #include <bits/stdc++.h> using namespace std; int n,m,k; ; int main() { cin>>n>>m>>k; ;i<=k-;++i) { sum+=(n+(m-))*-(i)*; } cout<<sum<<endl;…
题集链接 A Subrectangle Guess 代码 #include <bits/stdc++.h> #define endl "\n" using namespace std; typedef long long ll; const int N = 1e6; void solve() { ll mis = -1e10; int a, b, n, m; cin >> n >> m; for (int i = 1; i <= n; i++)…
A. Right-Left Cipher time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Polycarp loves ciphers. He has invented his own cipher called Right-Left. Right-Left cipher is used for strings. To encr…
A - Forgetting Things 题意:给 \(a,b\) 两个数字的开头数字(1~9),求使得等式 \(a=b-1\) 成立的一组 \(a,b\) ,无解输出-1. 题解:很显然只有 \(a=b\) 和 \(a=b-1\) 的时候有解,再加上一个从 \(9\) 越到 \(10\) 的就可以了.被样例的 \(199,200\) 误导了. #include<bits/stdc++.h> using namespace std; typedef long long ll; int mai…
C. Did you mean... time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Beroffice text editor has a wide range of features that help working with text. One of the features is an automatic search…
B. Which floor? time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how…
A. k-rounding time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output For a given positive integer n denote its k-rounding as the minimum positive integer x, such that x ends with k or more zeros i…
A. Technogoblet of Fire 题意:n个人分别属于m个不同的学校 每个学校的最强者能够选中 黑客要使 k个他选中的可以稳被选 所以就为这k个人伪造学校 问最小需要伪造多少个 思路:记录每个学校都有哪些人 每次看黑客选中的人是不是在学校是最强者(这里要处理能力一样的情况,如果有能力一样的为了保证稳进也要伪造一个学校) 然后就是模拟了 #include<bits/stdc++.h> #define FOR(i,f_start,f_end) for(int i=f_start;i&…