{"id":260,"date":"2016-04-18T11:09:43","date_gmt":"2016-04-18T11:09:43","guid":{"rendered":"http:\/\/emacslisp.com\/?p=260"},"modified":"2016-04-18T11:10:09","modified_gmt":"2016-04-18T11:10:09","slug":"google-codejam-problem-b-rank-and-file","status":"publish","type":"post","link":"http:\/\/emacslisp.com\/?p=260","title":{"rendered":"Google CodeJam &#8211; Problem B. Rank and File"},"content":{"rendered":"<p>https:\/\/code.google.com\/codejam\/contest\/4304486\/dashboard#s=p1&#038;a=2<\/p>\n<p>the idea is very simple, every items on the matrix will appear even time, therefore, for the row which is missing, all items should have odd times.<\/p>\n<p>the code is following<\/p>\n<pre lang=\"c\" line=\"1\">\r\n#include <stdio.h>\r\n#include <string.h>\r\n#include <stdlib.h>\r\n#include <math.h>\r\n\r\nint main(int argc,char **argv) \r\n{ \r\n  int N;\r\n  int array[3000];\r\n  scanf(\"%d\\n\",&N);\r\n\r\n  for(int i=0;i<N;i++)\r\n  {\r\n\t  int T;\r\n\t  scanf(\"%d\\n\",&#038;T);\r\n\t  memset(array,0,sizeof(int)*3000);\r\n\r\n\t  int temp;\r\n\t  for(int m=0;m<2*T-1;m++)\r\n\t  {\r\n\t\t  for(int n=0;n<T;n++)\r\n\t\t  {\r\n\t\t\tscanf(\"%d\",&#038;temp);\r\n\t\t\tarray[temp]++;\r\n\t\t  }\r\n\t  }\r\n\r\n\t  printf(\"Case #%d: \",(i+1));\r\n\r\n\t  for(int m=0;m<3000;m++)\r\n\t  {\r\n\t\t  if(array[m]>0 && array[m]%2==1)\r\n\t\t  {\r\n\t\t\t  printf(\"%d \",m);\r\n\t\t  }\r\n\t  }\r\n\t  printf(\"\\n\");\r\n  }\r\n\r\n  return 0; \r\n}\r\n <\/pre>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/code.google.com\/codejam\/contest\/4304486\/dashboard#s=p1&#038;a=2 the idea is very simple, every items on the matrix will appear even time, therefore, for the row which is missing, all items should have odd times. the code is following #include #include #include #include int main(int argc,char **argv) { int N; int array[3000]; scanf(&#8220;%d\\n&#8221;,&#038;N); for(int i=0;i<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-260","post","type-post","status-publish","format-standard","hentry","category-googlecodejam"],"_links":{"self":[{"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/posts\/260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/emacslisp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=260"}],"version-history":[{"count":1,"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/posts\/260\/revisions"}],"predecessor-version":[{"id":261,"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/posts\/260\/revisions\/261"}],"wp:attachment":[{"href":"http:\/\/emacslisp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/emacslisp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=260"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/emacslisp.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}