第十四届蓝桥杯三月真题刷题训练——第 17 天

ASC

原题链接

ASC

问题描述

已知大写字母 A 的 ASCII 码为 65,请问大写字母 L 的 ASCII 码是多少?

解题思路

水题

参考代码

import java.io.*;

public class Main {

    static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    public static void main(String[] args) throws Exception {
    	out.println(65 + 'L' - 'A');

        out.flush();
        in.close();
    }  
}

递增三元组

原题链接

递增三元组

问题描述

todo:这里复制题目描述

解题思路

排序 + 双指针

参考代码

import java.util.*;
import java.math.*;
import java.io.*;

public class Main {

    static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    // static StreamTokenizer st = new StreamTokenizer(in);
    static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    
    static int N = (int)1e5 + 10, n;
    static int[] a = new int[N], b = new int[N], c = new int[N];
    
    public static void helper(int[] arr) throws IOException {
    	String[] s = in.readLine().split(" ");
    	for (int i = 0; i < n; i++) arr[i] = Integer.parseInt(s[i]);
    	Arrays.sort(arr, 0, n);
    }
    
    public static void main(String[] args) throws Exception {
    	n = Integer.parseInt(in.readLine());
    	helper(a);
    	helper(b);
    	helper(c);
    	
    	long ans = 0L;
    	int x = 0, y = 0;
    	for (int i = 0; i < n; i++) {
    		while (x < n && a[x] < b[i]) x++;
    		while (y < n && c[y] <= b[i]) y++;
    		ans += (long)x * (n - y);
    	}
    	
    	out.println(ans);

        out.flush();
        in.close();
    }  
}

环境治理

原题链接

环境治理

问题描述

todo:这里复制题目描述

解题思路

todo:这里是解题思路

参考代码

todo:这里是参考代码

小球称重

原题链接

小球称重

问题描述

todo:这里复制题目描述

解题思路

todo:这里是解题思路

参考代码

todo:这里是参考代码

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值