結果
問題 | No.87 Advent Calendar Problem |
ユーザー | uafr_cs |
提出日時 | 2015-06-15 15:19:09 |
言語 | Java21 (openjdk 21) |
結果 |
RE
|
実行時間 | - |
コード長 | 670 bytes |
コンパイル時間 | 2,178 ms |
コンパイル使用メモリ | 72,060 KB |
実行使用メモリ | 60,156 KB |
最終ジャッジ日時 | 2023-09-21 02:09:07 |
合計ジャッジ時間 | 9,385 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | RE | - |
testcase_01 | RE | - |
testcase_02 | TLE | - |
testcase_03 | -- | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
ソースコード
import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.Scanner; import java.util.Set; import java.util.TreeSet; public class Main { public static final int zeller(int y, int m, int d){ if(m <= 2){ y--; m+=12;} return (d + 26*(m+1)/10 + y + y/4 + 6*(y/100) + y/400) % 7; } public static void main(String[] args){ Scanner sc = new Scanner(System.in); final int mod_2014 = zeller(2014, 7, 23); final int N = sc.nextInt(); int answer = 0; for(int i = 2015; i <= N; i++){ if(zeller(i, 7, 23) == mod_2014){ answer++; } } System.out.println(answer); } }