# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
22219 | a (#42) | 시간과 날짜 (KRIII5P_1) | C++98 | 16 ms | 2020 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 |
---|---|---|---|---|
Fetching results... |