首页 > 其他分享 >北大ACM poj 1001

北大ACM poj 1001

时间:2023-08-21 17:03:52浏览次数:40  
标签:main bottom int top ACM ++ poj include 1001


网上搜来的借鉴一下

#include<stdio.h>
 main()
 {
     double f;
     int n,i,j;
     int top,bottom;
     int show;
     for(;~scanf("%lf%d",&f,&n);)
     {
         int p[300]={1},tmp=0;
         f*=1e6;
         for(i=0;i++<n;)
         {
             for(j=0;j<i*9;)
             {
                 tmp+=p[j]*f;
                 p[j++]=tmp%10;
                 tmp/=10;
             }
         }
         for(bottom=0;!p[++bottom]&&bottom<n*6;);
         show=0;
         for(top=j;bottom<top;)
         {
             if(top--==n*6||p[top])show=1;
             if(show)printf(top==n*6-1?".%d":"%d",p[top]);
         }
         puts("");
     }
 }

标签:main,bottom,int,top,ACM,++,poj,include,1001
From: https://blog.51cto.com/u_10101161/7177268

相关文章

  • 杭电ACM HDU 2816 I Love You Too
    ILoveYouTooTimeLimit:2000/1000MS(Java/Others)   MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):1258   AcceptedSubmission(s):759ProblemDescriptionThisisatruestory.Amanshowedhislovetoagirl,butthegirldi......
  • 杭电ACM HDU 3346 Lucky Number
    LuckyNumberTimeLimit:2000/1000MS(Java/Others)   MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):1523   AcceptedSubmission(s):800ProblemDescriptionToChinesepeople,8isaluckynumber.Nowyourtaskistojudgeifanu......
  • 杭电ACM HDU 2560 Buildings
    BuildingsTimeLimit:2000/1000MS(Java/Others)   MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):1828   AcceptedSubmission(s):1553ProblemDescriptionWedividetheHZNUCampusintoN*Mgrids.Asyoucanseefromthepicturebe......
  • 杭电ACM HDOJ 1039 Easier Done Than Said?
    EasierDoneThanSaid?TimeLimit:2000/1000MS(Java/Others)    MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):6387    AcceptedSubmission(s):3172ProblemDescriptionPasswordsecurityisatrickything.Usersprefersimplepas......
  • 杭电ACM HDU 3351 Seinfeld
    SeinfeldTimeLimit:2000/1000MS(Java/Others)   MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):1071   AcceptedSubmission(s):540ProblemDescriptionI’moutofstories.ForyearsI’vebeenwritingstories,somerathersilly,......
  • 西农2022级ACM招新考题
    准备放弃一段时间算法。西农2022级ACM招新上周结束了,五一假期研究了一下题解,整理发在博客。1.这真的是签到题print("\"ACMwelcomesyou\\n\"")2.4和数#include<bits/stdc++.h>usingnamespacestd;constintmaxn=1e6+10;intf[maxn+1];intl,r;boolche......
  • POJ 2828(线段树 单点更新)
    BuyTicketsTimeLimit: 4000MS MemoryLimit: 65536KTotalSubmissions: 16466 Accepted: 8201DescriptionRailwayticketsweredifficulttobuyaroundtheLunarNewYearinChina,sowemustgetupearlyandjoinalongqueue…TheLunarNewYearwasap......
  • ACM模式输入输出处理
    cin遇到\n会停止读取但是不会读出来1.数组长度确定,多组数据直接一个while循环输入151020输出630while(cin>>a>>b){cout<<a+b<<endl;}第一个数表示组数的,直接给个size,然后for循环输入2151020输出6302.数组长度不确定','分......
  • ACM常见格式提取代码
    1.提取指定范围符号内用逗号隔开数字vector<int>trans(string&str){size_tstart=str.find('[');size_tend=str.find(']');stringnumStr=str.substr(start+1,end-start-1);stringstreamss(numStr);intnumber;......
  • FTData063468_000001升级脚本出错,错误信息:SQL 脚本: 18.000.000.0048 DATA_DSTR_EAP_M
    一、问题:cjt15.0版本升级到18.0提示SQL脚本:18.000.000.0048DATA_DSTR_EAP_Mix_NL-11001出错:已在列上绑定了DEFAULT023-08-1019:46:39开始升级....2023-08-1019:46:39正在校验系统信息,请稍候...2023-08-1019:46:39[(000001)****]:开始升级2023-08-1019:46:39[(......