# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
213594 |
2020-03-26T08:53:43 Z |
berryzed |
None (KRIII5P_1) |
Java 11 |
|
908 ms |
53756 KB |
import java.util.Scanner;
public class td {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int T = scanner.nextInt();
int[][] xy = new int[T][2];
for (int i = 0; i < T; i++) {
xy[i][0] = scanner.nextInt();
xy[i][1] = scanner.nextInt();
}
// 시간 날짜
for (int[] datetime : xy) {
System.out.println(checkTime(datetime) + " " + checkDate(datetime));
}
}
private static String checkDate(int[] date) {
if (date[0] >= 1 && date[0] <= 12 && date[1] >= 1 && date[1] <= getLastDay(date[0])) return "Yes";
return "No";
}
private static int getLastDay(int month) {
switch (month) {
case 2:
return 29;
case 4:
case 6:
case 9:
case 11:
return 30;
default:
return 31;
}
}
private static String checkTime(int[] time) {
if (time[0] >= 0 && time[0] <= 23 && time[1] >= 0 && time[1] <= 59) return "Yes";
return "No";
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
908 ms |
53756 KB |
Output is correct |