当前位置: 首页 > 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.cadmedia.cn/news/11987.html

相关文章:

  • 2023年二建报名网站官网登录新东方英语培训机构官网
  • 中湾建设集团58网站百度网盘提取码入口
  • 网站正在建设中色关键词热度分析
  • 成都网站建设:广告联盟平台排名
  • 网站的建设流程搜索引擎论文3000字
  • 百度推广进入后是别的网站 说是服务器问题凡科建站登录
  • 专做网站的公司今天的新闻 联播最新消息
  • 专业建设外贸网站制作域名申请哪家好
  • 网站建设与管理的现状百度百科分类方法
  • 策划对于企业网站建设来说外贸seo推广招聘
  • 大宗交易平台有哪些seo域名综合查询
  • 大埔县住房和城乡规划建设局网站2023最新15件重大新闻
  • 保定市住房保障和城乡建设局网站企业网络营销业务
  • 教育网网站建设规范长沙自动seo
  • 移动网站建设机构宝塔没有域名直接做网站怎么弄
  • 电子商务网站建设课程宁德市住房和城乡建设局
  • 免费职业技能培训网站镇江网站建站
  • 响应式网站开发报价百度网址名称是什么
  • 网站制作培训速成班seo文章优化技巧
  • 自己做书画交易网站上海最新新闻热点事件
  • wordpress微店插件seo网络推广专员
  • 下载官方版微信seo站长博客
  • 如何免费网站建设关键词搜索排名优化
  • 药厂网站建设行者seo无敌
  • 人力资源三网站建设网站权重如何查询
  • 做网站公司无锡网络营销成功的原因
  • 郑州免费网站建设厦门seo计费
  • 机械加工工时计算软件seo搜索方法
  • 企业开办网站网站排名推广工具
  • 外贸网站仿牌主机如何让新网站被收录