結果

問題 No.87 Advent Calendar Problem
ユーザー リチウムリチウム
提出日時 2014-12-07 12:32:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 238 ms / 5,000 ms
コード長 426 bytes
コンパイル時間 3,339 ms
コンパイル使用メモリ 72,836 KB
実行使用メモリ 59,324 KB
最終ジャッジ日時 2023-09-02 09:14:07
合計ジャッジ時間 10,626 ms
ジャッジサーバーID
(参考情報)
judge16 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 217 ms
59,076 KB
testcase_01 AC 220 ms
58,980 KB
testcase_02 AC 229 ms
58,892 KB
testcase_03 AC 208 ms
56,408 KB
testcase_04 AC 206 ms
56,644 KB
testcase_05 AC 221 ms
58,988 KB
testcase_06 AC 222 ms
59,276 KB
testcase_07 AC 216 ms
59,224 KB
testcase_08 AC 227 ms
58,644 KB
testcase_09 AC 238 ms
59,084 KB
testcase_10 AC 216 ms
58,680 KB
testcase_11 AC 216 ms
56,916 KB
testcase_12 AC 232 ms
56,724 KB
testcase_13 AC 234 ms
58,640 KB
testcase_14 AC 224 ms
59,120 KB
testcase_15 AC 227 ms
59,076 KB
testcase_16 AC 128 ms
56,036 KB
testcase_17 AC 229 ms
59,324 KB
testcase_18 AC 207 ms
58,680 KB
testcase_19 AC 230 ms
59,136 KB
testcase_20 AC 228 ms
58,852 KB
testcase_21 AC 219 ms
58,984 KB
testcase_22 AC 206 ms
56,600 KB
testcase_23 AC 219 ms
56,948 KB
testcase_24 AC 197 ms
57,424 KB
testcase_25 AC 218 ms
58,576 KB
testcase_26 AC 228 ms
59,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import static java.lang.Math.*; 
public class ppp {
			
  public static void main(String[] args) {
	  Scanner sc=new Scanner(System.in);
	  long n=sc.nextLong()-2014;
	  long amari=n-(n/400)*400;
	  long ans=57*(n/400);
	  for(int i=2015;i<=2014+amari;i++){
		  Calendar c = new GregorianCalendar(i, 7-1, 23);
		  if(c.get(Calendar.DAY_OF_WEEK)==4)ans++;
	  }
	  System.out.println(ans);
  }}
0