1 条题解

  • 1
    @ 2025-8-4 13:51:03
    using namespace std;
    int main() { 
        int weight; 
        char urgent; 
        cin >> weight >> urgent; 
        int total_cost = 8; 
        if (weight > 1000) { 
            int excess = weight - 1000; 
            int units = excess / 500; 
            if (excess % 500 != 0) { 
                units += 1; 
            } 
        total_cost += units * 4; 
        }
        if (urgent == 'y') {
            total_cost += 5;
        }
        cout << total_cost << endl;
        return 0;
    }
    
    
    
    
    
    • 1

    信息

    ID
    56
    时间
    1000ms
    内存
    256MiB
    难度
    4
    标签
    递交数
    151
    已通过
    68
    上传者