题意: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…
解题思路 -100和+100是没有用的,只要知道左边的飞船轴和右边的飞船轴离y轴一样近即可.为简单起见,我们将左边的轴设为-1,右边的设为1. 某个点能摧毁的飞船一定是因为有两个飞船关于这个点对称.即若(-1,y1)和(1,y2)能互相摧毁,说明他们关于(0,(y1+y2)/2)对称. 所以我们只用求出左边的点y1与右边的点y2的和y1+y2.((y1+y2)/2为对称点,为了消除小数,我们不除以2) 记录每个y1+y2的值能消除左边的点的位置,和右边的点的位置. 找到两个不同的y1+y2,将他…
A 开个桶记录是否出现即可. 时间复杂度 \(O\left(n+m\right)\). B 按能力值从小到大依次加入,然后维护前 \(k\) 大的金币数即可. 时间复杂度 \(O\left(n\log n\right)\). C 发现如果两个正方形有交,那么必定有一个整点被两个正方形同时包含. 然后暴力枚举正方形内的每个整点即可. 时间复杂度 \(O\left(S\right)\). D 如果有且仅有一个数在两人那里都出现了,就输出这个数. 如果有任意一对数中的两个数在两人那里都出现了,即存在至…
[Codeforces]Round #488 (Div. 2) 总结 比较僵硬的一场,还是手速不够,但是作为正式成为竞赛生的第一场比赛还是比较圆满的,起码没有FST,A掉ABCD,总排82,怒涨rating两百 A:Fingerprints A题,就在第一个串中查找第二个串中的数字,最气的是一开始没编译直接交CE了,噗 #include<iostream> #include<cstdio> using namespace std; int read(){ int ans=0,w=1…
总结 这是我无聊透顶肝到三点半的一场 cf ,结果还真够无聊的 这套题涵盖了英语题,语文题,模拟题.注重考查了选手的英语素养能力,语文阅读能力和精湛的模拟和枚举能力.是不可多得的一套好题. 没什么单独拿题写博客的必要,就组在一起写个博客.提供翻译造福人类. A. Fingerprints Description 题库链接 给出长度为 \(n\) 的序列 \(A\) ,和大小为 \(m\) 的集合 \(B\) ,要求找到 \(A\) 中最长子序列使得只出现 \(B\) 中的元素. \(1\leq…
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…