結果

問題 No.87 Advent Calendar Problem
ユーザー t8m8⛄️t8m8⛄️
提出日時 2015-04-09 14:11:39
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 1,135 bytes
コンパイル時間 4,086 ms
コンパイル使用メモリ 74,732 KB
実行使用メモリ 59,380 KB
最終ジャッジ日時 2023-09-17 19:00:25
合計ジャッジ時間 10,423 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 WA -
testcase_03 AC 200 ms
56,664 KB
testcase_04 AC 198 ms
56,860 KB
testcase_05 AC 213 ms
56,776 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 349 ms
59,148 KB
testcase_17 WA -
testcase_18 AC 197 ms
56,832 KB
testcase_19 WA -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 WA -
testcase_26 RE -
権限があれば一括ダウンロードができます

ソースコード

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() {
        int n = in.nextInt()-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