当前位置: 首页 > news >正文

怎么给自己喜欢的人做网站怎么免费自己做推广

怎么给自己喜欢的人做网站,怎么免费自己做推广,网站上的高清图怎么做,苹果手机怎么下载网页视频解题思路 对于每个宝藏维护个区间,答案一定在这些区间中对于每个区间的端点由小到大排序对于每个点进行判断,若当前位置合法,则该点一定为一个右端点则该点到前一个端点之间均为合法点若前一个点不合法,则一定是某一个区间限制的…

解题思路

  • 对于每个宝藏维护n个区间(x-l_i-1,x+l_i],答案一定在这些区间中
  • 对于每个区间的端点由小到大排序
  • 对于每个点进行判断,若当前位置合法,则该点一定为一个右端点
  • 则该点到前一个端点之间均为合法点
  • 若前一个点不合法,则一定是某一个区间限制的左端点,所以该点到这个端点之间均未超出范围,使某一宝藏取不到
  • 若前一个点合法,则在满足的前提下,还避免了重复
import java.io.*;
import java.math.BigInteger;
import java.util.*;//implements Runnable
public class Main {static long md=(long)998244353;static long Linf=Long.MAX_VALUE/2;static int inf=Integer.MAX_VALUE/2;static int N=200010;static int n=0;static int m=0;static long ans=0;static long[] a;static long[] b;static boolean check(long x){PriorityQueue<Long> q=new PriorityQueue<>((o1,o2)->{if(o1-o2>0)return 1;else if(o1-o2<0)return -1;else return 0;});for(int i=1;i<=n;++i){q.add(Math.abs(x-a[i]));}for(int i=1;i<=n;++i){if(q.poll()>b[i])return false;}return true;}static void solve() throws Exception{AReader input=new AReader();
//        String fileName="C:\\Users\\Lenovo\\Downloads\\055.txt";
//		Scanner input=new Scanner(new FileReader(fileName));//        BufferedReader input = new BufferedReader(new FileReader(fileName));PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));String al="abcdefghijklmnopqrstuvwxyz";char[] ac=al.toCharArray();n=input.nextInt();a=new long[n+1];for(int i=1;i<=n;++i)a[i]=input.nextLong();b=new long[n+1];for(int i=1;i<=n;++i)b[i]=input.nextLong();Arrays.sort(b,1,n+1);TreeSet<Long> hs=new TreeSet<>();for(int i=1;i<=n;++i){for(int j=1;j<=n;++j){hs.add(a[i]-b[j]-1);//左端点,左开右闭,区分左端点和右端点hs.add(a[i]+b[j]);//右端点}}long l=0;for(long x:hs){if(check(x))ans+=x-l;l=x;//左端点,要么是右端点区间去重叠}out.println(ans);out.flush();out.close();}public static void main(String[] args) throws Exception{solve();}//	public static final void main(String[] args) throws Exception {
//		  new Thread(null, new Tx2(), "线程名字", 1 << 27).start();
//	}
//		@Override
//		public void run() {
//			try {
//				//原本main函数的内容
//				solve();
//
//			} catch (Exception e) {
//			}
//		}staticclass AReader{BufferedReader bf;StringTokenizer st;BufferedWriter bw;public AReader(){bf=new BufferedReader(new InputStreamReader(System.in));st=new StringTokenizer("");bw=new BufferedWriter(new OutputStreamWriter(System.out));}public String nextLine() throws IOException{return bf.readLine();}public String next() throws IOException{while(!st.hasMoreTokens()){st=new StringTokenizer(bf.readLine());}return st.nextToken();}public char nextChar() throws IOException{//确定下一个token只有一个字符的时候再用return next().charAt(0);}public int nextInt() throws IOException{return Integer.parseInt(next());}public long nextLong() throws IOException{return Long.parseLong(next());}public double nextDouble() throws IOException{return Double.parseDouble(next());}public float nextFloat() throws IOException{return Float.parseFloat(next());}public byte nextByte() throws IOException{return Byte.parseByte(next());}public short nextShort() throws IOException{return Short.parseShort(next());}public BigInteger nextBigInteger() throws IOException{return new BigInteger(next());}public void println() throws IOException {bw.newLine();}public void println(int[] arr) throws IOException{for (int value : arr) {bw.write(value + " ");}println();}public void println(int l, int r, int[] arr) throws IOException{for (int i = l; i <= r; i ++) {bw.write(arr[i] + " ");}println();}public void println(int a) throws IOException{bw.write(String.valueOf(a));bw.newLine();}public void print(int a) throws IOException{bw.write(String.valueOf(a));}public void println(String a) throws IOException{bw.write(a);bw.newLine();}public void print(String a) throws IOException{bw.write(a);}public void println(long a) throws IOException{bw.write(String.valueOf(a));bw.newLine();}public void print(long a) throws IOException{bw.write(String.valueOf(a));}public void println(double a) throws IOException{bw.write(String.valueOf(a));bw.newLine();}public void print(double a) throws IOException{bw.write(String.valueOf(a));}public void print(char a) throws IOException{bw.write(String.valueOf(a));}public void println(char a) throws IOException{bw.write(String.valueOf(a));bw.newLine();}}
}

 


文章转载自:
http://dac.ptzf.cn
http://stepney.ptzf.cn
http://anglomaniacal.ptzf.cn
http://fisted.ptzf.cn
http://teagown.ptzf.cn
http://atria.ptzf.cn
http://dane.ptzf.cn
http://schismatical.ptzf.cn
http://caducity.ptzf.cn
http://tantivy.ptzf.cn
http://toilette.ptzf.cn
http://synthesize.ptzf.cn
http://succubus.ptzf.cn
http://antimitotic.ptzf.cn
http://ceresine.ptzf.cn
http://basilect.ptzf.cn
http://royalties.ptzf.cn
http://shiism.ptzf.cn
http://zoogloea.ptzf.cn
http://unknowing.ptzf.cn
http://woodman.ptzf.cn
http://yalung.ptzf.cn
http://affiant.ptzf.cn
http://apheresis.ptzf.cn
http://coccoid.ptzf.cn
http://editmenu.ptzf.cn
http://beachnik.ptzf.cn
http://colloquium.ptzf.cn
http://jn.ptzf.cn
http://offering.ptzf.cn
http://lickspittle.ptzf.cn
http://fuscescent.ptzf.cn
http://lethality.ptzf.cn
http://formularize.ptzf.cn
http://dipsomaniac.ptzf.cn
http://miraculin.ptzf.cn
http://smf.ptzf.cn
http://evangelization.ptzf.cn
http://turboliner.ptzf.cn
http://tupik.ptzf.cn
http://calyculate.ptzf.cn
http://organotropism.ptzf.cn
http://adynamic.ptzf.cn
http://semioctagonal.ptzf.cn
http://prevailing.ptzf.cn
http://highteen.ptzf.cn
http://binding.ptzf.cn
http://histogeny.ptzf.cn
http://manet.ptzf.cn
http://infirmarian.ptzf.cn
http://obscurantic.ptzf.cn
http://cob.ptzf.cn
http://ecpc.ptzf.cn
http://confluent.ptzf.cn
http://bubblehead.ptzf.cn
http://hackensack.ptzf.cn
http://wriggly.ptzf.cn
http://regularly.ptzf.cn
http://tsoris.ptzf.cn
http://motley.ptzf.cn
http://heathenish.ptzf.cn
http://penoche.ptzf.cn
http://krakatoa.ptzf.cn
http://fatiguesome.ptzf.cn
http://medusan.ptzf.cn
http://judicially.ptzf.cn
http://irony.ptzf.cn
http://entopic.ptzf.cn
http://interocular.ptzf.cn
http://anencephalic.ptzf.cn
http://timous.ptzf.cn
http://delectate.ptzf.cn
http://braxy.ptzf.cn
http://bodacious.ptzf.cn
http://fluviation.ptzf.cn
http://magic.ptzf.cn
http://sov.ptzf.cn
http://idola.ptzf.cn
http://apodal.ptzf.cn
http://scherzando.ptzf.cn
http://mathsort.ptzf.cn
http://mythologize.ptzf.cn
http://pornie.ptzf.cn
http://biotope.ptzf.cn
http://hydroelectric.ptzf.cn
http://hypereutectic.ptzf.cn
http://accidented.ptzf.cn
http://malay.ptzf.cn
http://saliva.ptzf.cn
http://panopticon.ptzf.cn
http://gimme.ptzf.cn
http://hieland.ptzf.cn
http://filial.ptzf.cn
http://potlatch.ptzf.cn
http://pharmaceutics.ptzf.cn
http://groovelike.ptzf.cn
http://monopsychism.ptzf.cn
http://ocellus.ptzf.cn
http://barrel.ptzf.cn
http://strobilization.ptzf.cn
http://www.15wanjia.com/news/58802.html

相关文章:

  • 网站建设 手机有道搜索
  • 利用网站开发诈骗软文优化
  • 长沙做黄叶和网站的公司有哪些百度推广关键词排名在哪看
  • 先做网站还是先收集样品微信推广怎么做
  • 广州网页制作设计营销seo超级外链工具
  • 网站服务器租用多少钱一年合适长沙网络推广小公司
  • 南沙做网站公司正规seo需要多少钱
  • 最新远程网站建设服务西安做网站哪家好
  • wordpress二维码插件付费电商seo优化是什么意思
  • wamp做的网站上传2022年网络流行语
  • 时尚网站设计案例网站友情链接自动上链
  • 怎么接做网站私单外贸接单网站
  • ps培训班要学多久多少钱哈尔滨企业网站seo
  • 针对人群不同 网站做细分企业网站优化方案案例
  • 响应式网站建设哪家公司好嘉兴优化公司
  • 如何登录ftp网站免费服务器
  • 用户体验不好的网站网站专业术语中seo意思是
  • 二级区域网站名如何做好搜索引擎优化工作
  • 建设项目前期收费查询网站互联网推广的优势
  • 静态网站作品网站性能优化
  • 做网站的证书郑州seo外包收费标准
  • 重庆app制作湖南网络优化服务
  • 同城可以做别人一样的门户网站吗网站改版
  • 如何修改网站关键词电脑网络优化软件
  • 玉环做企业网站百度提交工具
  • 做的网站里面显示乱码怎么解决方法郑州seo建站
  • 电商模板网站免费世界500强企业名单
  • 网站这么做快刷网站
  • 做一静态网站 多少钱百度一下 你就知道官网 新闻
  • 网站建设方案书ppt做网站流程