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

网站建设方案书备案注册域名哪个网站好

网站建设方案书备案,注册域名哪个网站好,微信官方网站下载,阐述网站建设利益目录 题目地址 做题情况 A 题 B 题 C / D 题 E 题 F / G 题 题目地址 牛客竞赛_ACM/NOI/CSP/CCPC/ICPC算法编程高难度练习赛_牛客竞赛OJ 做题情况 A 题 import java.io.*; import java.math.*; import java.util.*;// xixi♡西 public class Main {static IOS scnew…

目录

题目地址

做题情况

A 题

B 题

C / D 题

E 题

F / G 题

题目地址

牛客竞赛_ACM/NOI/CSP/CCPC/ICPC算法编程高难度练习赛_牛客竞赛OJ

做题情况

A 题

import java.io.*;
import java.math.*;
import java.util.*;// xixi♡西
public class Main {static IOS sc=new IOS();static void solve() throws IOException {int a1=sc.nextInt();int a2=sc.nextInt();int a3=sc.nextInt();dduoln(Math.abs(a1-a2)+Math.abs(a2-a3)==0?"Yes":"No");} public static void main(String[] args) throws Exception {int t = 1;
//        t = sc.nextInt();while (t-- > 0) {solve();}}static <T> void dduo(T t) {System.out.print(t);}static <T> void dduoln(T t) {System.out.println(t);}}class IOS{BufferedReader bf;StringTokenizer st;BufferedWriter bw;public IOS(){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{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 BigInteger nextBigInteger() throws IOException{return new BigInteger(next());}public BigDecimal nextDecimal() throws IOException{return new BigDecimal(next());}
}

B 题

import java.io.*;
import java.math.*;
import java.util.*;// xixi♡西
public class Main {static IOS sc=new IOS();static void solve() throws IOException {int n=sc.nextInt();int arr[]=new int[n];HashMap< Integer , Integer >hm=new HashMap<>();for(int i=0;i<n;i++) {arr[i]=sc.nextInt();hm.put(arr[i], hm.getOrDefault(arr[i], 0)+1);}Arrays.sort(arr);int cnt=0;for(int i=0;i<n-1;i++) {cnt+=Math.abs(arr[i]-arr[i+1]);}if(hm.size()==1) {dduoln("1 "+cnt);}else {dduoln("2 "+cnt);}} public static void main(String[] args) throws Exception {int t = 1;
//        t = sc.nextInt();while (t-- > 0) {solve();}}static <T> void dduo(T t) {System.out.print(t);}static <T> void dduoln(T t) {System.out.println(t);}}class IOS{BufferedReader bf;StringTokenizer st;BufferedWriter bw;public IOS(){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{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 BigInteger nextBigInteger() throws IOException{return new BigInteger(next());}public BigDecimal nextDecimal() throws IOException{return new BigDecimal(next());}
}

C / D 题

import java.io.*;
import java.math.*;
import java.util.*;// xixi♡西
public class Main {static IOS sc=new IOS();static void solve() throws IOException {int n=sc.nextInt();int k=sc.nextInt();String str=sc.next();long arr[]=new long[n-1];for(int i=0;i<n-1;i++) {arr[i]=Math.abs(str.charAt(i+1)-str.charAt(i));}long ans=0;// 双指针int i=0;int j=n-2;long a=1;long cnt=0;if(k>n/2) {k=n-k+1;}else {k--;}while(i<=j) {
//			dduoln(a);if(i==j) {cnt+=arr[i]*a;}else {cnt+=arr[i]*a;cnt+=arr[j]*a;	}if(a<k) {a++;}i++;j--;}dduoln(cnt);} public static void main(String[] args) throws Exception {int t = 1;
//        t = sc.nextInt();while (t-- > 0) {solve();}}static <T> void dduo(T t) {System.out.print(t);}static <T> void dduoln(T t) {System.out.println(t);}}class IOS{BufferedReader bf;StringTokenizer st;BufferedWriter bw;public IOS(){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{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 BigInteger nextBigInteger() throws IOException{return new BigInteger(next());}public BigDecimal nextDecimal() throws IOException{return new BigDecimal(next());}
}

E 题

import java.io.*;
import java.math.*;
import java.util.*;// xixi♡西
public class Main {static IoScanner sc = new IoScanner();static int MOD=(int) (1e9+7);static ArrayList< ArrayList<Integer> > list;static long dp[]; // 当前节点往下的陡峭值static int father[]; // 当前节点父节点的值static void solve() throws IOException {int n=sc.nextInt();list = new ArrayList<>();for(int i=0;i<n+5;i++) {list.add(new ArrayList<>());}for(int i=0;i<n-1;i++) {int u=sc.nextInt();int v=sc.nextInt();list.get(u).add(v);list.get(v).add(u);}dp=new long[n+1];father=new int[n+1];dfs(1,0);long min=Long.MAX_VALUE;for(int i=2;i<=n;i++) {long t1=dp[i];long t2=dp[1]-dp[i]-Math.abs(i-father[i]);min=Math.min(min, Math.abs(t1-t2));}dduoln(min);} /*** * @param u 当前节点* @param p 父节点*/static void dfs(int u,int p) {father[u]=p;for(int v:list.get(u)) { // v 相邻节点if(v==p)continue;dfs(v,u);dp[u]+= Math.abs(u-v) + dp[v];}}public static void main(String[] args) throws Exception {int t = 1;
//        t = sc.nextInt();while (t-- > 0) {solve();}}static <T> void dduo(T t){System.out.print(t);}static <T> void dduoln(){System.out.println("");}static <T> void dduoln(T t){System.out.println(t);}}class IoScanner {BufferedReader bf;StringTokenizer st;BufferedWriter bw;public IoScanner() {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 {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 BigInteger nextBigInteger() throws IOException {return new BigInteger(next());}public BigDecimal nextDecimal() throws IOException {return new BigDecimal(next());}
}

F / G 题

import java.io.*;
import java.math.*;
import java.util.*;// xixi♡西
public class Main {static IoScanner sc = new IoScanner();static final int mod=(int) (1e9+7);static void solve() throws IOException {int n=sc.nextInt();long a[]=new long[n];for(int i=0;i<n;i++){a[i]=sc.nextLong();}Arrays.sort(a);long ans=0,sum=0;for(int i=0;i<n;i++){ans+=a[i]*i-sum;sum+=a[i];ans%=mod;sum%=mod;}long fenzi=ans%mod*2%mod;long fenmu=n%mod;dduoln(fenzi%mod*pow(fenmu,mod-2,mod)%mod);} // 计算 q 在模 MOD 下的逆元 public static long modInverse(long q) { return pow(q, mod - 2, mod); } // 快速幂取模函数 public static long pow(long base, long exponent, long mod) { long result = 1; base = base % mod; while (exponent > 0) { if ((exponent & 1) == 1) { result =(long)((long) result * base % mod); } exponent = exponent >> 1; base = (long) ((long) base * base % mod); } return result; } public static void main(String[] args) throws Exception {int t = 1;
//        t = sc.nextInt();while (t-- > 0) {solve();}}static <T> void dduo(T t){System.out.print(t);}static <T> void dduoln(){System.out.println("");}static <T> void dduoln(T t){System.out.println(t);}}class IoScanner {BufferedReader bf;StringTokenizer st;BufferedWriter bw;public IoScanner() {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 {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 BigInteger nextBigInteger() throws IOException {return new BigInteger(next());}public BigDecimal nextDecimal() throws IOException {return new BigDecimal(next());}
}

http://www.dtcms.com/a/493920.html

相关文章:

  • 做营销型网站公司深圳网站营销公司简介
  • 如何做影视剧网站下列哪个不是网络营销成熟阶段出现的网络营销方式
  • 泰州网站制作平台潮州专业网站建设制作
  • 永嘉县住房和城乡建设局网站网页代码编辑器
  • .net招聘网站怎么做网站收录了没有排名
  • 广东网站建设方便企业网站推广建议
  • 化妆网站建设的目的大流量网站建设
  • iis 多网站信誉楼线上商城小程序
  • 一个网站需要多少钱深圳哪里做网站好
  • 如何在网站上做网页链接正在备案怎么建网站
  • 网站开发项目具体的流程设计接单网站大全
  • 做外汇网站做什么类型网站好网站专题策划案例
  • 网站建设企业网站价格企业服务公司经营范围是什么
  • 网站开发主要包括哪些方面建筑设计软件有哪些
  • 免费网站建设联系电话昆明做网站
  • vs2013可以做网站么优质的成都网站建设推
  • 网站备案信息加到哪里西宁哪家公司做网站
  • 手机触屏网站深圳在线直播
  • 顺的网站建设服务建站资讯
  • 网站做动态图片用云空间制作网站
  • 深圳外贸网站制作美的地产集团官方网站建设
  • 网站不备案不能用吗网站备案被注销
  • 网站建设与规划实验总结做网站创新互联
  • node做网站怎么知道蜘蛛来过平台如何制作网站
  • WordPress如何修改固定链接手机端网站优化
  • 做网站的优点建网站视频教程
  • 外贸网站国际化怎么做失信人信息查询
  • 淘宝网站运营的工作怎么做网站建设的文章
  • 鄂尔多斯建设局网站oa管理系统项目文档
  • 自适应网站如何做mip网页wordpress评论框加