結果
| 問題 | No.87 Advent Calendar Problem |
| コンテスト | |
| ユーザー |
t8m8⛄️
|
| 提出日時 | 2015-04-09 14:11:39 |
| 言語 | Java (openjdk 25.0.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,135 bytes |
| 記録 | |
| コンパイル時間 | 3,372 ms |
| コンパイル使用メモリ | 78,300 KB |
| 実行使用メモリ | 45,464 KB |
| 最終ジャッジ日時 | 2024-07-04 13:23:54 |
| 合計ジャッジ時間 | 9,637 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 2 WA * 4 RE * 18 |
ソースコード
//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));}
}
t8m8⛄️