結果

問題 No.87 Advent Calendar Problem
ユーザー t8m8⛄️t8m8⛄️
提出日時 2015-04-09 14:13:11
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,137 bytes
コンパイル時間 3,510 ms
コンパイル使用メモリ 74,724 KB
実行使用メモリ 61,464 KB
最終ジャッジ日時 2023-09-17 19:01:25
合計ジャッジ時間 46,488 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,378 ms
58,620 KB
testcase_01 AC 2,565 ms
58,848 KB
testcase_02 WA -
testcase_03 AC 191 ms
57,068 KB
testcase_04 AC 201 ms
54,728 KB
testcase_05 AC 198 ms
56,428 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 3,078 ms
58,780 KB
testcase_13 WA -
testcase_14 AC 3,469 ms
57,056 KB
testcase_15 WA -
testcase_16 AC 361 ms
59,064 KB
testcase_17 WA -
testcase_18 AC 211 ms
56,308 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 1,154 ms
58,876 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

//No.87 Advent Calendar Problem

import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.lang.Math.*;

public class No87 {
    
    static final Scanner in = new Scanner(System.in);
    static final PrintWriter out = new PrintWriter(System.out,false);

    static void solve() {
        long n = in.nextLong()-2014;
        Calendar c = Calendar.getInstance();
        c.set(2014,7,23);
        int w = c.get(Calendar.DAY_OF_WEEK);
        int cnt = 0;
        while (n - 400 >= 0) {
            n -= 400;
            c.add(Calendar.DAY_OF_YEAR,400);
            cnt += 57;
        }
        for (int i=0; i<=n; i++) {
            c.add(Calendar.DAY_OF_YEAR,1);
            if (w == c.get(Calendar.DAY_OF_WEEK)) cnt++;
        }
        out.println(cnt);
    }

    public static void main(String[] args) {
        long start = System.currentTimeMillis();

        solve();
        out.flush();

        long end = System.currentTimeMillis();
        //trace(end-start + "ms");
        in.close();
        out.close();
    }

    static void trace(Object... o) { System.out.println(deepToString(o));}
}
0