```1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 ``` ```#include #include #include #define search(a, n) bsearch(a, n, sizeof(int), compare); #define sort(a, n) qsort(a, n, sizeof(int), compare); #define FOR(i, a, n) for(i = a; i < n; i++) #define loop(i, n) FOR(i, 0, n) int compare (const void * a, const void * b) { return ( *(int*)a - *(int*)b ); } int main() { char a[110][2][2], p, q, r, s; int n, i, j, k, count = 0; scanf(" %d", &n); loop(i, n) { int flag = 0; scanf(" %c%c\n%c%c", &p, &q, &r, &s); if(i != n-1) scanf(" **"); loop(j, count) { if(a[j][0][0] == p && a[j][0][1] == q && a[j][1][0] == r && a[j][1][1] == s) { flag = 1; break; } else if(a[j][1][0] == p && a[j][0][0] == q && a[j][1][1] == r && a[j][0][1] == s) { flag = 1; break; } if(a[j][1][1] == p && a[j][1][0] == q && a[j][0][1] == r && a[j][0][0] == s) { flag = 1; break; } if(a[j][0][1] == p && a[j][1][1] == q && a[j][0][0] == r && a[j][1][0] == s) { flag = 1; break; } } if(flag == 0) { a[count][0][0] = p; a[count][0][1] = q; a[count][1][0] = r; a[count][1][1] = s; count ++; } } printf("%d", count); return 0; } ```
 ```1 ``` ```Timeout ```