C - Oleg and shares】的更多相关文章

Problem description Oleg the bank client checks share prices every day. There are n share prices he is interested in. Today he observed that each second exactly one of these prices decreases by k rubles (note that each second exactly one price change…
[题目链接]:http://codeforces.com/contest/793/problem/A [题意] 每次你可以对1..n中的任意一个数字进行减少k操作; 问你最后可不可能所有的数字都变成一样的; 可能的话输出最小操作次数; [题解] a[x1]-k*x1=t a[x2]-k*x2=t x1是对a[x1]的操作次数..以此类推 则有 a[x1]-a[x2]=k*(x2-x1) 可知a[x1]-a[x2]必然为k的倍数否则无解; 则升序排; 相邻两个数字的差必然要求为k的倍数; 即%k=…
Content 有 \(n\) 支股票,第 \(i\) 支股票原价为 \(a_i\) 卢布.每秒钟可能会有任意一支股票的价格下降 \(k\) 卢布,以至于降到负数.求所有股票的价格均变得相同所要经过的最短时间,或者这不可能. 数据范围:\(1\leqslant n\leqslant 10^5,1\leqslant k,a_i\leqslant 10^9\). Solution 因为股票的价格只能够下降,因此肯定是要求最后都要降到 \(n\) 支股票的价格的最小值 \(x\).然后,因为每秒下降…
A. Oleg and shares time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Oleg the bank client checks share prices every day. There are n share prices he is interested in. Today he observed that e…
http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interview down without punctuation marks and spaces to save time. Thus, the interview is now a string s consisting of n lowercase English letters. There is…
Quote from: http://www.wintips.org/how-to-enable-admin-shares-windows-7/ As “Administrative shares” are defined all the default network shares that can be accessed remotely only from network administrators. The Admin shares are hidden and they are di…
If have an observable and you subscribe it twice, those tow subscritions have no connection. console.clear(); var Observable = Rx.Observable; var _id = 1; var source = Observable.create(function(Observe){ var myId = _id++; Observe.onNext('Observable…
How to mount remote Windows shares Contents Required packages Basic method Better Method Even-better method Yet Another Even-better method OK, we live in the wonderful world of Linux. BUT, for many of us, having to deal with Windows is a fact of life…
Oleg Sych - » Pros and Cons of T4 in Visual Studio 2008 Pros and Cons of T4 in Visual Studio 2008 Posted by Oleg Sych January 1, 2009 T4 is a fully-featured, template-based code generation engine built into Visual Studio 2008. It offers rich function…
Interview with Oleg time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Polycarp has interviewed Oleg and has written the interview down without punctuation marks and spaces to save time. Thus,…