1 solutions

  • 3
    @ 2025-5-22 17:00:12
    #include <stdio.h>
    
    int main() {
        int x, n;
        //第一周的运动天数
        int s = 0;
        //计算完整的周数
        int week;
        //计算剩余天数y
        int y;
        scanf("%d %d", &x, &n);
        //如果第一周有运动天数的情况
        if (x <= 5) {
            s = 5 - x + 1;
        }
        //计算有多少个完整周
        week = (n - (7 - x + 1)) / 7;
        //第一周消耗了(7-x+1)天
        y = (n - (7 - x + 1)) % 7;
        //如果剩余超过5,则直接算5天
        if (y > 5) {
            y = 5;
        }
        //总共的天数乘速度
        printf("%d\n", (s + week * 5 + y) * 250);
        return 0;
    }
    
    
  • 1

【深基3.习5】小鱼的航程(改进版)

Information

ID
1351
Time
1000ms
Memory
256MiB
Difficulty
4
Tags
(None)
# Submissions
75
Accepted
35
Uploaded By