Codeforces Hello 2019】的更多相关文章

Hello 2019 手速场qwq 反正EGH太神仙了啊.jpg 考试的时候不会啊.jpg A 暴力.jpg #include <cstdio> #include <algorithm> #include <cmath> #include <cstring> #include <cstdlib> #include <queue> #include <iostream> #include <bitset> usi…
A. Gennady and a Card Game a题惯例签到题 题意:给你一张牌,再给你5张牌,判断能不能出一次牌... 所以只要检查第二行中的某个卡是否与第一行中的卡具有共同字符 有就输出YES否则输出NO #include<iostream> #include<cstring> #include<cstdio> using namespace std; char a,b,s[101]; bool tf=0; int main(){ scanf("%c…
题意:给你一个体积为\(T\)的背包,有\(n\)个物品,每个物品的价值和体积都是是\(a_{i}\),求放哪几个物品使得总价值最大,输出它们,并且输出价值的最大值. 题解:其实就是一个01背包输出路径的裸题,直接上板子就行了.(一维的背包写法其实还是不太怎么怎么理解,具体的以后再补). 代码: #include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include…
题意:给你5个\(A,B,C,D,E\)大小关系式,升序输出它们,如果所给的大小矛盾,输出\(impossible\). 题意:当时第一眼想到的就是连边然后排序,很明显是拓扑排序(然而我不会qwq,之后再补),但貌似可以直接暴力来写,用二维数组来记录两个数之间的大小关系,如果一维\(>\)二维就记录true,然后我们要对题目所给的关系进行合并,将所有大小关系弄清楚,三个for就可以搞定了,之后判断一下是否有矛盾存在,最后再统计一下大小然后再按顺序输出即可(这题的输出其实没怎么看懂,之前写的桶排输…
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. 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…
Codeforces Round 1120 这场比赛做了\(A\).\(C\)两题,排名\(73\). \(A\)题其实过的有点莫名其妙...就是我感觉好像能找到一个反例(现在发现我的算法是对的... \(C\)题的心路历程: 第一眼:这不后缀自动机吗??? 算了滚去写哈希表乱搞吧... 嗯怎么\(mle\)了???算了把数组改成\(vector\)吧... 嗯怎么又\(wa\)了???算了我还是老老实实去敲SAM吧... 嗯???\(pretest\ passed\)??!! 所以就交了\(3…
http://codeforces.com/contest/1072/problem/D bfs 走1步的最佳状态 -> 走2步的最佳状态 -> …… #include <bits/stdc++.h> using namespace std; #define ll long long #define minv 1e-6 #define inf 1e9 #define pi 3.1415926536 #define nl 2.7182818284 ; ; struct node {…
https://codeforces.com/contest/1072/problem/D 题意 给你一个n*n充满小写字母的矩阵,你可以更改任意k个格子的字符,然后输出字典序最小的从[1,1]到[n,n]的路径(1<=n<=2000) 思路 我的 定义dp[i][j]为从[1,1]到[i,j]字符串最小的字符串,然后枚举所有i-1+j-1+1<=k的点,然后字符串连接比较,代表更改前面i,j个字符 这种思路有两个问题,如何处理出从[i,j]到[n,n]的最小字典序字符串,第二假如i+j…
传送门:http://codeforces.com/contest/1087/problem/C C. Connect Three time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The Squareland national forest is divided into equal 1×11×1 square plots al…