C. Phone Numbers time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output And where the are the phone numbers? You are given a string s consisting of lowercase English letters and an integer k. Find th…
B. Our Tanya is Crying Out Loud time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Right now she actually isn't. But she will be, if you don't solve this problem. You are given integers n, k, A an…
构造题 话说挺水的题..当时怎么就WA到自闭呢.. 先把每个位置按照最低要求填满,也就是相差1..然后从最后一位开始把剩下的数加上,直到不能加为止. #include <bits/stdc++.h> #define INF 0x3f3f3f3f #define full(a, b) memset(a, b, sizeof a) using namespace std; typedef long long ll; inline int lowbit(int x){ return x &…
数论 gcd 看到这个题其实知道应该是和(a+k)(b+k)/gcd(a+k,b+k)有关,但是之后推了半天,思路全无. 然而..有一个引理: gcd(a, b) = gcd(a, b - a) = gcd(b, b - a) (b > a) 证明一下: 令 gcd(a, b) = c, (b > a) 则有 a % c = 0, b % c = 0 那么 (a - b) % c = 0 令 gcd(a, b - a) = c', 假设c' != c 则有 a % c' = 0, (b - a…