Codeforces Round #488 by NEAR (Div. 2)】的更多相关文章

题意:x轴-100和+100的有敌人飞船,纵坐标由输入数据给出,我方有2飞船在x轴0,y坐标待定.0时刻时敌人同时向我方2飞船发出光线,光线会穿透飞船打到敌人自己,问2飞船放在哪敌人损失最大? 假如-100有飞船a,+100有飞船b,那么在两者y坐标和/2的位置放飞船,就炸掉2个.数据是60*60最多3600,将所有的和涉及的左飞船,右飞船或起来(位运算|).然后二重循环和,或起来看数量. //#pragma comment(linker,"/STACK:1024000000,102400000…
A 开个桶记录是否出现即可. 时间复杂度 \(O\left(n+m\right)\). B 按能力值从小到大依次加入,然后维护前 \(k\) 大的金币数即可. 时间复杂度 \(O\left(n\log n\right)\). C 发现如果两个正方形有交,那么必定有一个整点被两个正方形同时包含. 然后暴力枚举正方形内的每个整点即可. 时间复杂度 \(O\left(S\right)\). D 如果有且仅有一个数在两人那里都出现了,就输出这个数. 如果有任意一对数中的两个数在两人那里都出现了,即存在至…
Problem   Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec Problem Description Input Output The only line should contain the minimal number of days required for the ship to reach the point (x2,y2)(x2,y2). If it…
Problem   Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems Time Limit: 3000 mSec Problem Description Input The input contains a single line consisting of 2 integers N and M (1≤N≤10^18, 2≤M≤100). Output Print one integer, the total n…
Educational Codeforces Round 43 (Rated for Div. 2) https://codeforces.com/contest/976 A #include<bits/stdc++.h> using namespace std; #define lson l,mid,rt<<1 #define rson mid+1,r,rt<<1|1 #define IT set<ll>::iterator #define sqr(x)…
Educational Codeforces Round 35 (Rated for Div. 2) https://codeforces.com/contest/911 A 模拟 #include<bits/stdc++.h> using namespace std; #define lson l,mid,rt<<1 #define rson mid+1,r,rt<<1|1 #define IT set<ll>::iterator #define sqr(…
Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings 题目连接: http://codeforces.com/contest/985/problem/F Description You are given a string s of length n consisting of lowercase English letters. For two given strings s an…
Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes 题目连接: http://codeforces.com/contest/985/problem/E Description Mishka received a gift of multicolored pencils for his birthday! Unfortunately he lives in a monochrome w…
Educational Codeforces Round 63 (Rated for Div. 2)题解 题目链接 A. Reverse a Substring 给出一个字符串,现在可以对这个字符串进行一次翻转,问是否存在一种方案,可以使得翻转后字符串的字典序可以变小.   这个很简单,贪心下就行了. 代码如下: Code #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 3e5…
Educational Codeforces Round 39 (Rated for Div. 2) G 题意: 给一个序列\(a_i(1 <= a_i <= 10^{9}),2 <= n <= 200000\), 如果至多删除其中的一个数之后该序列为严格上升序列,那么称原序列为几乎严格上升序列. 现在每次将序列中的任意数字变成任意数字,问最少要操作几次才能将序列变成几乎严格上升子序列. 思路: 如果不考虑删除,求让整个序列都变成严格上升子序列的次数 求出\(序列a_i - i\)…