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

做网站webform mvc商洛网站建设

做网站webform mvc,商洛网站建设,常州免费建站,大学生网站设计作品目录 题目地址 做题情况 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/wzjs/274596.html

相关文章:

  • 二手书交易网站开发与设计百度下载
  • 江苏省建设厅网站首页网络优化培训骗局
  • 九亭做网站公司拼多多关键词排名查询软件
  • WordPress文化衫六年级下册数学优化设计答案
  • 做网站 怎么提升浏览量重庆seo排名电话
  • 网站排名怎样做有效软服业营收破334亿
  • 景区门户网站建设的必要性企业营销策划书如何编写
  • 佛山市品牌网站建设价格爱站查询工具
  • 网站 数据库 模板免费的关键词优化工具
  • 网站修改关键字视频广告
  • 网站建设的需求怎么写网络营销策划方案
  • 访问不了服务器网站吗代运营靠谱吗
  • 网站建设公司有哪些原长沙营销型网站建设
  • 可以做免费广告的网站青岛网站建设策划
  • phpwind网站seo流量排名软件
  • 淄博哪有做网站的谷歌怎么推广自己的网站
  • 建网站数据库备案查询站长之家
  • 网站设计软件培训热狗seo外包
  • 广州网站设计成功柚米澎湃新闻
  • 做网站在后台如何添加链接提升seo排名平台
  • 网上开店营业执照怎么办理嘉兴seo外包公司
  • wordpress 网站生成app安卓优化大师下载安装
  • 做服装微商城网站app推广引流
  • 给网站做翻译关键词上首页软件
  • 大连建设网站哪家好北京网站优化托管
  • 怎么新增网站推广营销推广案例
  • 宁波网站建设哪家比较好百度云官网登录入口
  • 威客网站的功能品牌维护
  • 大作业网站建设方案sem是什么意思?
  • 淮安开发区建设局网站合肥网站优化seo