CF 135 DIV2 B Special Offer! Super Price 999 Bourles!
来源:http://codeforces.com/contest/219/problem/B 题意:就是一个物品有一个价,这个价可以最多降低d,求在所下降价不超过d的情况下,能够使价有最多的9且价最高.拿样例来说, 1029 102 原价为1029,最多可下降102元,在符合条件的范围内,能够取得最多的
来源:http://codeforces.com/contest/219/problem/B
题意:就是一个物品有一个价格,这个价格可以最多降低d,求在所下降价格不超过d的情况下,能够使价格有最多的9且价格最高.拿样例来说,
1029 102
原价为1029,最多可下降102元,在符合条件的范围内,能够取得最多的9且价格最高的是999.若没有 符合条件的情况,则输出原价。
思路:首先求出原价的位数,然后计算最多有多少个9,和原价比较以及判断是否符合条件。之后就是一个模拟的过程,一点一点加,直到找到符合条件的借。中间有一些细节需要注意,而且中间运算还有可能超过__int64,都需要处理一下。
代码:
<pre class="brush:php;toolbar:false">#include <iostream> #include <string.h> #include <cstdio> using namespace std; typedef unsigned __int64 LL; int fun(LL x){ int sum = 0; while(x){ sum++; x /= 10; } return sum ; } LL cal(int x){ LL sum = 0; for(int i = 1; i = value && ans p){ z = z - 9; printf("%I64d\n",p); continue; } LL num = 0,xx = 0,yy = 0; LL cnt = 1; while(z <br><br></cstdio></string.h></iostream>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics





According to news from this site on January 6, Gigabyte’s RTX4080SUPER, RTX4070TiSUPER and RTX4070SUPER graphics cards have been exposed and are expected to be released at 0:00 on January 9th. As shown in the picture above, the logo of the Nvidia RTX40SUPER graphics card has changed. SUPER is all uppercase, while the RTX20 series has lowercase super. RTX20superlogo This site summarizes the revealed specifications and prices of the RTX40SUPER graphics card as follows: RTX4080SUPER is equipped with 10240CUDA core and 16GB23Gbps256bitGDDR6X video memory, priced at US$999 (currently about 7153 yuan) or US$1199 (currently about 7153 yuan)

1. static Please look at the following program first: publicclassHello{publicstaticvoidmain(String[]args){//(1)System.out.println("Hello, world!");//(2)}} Have seen this Segment programs are familiar to most people who have studied Java. Even if you have not learned Java but have learned other high-level languages, such as C, you should be able to understand the meaning of this code. It simply outputs "Hello, world" and has no other use. However, it shows the main purpose of the static keyword.

To understand covariance and contravariance, we must first introduce: According to the Liskov substitution principle, if C is a subclass of P, then P can replace C, that is, Pp=newC(); C inherits from P, denoted as C

Sleeping Dogs: Definitive Edition is currently available at a heavily discounted price of just $2.99 on GOG, offering a massive 85% reduction from its original price of $19.99. To take advantage of this deal, simply visit the game's page on GOG, add

This article introduces in detail the installation method of Ouyi OKX trading platform, covering three platforms: Android phone, Windows system and Mac system. Android mobile phone users can download and install it through the Google Play Store; while Windows and Mac users need to visit Ouyi OKX official website to download the corresponding system installation package for installation. The article provides detailed guides on each step, which facilitates users to quickly complete the installation and immediately experience the services provided by Ouyi OKX. Come and download Ouyi OKX and start your digital asset journey!

supersuper is a keyword, all lowercase. Comparative study of super and this, both "this/super." appear in instance methods, "this/super()" appears in constructor methods this: (1) this can appear in instance methods and constructor methods. (2) The syntax of this is: "this.", "this()" (3) This cannot be used in static methods. (4) This. can be omitted in most cases. (5) When can this. not be omitted? It cannot be omitted when distinguishing between local variables and instance variables. publicvoidsetName(S

Many job seekers will choose to use the boss direct recruitment software when looking for a job. It provides users with a convenient and efficient job search experience, but many players still don’t know where to check the boss direct recruitment offers. So in the following, let us follow the editor's introduction and learn more about how to check your own offers. Users who want to know more can follow this article to find out! Where to find the answer to the boss’s direct recruitment offer: [Boss direct recruitment]-[Message]. Specific steps: 1. First open the boss direct recruitment software. After entering the home page, you can see the relevant information. Here we click [Message] at the bottom of the page; 2. After coming to the message page, we can view it.

With the development of 5G technology, people are paying more and more attention to 5G mobile phones. As one of China's most well-known communication equipment manufacturers, Huawei has been leading the research, development and application of 5G technology. In 2019, Huawei launched a number of 5G mobile phones, including the Huawei P60 series. So, is Huawei P60 a 5G mobile phone? Let us discuss it now. First of all, we need to make it clear that Huawei P60 series mobile phones are not 5G mobile phones. Huawei P60 series released in 2019, they
