这次的前三题挺简单的,可是我做的不快也不对. A. Bank Robbery time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A robber has attempted to rob a bank but failed to complete his task. However, he had managed to open…
A: 思路:就是找b,c之前有多个s[i] 代码: #include<stdio.h>#define ll long longusing namespace std;ll a,b,c;int n;int s[110000];int main(){ while(~scanf("%lld%lld%lld",&a,&b,&c)) { scanf("%d",&n); int sum=0; for(int i=0;i<n;i+…
老年人题解,语言python3 A - Bank Robbery 题意:给你ABC,以及n个数,问你在(B,C)之间的数有多少个. 题解:对于每个数判断一下就好了嘛 x,y,z = map(int,input().split()) n = int(input()) print(len(list(filter(lambda x:y<int(x) and z>int(x),input().split())))) B. Cutting Carrot 题意:给你一个高为h,底为1的等腰三角形,你需要平…
考试的时候想的是,将所有的完全子图缩起来,然后如果剩下的是一条链,依次对其进行标号即可. 看了官方题解,发现完全子图这个条件太强了,缩点的条件仅仅需要保证原本两个点的“邻接表”相同即可.(注意这里的“邻接表”需要把其自身也放进去) 自己构造一下,发现这个比较容易理解. 被缩在一起的点的标号相同.如果缩完是一条链,对其依次进行标号.否则无解. 复杂度发现比较鬼畜,但是想一下就会知道其不会太高.官方说可以证明是. #include<cstdio> #include<vector> #i…
考虑两个人,先把各自的集合排个序,丢掉一半,因为比较劣的那一半一定用不到. 然后贪心地放,只有两种决策,要么把一个最优的放在开头,要么把一个最劣的放在结尾. 如果我的最优的比对方所有的都劣(或等于),我就把我最劣的往结尾放.否则我把我最优的往开头放. 用multiset维护两人的集合即可. #include<cstdio> #include<cstring> #include<algorithm> #include<set> using namespace…
A题:从两个保安中间那钞票 #include <bits/stdc++.h> using namespace std; int main() { int a,b,c; scanf("%d%d%d",&a,&b,&c); int n; scanf("%d",&n); int pos; ; ;i<n;i++) { scanf("%d",&pos); if(pos>b&&p…
A. Is it rated? time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Is it rated? Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to a…
A. Is it rated? time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Is it rated? Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to a…
Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final) A. Single Wildcard Pattern Matching 题意就是匹配字符的题目,打比赛的时候没有看到只有一个" * ",然后就写挫了,被hack了,被hack的点就是判一下只有一个" * ". 代码: //A #include<iostream> #include<cstdio>…
1. Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) B. Batch Sort    暴力枚举,水 1.题意:n*m的数组,每行最多可交换1次,列最多可交换两列,问最终是否可以变换到每行都是1~m. 2.总结:暴力即可. #include<bits/stdc++.h> #define F(i,a,b) for (int i=a;i<b;i++) #define FF(i,a,b) for (int i=a;i&l…