zoukankan      html  css  js  c++  java
  • Gym

    Gym - 100941G

    https://vjudge.net/problem/Gym-100941G
    比赛的时候真的是不会啊,那就没办法了。
    结论:每x周减一次头发,第k次剪发时的头发长度为x^k。
    x^k=L,x=L^(1/k)
    ans=kx=k*L^(1/k)

    #include <iostream>
    #include <cstdio>
    #include <queue>
    #include <algorithm>
    #include <cmath>
    #include <cstring>
    #define inf 2147483647
    #define N 1000010
    #define p(a) putchar(a)
    #define For(i,a,b) for(int i=a;i<=b;++i)
    
    using namespace std;
    double ans,L;
    void in(int &x){
        int y=1;char c=getchar();x=0;
        while(c<'0'||c>'9'){if(c=='-')y=-1;c=getchar();}
        while(c<='9'&&c>='0'){ x=(x<<1)+(x<<3)+c-'0';c=getchar();}
        x*=y;
    }
    void o(int x){
        if(x<0){p('-');x=-x;}
        if(x>9)o(x/10);
        p(x%10+'0');
    }
    
    signed main(){
        freopen("princess.in","r",stdin);
        freopen("princess.out","w",stdout);
        cin>>L;
        ans=1e9;
        For(k,1,400)
            ans=min(ans,(double)k*pow(L,1.0/(double)k));
        printf("%.6f",ans);
        return 0;
    }
  • 相关阅读:
    网络协议 22
    网络协议 21
    网络协议 20
    网络协议 19
    网络协议 18
    网络协议 17
    网络协议 16
    网络协议 15
    网络协议 14
    .net 4.0 中的特性总结(五):并行编程
  • 原文地址:https://www.cnblogs.com/war1111/p/11311321.html
Copyright © 2011-2022 走看看