結果

問題 No.87 Advent Calendar Problem
ユーザー リチウム
提出日時 2014-12-07 12:32:01
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 432 bytes
コンパイル時間 2,910 ms
コンパイル使用メモリ 74,672 KB
実行使用メモリ 59,396 KB
最終ジャッジ日時 2024-06-11 16:02:02
合計ジャッジ時間 7,428 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 6 RE * 18
権限があれば一括ダウンロードができます

ソースコード

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.nextInt()-2014;
	  long amari=n-(n/400)*400;
	  long ans=57*((n-2014)/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