結果
| 問題 | No.3402 [Cherry Anniversary 5] Beyond Zelkova, the 5th year vista seen through the bloom of a cherry bloosom |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-12-26 15:28:38 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 688 ms / 2,000 ms |
| コード長 | 1,287 bytes |
| 記録 | |
| コンパイル時間 | 2,988 ms |
| コンパイル使用メモリ | 82,344 KB |
| 実行使用メモリ | 53,224 KB |
| 最終ジャッジ日時 | 2025-12-26 15:28:55 |
| 合計ジャッジ時間 | 16,878 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 24 |
ソースコード
import java.util.Scanner;
import java.io.PrintWriter;
import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
import java.util.stream.IntStream;
class Main {
private static final Scanner sc = new Scanner(System.in);
private static final PrintWriter pw = new PrintWriter(System.out);
public static void main(final String[] args) {
final int ys = sc.nextInt(), ms = sc.nextInt(), ss = sc.nextInt();
final int ye = sc.nextInt(), me = sc.nextInt(), se = sc.nextInt();
final LocalDate start = LocalDate.of(ys, ms, ss), end = LocalDate.of(ye, me, se);
final long past = ChronoUnit.DAYS.between(start, end);
final int q = sc.nextInt();
IntStream.range(0, q).forEach(i -> {
final int y = sc.nextInt(), m = sc.nextInt(), s = sc.nextInt();
final LocalDate cur = LocalDate.of(y, m, s);
final long term = ChronoUnit.DAYS.between(end.plusDays(1), cur);
if (term < past) {
pw.println("Less");
} else if(term > past) {
pw.println("More");
} else {
pw.println("Same");
}
});
pw.flush();
pw.close();
sc.close();
}
}