CodeForces 413A 手速题

//CodeForces 413A

 1 #include "iostream"
 2 #include "cstdio"
 3 #include "cstring"
 4 #include "algorithm"
 5 #include "vector"
 6 using namespace std;
 7 int n, m, Min, Max;
 8 
 9 int main()
10 {
11     int i;
12     scanf("%d%d%d%d", &n, &m, &Min, &Max);
13     bool MIN, MAX, OVERL;
14     MIN = MAX = 0;
15     OVERL = 0;
16     int ans;
17     for(i = 1; i <= m; ++i) {
18         scanf("%d", &ans);
19         if(ans == Min)
20             MIN = 1;
21         else if(ans == Max)
22             MAX = 1;
23         else if(ans < Min || ans > Max) {
24             OVERL = 1;
25             break;
26         }
27     }
28     if(OVERL)
29         printf("Incorrect\n");
30     else {
31         n -= m;
32         if(!MIN)
33             --n;
34         if(!MAX)
35             --n;
36         if(n < 0)
37             printf("Incorrect\n");
38         else
39             printf("Correct\n");
40     }
41 }

 

posted @ 2015-02-24 18:16  AC_Phoenix  阅读(229)  评论(0编辑  收藏  举报