1 条题解

  • 0
    @ 2025-4-14 18:45:31

    C++ :

    #include<stdio.h>
    
    int main()
    {
        int n,v,t,temp,ans;
        double tt;
    
        while( scanf("%d", &n) && n )
        {
            ans=1<<30;
            while(n--)
            {
                scanf("%d%d", &v, &t);
                if( t>=0 )
                {
                    tt = (4.5*3600/v);//计算到达终点所需时间
                    if( tt-(int)tt>0 ) tt++;//秒数应取整
                    temp=tt+t;//计算到达时间
                    if( ans>temp ) ans=temp;
                }
            }
            printf("%d\n",ans);
        }
        return 0;
    }
    
    • 1

    信息

    ID
    3571
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者