Submission #22219

# Submission time Handle Problem Language Result Execution time Memory
22219 2017-04-30T01:39:19 Z a(#1038, wimzzang) None (KRIII5P_1) C++
7 / 7
16 ms 2020 KB
#include <iostream>
#include <stdio.h>

using namespace std;

bool isTimeRead(int x, int y) {
	if ((0 <= x&&x <= 23) && (0 <= y&&y <= 59)) return true;
	return false;
}
bool isDateRead(int x, int y) {
	switch (x)
	{
	case 1:
	case 3:
	case 5:
	case 7:
	case 8:
	case 10:
	case 12:
		if (1 <= y&&y <= 31) return true;
	case 4:
	case 6:
	case 9:
	case 11:
		if (1 <= y&&y <= 30) return true;
	case 2:
		if (1 <= y&&y <= 29) return true;
	}
	return false;
}
int main()
{
	//freopen("input.txt", "r", stdin);
	//setbuf(stdout, NULL);
	int testCase; cin >> testCase;
	for (int t = 1; t <= testCase; t++)
	{
		int x, y;
		cin >> x >> y;
		cout << (isTimeRead(x, y) ? "Yes " : "No ");
		cout << (isDateRead(x, y) ? "Yes" : "No") << endl;
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 16 ms 2020 KB Output is correct