結果
| 問題 | No.87 Advent Calendar Problem |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2014-12-07 12:32:54 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 147 ms / 5,000 ms |
| + 240µs | |
| コード長 | 426 bytes |
| 記録 | |
| コンパイル時間 | 2,445 ms |
| コンパイル使用メモリ | 84,596 KB |
| 実行使用メモリ | 48,080 KB |
| 最終ジャッジ日時 | 2026-07-25 14:01:37 |
| 合計ジャッジ時間 | 7,890 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
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);
}}