摘要:
https://codeforces.com/contest/1467 A 有n个灯,每个灯一开始都是0,每一秒钟每个灯显示的数字会往上一位,但是由于每个灯只能显示单个数位,所以从9增大时得到的是0.在任意时刻,你可以指定唯一一个灯被停止,下一秒后,他相邻的两个灯也会进入暂停状态.问,在合理的设置一 阅读全文
摘要:
https://codeforces.com/contest/1473 A 题意:一个数组,可以用两个不同的元素替换掉另外一个元素,不限次数。问,能否使得数组中所有元素都不大于 d 。 思路:显然,如果所有元素都不大于d,那就执行0次。成立。如果有元素大于d,那就得替换掉,显然选择最小的两个元素进行 阅读全文
摘要:
A Problem Statement Given are strings S and T. Consider changing S to T by repeating the operation below. Find the minimum number of operations requir 阅读全文
摘要:
关于快速排序和归并排序 #include <bits/stdc++.h> using namespace std; void quick_sort(int q[], int l, int r){ if (l >= r) return; int i = l - 1, j = r + 1, x = q[ 阅读全文