摘要:
题解 class CQueue { Stack<Integer> a, b; public CQueue() { a = new Stack<Integer>(); b = new Stack<Integer>(); } public void appendTail(int value) { a.p 阅读全文
摘要:
题解 排序后相邻比较 将数组进行排序之后相邻元素进行比较即可。 时间复杂度:O(n$log_n$) 空间复杂度:O(1) class Solution { public int findRepeatNumber(int[] nums) { Arrays.sort(nums); for(int i = 阅读全文
摘要:
AcWing 1227.分巧克力 题解 使用整数二分,判定应该向哪边分,最后就是答案 #include <bits/stdc++.h> using namespace std; const int N = 100010; int n, k; vector<pair<int,int>> a; int 阅读全文