#include #include #include #define ARR_LEN (1000) int main(int argc, char** argv) { FILE* fp = fopen("input.txt", "r"); if(!fp) { printf("FUCK"); return -1; } int bit_ct[12]; int diagnostic_arr[ARR_LEN]; memset(diagnostic_arr, 0, ARR_LEN * sizeof(int)); memset(bit_ct, 0, 12 * sizeof(int)); char* line = NULL; size_t len = 0; for(int ind = 0; ind < ARR_LEN; ind++) { ssize_t rc = getline(&line, &len, fp); if(rc == -1) { break; printf("FUCK\n"); return -1; } diagnostic_arr[ind] = strtol(line, NULL, 2); for(int bit = 0; bit < 12; bit++) { bit_ct[bit] += ((diagnostic_arr[ind] & (1 << bit))>>bit); } } /* uncomment this if u want to make ur code run like python */ /* int mat[1000][10000000]; */ /* for(int zind = 0; zind < 1000; zind++) */ /* { */ /* for(int zzind = 0; zzind < 10000000; zzind++) */ /* { */ /* mat[zzind][zind]= 0; */ /* } */ /* } */ int gamma = 0; int dar = 0; for(int bit = 0; bit < 12; bit++) { gamma += ((bit_ct[bit] > (ARR_LEN >> 1))<> 1))<