您当前的位置: 首页 >  Java

星拱北辰

暂无认证

  • 0浏览

    0关注

    1205博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

到天宫做客(洛谷P1178题题解,Java语言描述)

星拱北辰 发布时间:2020-05-05 10:54:43 ,浏览量:0

题目要求

题目链接

在这里插入图片描述

分析

早期代码大概是这么写的,先是用了Date,结果连样例都过不去,就换了日期数组自己做,还是不对。

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Set time_set = new TreeSet();
        int[] month_list = {0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335};
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        time_set.add(0L);
        time_set.add(366L*24*3600);
        for (int i = 0; i             
关注
打赏
1660750074
查看更多评论
0.0553s