Submission #22148

# Submission time Handle Problem Language Result Execution time Memory
22148 2017-04-29T12:29:32 Z _(:3」∠)_(#1025, xdoju) None (KRIII5P_1) C++11
7 / 7
3 ms 1116 KB
#include <cstdio>

int days[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

int main(){
  int T; scanf("%d", &T);
  for(; T--; ){
    int x, y; scanf("%d%d", &x, &y);

    printf("%s ", x >= 0 && x <= 23 && y >= 0 && y <= 59 ? "Yes" : "No");
    printf("%s\n", x >= 1 && x <= 12 && y >= 1 && y <= days[x] ? "Yes" : "No");
  }
  return 0;
}

Compilation message

td.cpp: In function 'int main()':
td.cpp:6:25: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   int T; scanf("%d", &T);
                         ^
td.cpp:8:36: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     int x, y; scanf("%d%d", &x, &y);
                                    ^
# Verdict Execution time Memory Grader output
1 Correct 3 ms 1116 KB Output is correct