B:Button Bashing You recently acquired a new microwave, and noticed that it provides a large number of buttons to be able to quickly specify the time that the microwave should be running for. There are buttons both for adding time, and for subtractin…
题目链接:https://vjudge.net/contest/187496#problem/E E Excellent Engineers You are working for an agency that selects the best software engineers from Belgium, the Netherlands and Luxembourg for employment at various international companies. Given the ve…
A .A Prize No One Can Win 题意:给定N,S,你要从N个数中选最多是数,使得任意两个之和不大于S. 思路:排序,然后贪心的选即可. #include<bits/stdc++.h> #define ll long long #define rep(i,a,b) for(int i=a;i<=b;i++) using namespace std; ; ll a[maxn]; int main() { int N,ans; ll M; scanf("%d%ll…
题目大意:给你一个数字n(n<=1e9) ,让你求一个能包含这个数的斐波那契数列的第一项a 和第二项b,找出b最小的那个. 帮我复习了一下扩展欧几里得.... 思路:a,b,a+b,a+2b……我们能枚举出50项内,每一项的a和b的数量,然后就是从后往前解 二元一次方程. 其实以a为第一项,b为第二项的斐波那切数列公式为,a[ i ]=f[ i - 1 ] * x+f[ i ]*y. #include<bits/stdc++.h> #define ll long long using n…