CodeChef submission 606664 (C) plaintext list. Status: CE, problem YALOP, contest . By keeper (keeper), 2011-07-25 18:46:27.

#include<stdio.h> #include<stdlib.h> void switchval(int *p, int *q) ; int main() { int i,trial,n,m,k,j,x,y,p,q ; int arr[40][40] ; for(i=0;i< trial ;i++) { if(k > m*n) { exit(0); } for(j=0;j<k;j++) { arr[x-1][y-1] = 1 ; } x=0 ;y=0 ; } return 0; } void switchval(int *p, int *q) { if(*p-1 >=0 && *q-1 >=0) arr[*p-1][*q-1] = 1 - arr[*p-1][*q-1]; if(*p-1 >= 0) { arr[*p-1][*q] = 1 - arr[*p-1][*q]; arr[*p-1][*q+1] = 1 - arr[*p-1][*q+1]; } if(*q-1 >= 0) { arr[*p][*q-1] = 1 - arr[*p][*q-1]; arr[*p+1][*q-1] = 1 - arr[*p+1][*q-1]; } arr[*p][*q] = 1 - arr[*p][*q]; arr[*p][*q+1] = 1 - arr[*p][*q+1]; arr[*p+1][*q] = 1 - arr[*p+1][*q]; arr[*p+1][*q+1] = 1 - arr[*p+1][*q+1]; }

## Comments

**Please login at the top to post a comment.**