Pricing simulation for "BZOJ4029" "HEOI2015"

Source: Internet
Author: User

Link:
#include <stdio.h>int main(){    puts("转载请注明出处[vmurder]谢谢");    puts("网址:blog.csdn.net/vmurder/article/details/45334857");}
Exercises

The enumeration is followed by several 0 , and then every time (current request k A rear guide 0 ) to figure out the first one than L Big. < Span class= "Mrow" id= "mathjax-span-14" > 10 k Span style= "Display:inline-block; width:0px; Height:2.279em; " > Multiples, and the first one than L Big. 5 x Span class= "Msubsup" id= "mathjax-span-25" style= "PADDING-LEFT:0.22EM;" >10 k The multiple.
Then compare all these numbers.

Code:
#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>#define INF 0x3f3f3f3fusing namespace STD;Long LongAns,a,b,x;voidDfsLong LongDIV) {Long LongC= (A-1)/div+1) *div,c=0;if(C&GT;B)return;Long LongD= (A-1)/(5*DIV) +1)*(5*DIV), d=0;if(d>b) D=inf; for(Long LongT=c/div; T T/=Ten) c+=2; for(Long LongT=d/div; T T/=Ten) d+=2; d--;if(C<=d) {if(X&GT;C)            {x=c;        Ans=c; }    }Else{if(x>d)            {X=d;        Ans=d; }} DFS (div*Ten);}intMain () {intI,j,k,g; for(scanf("%d", &g); g--;) {Cin>>A>>B; X=inf,dfs (1);cout<<ans<<endl; }return 0;}

Pricing simulation for "BZOJ4029" "HEOI2015"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.