Beautiful women in tights
. . . . . 分析
1/k=1/x+y/1
對於x、y這兩個未知數,我們嘗試把y消掉
經過一番折騰, 我們得出:
(x-n)/nx=1/y
即
nx/(x-n)=y
對於答案來說,若nx能整除(x-n),則ans+1
接下來考慮x的範圍
由 nx/(x-n)=y/1 可得 x-n>=1 x >=x+1
其次 x>=y 可得 nx/(x-n)>=x nx>=x(x-n) n>=x-n n+n>=x 得:x<=2n
綜上,n+1<=x<=2n
. . . . . . 程式:
#include<iostream> #include<cstdio> using namespace std; int main() { int ans=0,k; scanf("%d",&k); for (int x=k+1;x<=2*k;x++) if ((k*x)%(x-k)==0) ans++; printf("%d",ans); return 0; }
相關推薦
Beautiful women in tights
. . . . . 分析 1/k=1/x+y/1 對於x、y這兩個未知數,我們嘗試把y消掉 經過一番折騰, 我們得出: (x-n)/nx=1/y 即 nx/(x-n)=y 對於答案來說,若
Women in Tech: Why Are Female Employees Still Underrepresented In This Sector?
Women in Tech: Why Are Female Employees Still Underrepresented In This Sector?The IT sector is rapidly expanding. It’s almost impossible to find an industr
Report Card: Customizing Our Women in Tech High School Trainee Program
Mentor Quentin (left) with Trainee Bresy (right) Bresy joined the program after completing her freshman year at Eastside College Prep, and entered the pr
October SalesTech event recap: Women in Sales
October’s Salestech event was dedicated to celebrating women in Sales. We invited four women who have had active and successful careers in Sales to speak a
Rising Stars in EECS supports women in electrical engineering and computer science
For women in engineering, getting ahead sometimes means trying to be "one of the guys." That's why Margarita Paz Castro says she enjoyed attending Rising S
Some beautiful Progress Bars in WPF
del ref wpf beautiful tps inf net bubuko scott 1.Better WPF Circular Progress Bar 2.Bending the WPF ProgressBar 3.A CIRCULAR PROGR
Beautiful and Powerful Correlation Tables in R
select auto edit for open sat local plot fig Another correlation function?! Yes, the correlation function from the psycho package. devt
These 5 Women Deserved, And Were Unjustly Denied, A Nobel Prize In Physics
Nobel season is now over, with another year in the books of celebrating the scientists who pioneered some of the greatest advances in physics, chemistry, m
UX Case Study: Simplest and Most Beautiful Banking Design in The World, As We See It
What if there was a banking solution designed by Apple? Would all the other digital financial services be forced out of business? There are rumors about wh
Women Seen Making Inroads into AI Development in 2018
Let’s make one thing clear: one year isn’t going to fix decades of gender discrimination in computer science and all the problems
BNUOJ 52511 Keep In Line
class blog ring break 需要 main code bre 是否 隊列,$map$。 每次出隊進行出隊操作的是時候,先把隊列中需要出隊的人全部出隊,然後比較對頭和當前出隊的人是否相同。 #include<bits/stdc++.h>
Find Minimum in Rotated Sorted Array II
number mce minimum div ant remove span col mean The worst situation O(N). Actually we can either just loop through, or we can compare nu
Search in Rotated Sorted Array
earch search ted int turn urn div cnblogs || O(logN) Important Point: Once the target is in one section, use the point in that section as
Search in Rotated Sorted Array II
any int param repeat loop return i++ turn through O(N) if element can repeat, the worst case, you cannot throw away any section. eg. [1,
《Thinking in Java》 And 《Effective Java》啃起來
大學 前言 技術 數據結構和算法 解決 一句話 定義 應該 太多的 前言 今天從京東入手了兩本書,《Thinking in Java》(第四版) 和 《Effective Java》(第二版)。都可以稱得上是硬書,需要慢慢啃的,預定計劃是在今年前把這兩本書啃完。哈哈,可
poj 2559 Largest Rectangle in a Histogram 棧
hist func opc txt class sse typedef ++ limit // poj 2559 Largest Rectangle in a Histogram 棧 // // n個矩形排在一塊,不同的高度,讓你求最大的矩形的面積(矩形緊挨在一起)
for-in
們的 下標 func 可能 image arr http 是否 不能 先看一個例子: Array.prototype.searchItem = function(value){//函數已被簡化 return right; } var
Codeforces 55D Beautiful numbers(數位dp)
pac urn etc number div clu 能夠 是我 tdi 題目大意:T(<=10)組數據,求[a,b]能夠被其每個數位的數都整除的數(a,b<=9*10^18) 這題差一點就想出來了,可是最後一步好難想也好妙啊 首先這個數能夠整除各個
[3 Jun 2015 ~ 9 Jun 2015] Deep Learning in arxiv
with center spa multi only vol them res multipl arXiv is an e-print service in the fields of physics, mathematics, computer science, qu
解決mysql報錯:- Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ'
_for tran contains column schema mysql eat table express mysql執行報錯: - Expression #1 of ORDER BY clause is not in GROUP BY clause and cont