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();
}
}
递增三元组
原题链接
问题描述
解题思路
排序 + 双指针
参考代码
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:这里是参考代码