{"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "dd4575bb684586ba0efb14966060fab8", "src_uid": "023b169765e81d896cdc1184e5a82b22", "difficulty": 1100} {"lang": "PHP", "source_code": " $k) $total++;\n\t\telse break;\n\t}\n\techo $total;\n?>", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "eb0460f03c6a3635740659d7b69d6994", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800} {"lang": "PHP", "source_code": "\n", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "382c3e273b71366357f906c6c4c7cf68", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800} {"lang": "PHP", "source_code": " 0)\n\t{\n\t\tfor($i=0;$i<=$x;$i++)\n\t\t{\n\t\t\tif($a[$i] >= $score)\n\t\t\t{\n\t\t\t\t$jlh=$jlh+1;\n\t\t\t}\n\t\t}\n\t}\n\t\n\techo $jlh;\n\t\n\t\n\t\n\t\n?>", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "0ec7a16a3f6f47017afb60f727844c5d", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800} {"lang": "PHP", "source_code": " 0)\n\t{\n\t\tfor($i=0;$i<=count($a);$i++)\n\t\t{\n\t\t\tif($a[$i]>=$score)\n\t\t\t{\n\t\t\t\t$jlh=$jlh+1;\n\t\t\t}\n\t\t}\n\t}\n\t\n\techo $jlh;\n\t\n\t\n\t\n\t\n?>", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "a9fbb65c886bb3bd2fea4e179c92e4f7", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800} {"lang": "PHP", "source_code": " $bal) {\n\tif ($bal == 0) break;\n\tif ($result >= $k) {\n\t\tif ($data2[$key-1] == $bal) $result++;\n\t\telse break;\n\t} else {$result++;\n}\n\nfile_put_contents('php://stderr', $result);", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "91c1f1619357166fb8e3ae4f22d1202d", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800} {"lang": "PHP", "source_code": "\ufeff", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "17184646a663e1ede5e96e9cd16c6a41", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "98d691c40b4137d183a56bf081d2857d", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "12d155cd1b7e4f81ba54cdaed2fdf890", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "d496cfa2d252f654362d2ca1929fc1d0", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000} {"lang": "PHP", "source_code": "0) {\n $x = $x+1;\n}\nif ($m % $a>0) {\n $y = $y+1;\n}\nfprintf($x*$y);\n?>", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "fec35525fd9578e84fafaf1cb3c0f1dc", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000} {"lang": "PHP", "source_code": "\n", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "401e0276413a72968e7a3c2b5f8b8948", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "e4ed2f212b5422ce675d231dbc324f96", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800} {"lang": "PHP", "source_code": "\";\n else\n echo \"YES
;\n?>", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "17e23fd18aa0fd12de41b95c2462a308", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "9ed06fa3c45d17331eea33a6918f9546", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "95188d2f7959c637331c5497f4f8d86a", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800} {"lang": "PHP", "source_code": " preg_match_all(\"/[a-z]/\", $str)?strtoupper($str):strtolower($str);\n?>", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "113befad4e87e6207bfc551388ae06ce", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "difficulty": 800} {"lang": "PHP", "source_code": "\n", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "b186042a81e3140e06960109b702a725", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "difficulty": 1000} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "f6e834ce52b92237c4adc379b8d6e04a", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "difficulty": 1000} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "97554c5e39efba58af206c9e1ee44da7", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "difficulty": 1000} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "2db835a97ee390f3aea5ea7636a67641", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "difficulty": 800} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "034805926d3166136e849006ad11adab", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "difficulty": 800} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "8f89279b4bed7207c8696d76f7b452a6", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "difficulty": 800} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "822999f433534bdf7281f34e36486f29", "src_uid": "03caf4ddf07c1783e42e9f9085cc6efd", "difficulty": 800} {"lang": "PHP", "source_code": "($s[1]*2))){\n break;\n }\n $s[0]=$s[0]*3;\n $s[1]=$s[1]*2;\n $years++;\n}\necho $years;\n?>", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "507c2d08200c8df109df592654319465", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "difficulty": 800} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "3597c68dd50a27f250be4cddcff3457f", "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838", "difficulty": 1000} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "cb8baf6faddb62ee66721bea3fdadada", "src_uid": "ffeae332696a901813677bd1033cf01e", "difficulty": 800} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "3de7f2778203478a2135134503203a4b", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "difficulty": 800} {"lang": "PHP", "source_code": "= 'A' && $in[$x] <= 'Z') {\n\t\t\t$flag = false;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif ($flag) {\n\t\techo strtoupper(substr($in,0,1)).substr($in,1,$len-1);\n\t} else echo $in;", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "edba83d0889edb82d1630a6624aa78ae", "src_uid": "29e0fc0c5c0e136ac8e58011c91397e4", "difficulty": 800} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "f99479616bbda215e483604c86198496", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "difficulty": 800} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "a514703eb4f737255c100e919f7ba44a", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "difficulty": 800} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "20480b4d6d730b35e1ab9b960a88c84f", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "difficulty": 800} {"lang": "PHP", "source_code": "= $T ? 1 : 0);\n\t}\n\techo $ans;\n?>\n", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "621819317020997d6964b727863c5c17", "src_uid": "4c978130187e8ae6ca013d3f781b064e", "difficulty": 1900} {"lang": "PHP", "source_code": "1,'.'=>-1);\nfor($i=0;$i<3;$i++)\n for($j=0;$j<3;$j++)\n if(abs($m[$s[$i][$j]]+$m[$s[$i][$j+1]]+$m[$s[$i+1][$j]]+$m[$s[$i+1][$j+1]])==2){\n echo \"YES\";\n return;\n }\necho \"NO\";\nreturn;\n?>", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "7cb85d0af046ad24477dee26e8ac65b6", "src_uid": "01b145e798bbdf0ca2ecc383676d79f3", "difficulty": 1100} {"lang": "PHP", "source_code": "1,'.'=>-1);\n$a = \"NO\";\nfor($i=0;$i<3;$i++)\n\tfor($j=0;$j<3;$j++)\n\t\tif(abs($m[$s[$i*4+$j]]+$m[$s[$i*4+$j+1]]+$m[$s[($i+1)*4+$j]]+$m[$s[($i+1)*4+$j+1]])==2&&$a = \"YES\")\n\t\t\tbreak 2;\n\necho $a;\nreturn;\n?>", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "8c4aff0bb3f3b7851693cdd8e5f608f6", "src_uid": "01b145e798bbdf0ca2ecc383676d79f3", "difficulty": 1100} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "3429184f5c0207962922d46313bb834e", "src_uid": "3ad3b8b700f6f34b3a53fdb63af351a5", "difficulty": 1000} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "e3a45b8701e6c1ef4f915ef0656588ef", "src_uid": "5b969b6f564df6f71e23d4adfb2ded74", "difficulty": 800} {"lang": "PHP", "source_code": "bmit\nMy submissions\nStatus\nHacks\nRoom\nStandings\nCustom test\n \n \n \n \n My submissions \n \n #\tWhen\tWho\tProblem\tLang\tVerdict\tTime\tMemory\n2388517 \t Oct 19, 2012 11:01:12 PM \ttaka_taka \t B - Non-square Equation \t PHP \tTime limit exceeded on test 5 \t 1000 ms \t 0 KB \n\n\n \n \n \n \n My contest submissions \n \n #\tWhen\tWho\tProblem\tLang\tVerdict\tTime\tMemory\nNo items\n\n\nCodeforces (c) Copyright 2010-2012 Mike Mirzayanov\nThe only programming contests Web 2.0 platform\nServer time: 10/19/2012 11:26PM.By taka_taka, contest: Codeforces Round #144 (Div. 2), problem: (B) Non-square Equation, Time limit exceeded on test 5, # \nin();\n\t$N = $Input->in();\n\n\tfor ($i = max(1, (int)sqrt($N) - 1000000; $i <= (int)sqrt($N); $i++)\n\t{\n\t\tif ($N % $i !== 0) continue;\n\t\telse\n\t\t{\n\t\t\t$temp = $i;\n\t\t\t$ans = $temp;\n\t\t\t$sum = 0;\n\t\t\twhile ($temp > 0) \n\t\t\t{\n\t\t\t\t$sum += (int)($temp % 10);\n\t\t\t\t$temp = (int)($temp / 10);\n\t\t\t}\n\n\t\t\tif ($sum + $ans === intval($N / $i)) \n\t\t\t{\n\t\t\t\tprint($i);\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\t}\n\n\tprint(-1);\n\n\t$Input->close();\n}\n\nclass Input{\n\tprivate $handle = \"\";\n\tprivate $values = array();\n\tprivate $index = 0;\n\n\tpublic function __construct($localfile){\n\n\t\tif (is_file($localfile)) {\n\t\t\t\n\t\t\t$this->handle = fopen($localfile, \"r\");\n\t\t\t$contents = stream_get_contents($this->handle);\n\t\t\n\t\t} else {\n\t\t\n\t\t\t$contents = stream_get_contents(STDIN);\n\t\t\n\t\t}\n\t\t\n\t\t$no_newlines = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \" \", $contents);\n\t\t$this->values = explode(\" \", $no_newlines);\n\t}\n\t\n\tpublic function in(){\n\t\n\t\treturn $this->values[$this->index++];\n\t\n\t}\n\t\n\tpublic function close(){\n\t\t\n\t\tif (is_file($localfile) && feof($this->handle)) fclose($this->handle);\n\t\t\n\t}\n}\n\n?>", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "1ebd34b27a505b447eee5b6505cd10b6", "src_uid": "e1070ad4383f27399d31b8d0e87def59", "difficulty": 1400} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "cafec04bdc6b755c863a3218e28a9433", "src_uid": "980f4094b3cfc647d6f74e840b1bfb62", "difficulty": 2100} {"lang": "PHP", "source_code": "\n
\n\t\n\t\n\t\n
\n", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "0975a51261328d0426e2fd1b5a5bf594", "src_uid": "699444eb6366ad12bc77e7ac2602d74b", "difficulty": 800} {"lang": "PHP", "source_code": "Scan();\n\t$inp_K = (int)$Scanner->Scan();\n\t\n\t$start = $inp_N - (int)($inp_N / $inp_K);\n\t//for ($i = 1; $i <= $inp_N; $i++) {\n\t/for ($i = $start; $i <= $inp_N; $i++) {\n\t\t$temp = $i;\n\t\t$sum = 0;\n\t\twhile ($temp !== 0) {\n\t\t\t$sum += $temp;\n\t\t\t//$temp = $temp / $inp_K;\n\t\t\t$temp = (int)($temp / $inp_K);\n\t\t}\t\n\t\t//if ($sum > $inp_N) {\n\t\tif ($sum >= $inp_N) {\n\t\t\t$V = $i;\n\t\t\tbreak;\n\t\t}\n\t}\n\tprintf(\"%d\", $V);\n\t$Scanner->close();\n}\n\nob_end_clean();\nsolve();\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n/*\n====begin=====\n\n//input $inp_ or upper\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $^Upper\n\n====end=======\n\n===== class begin =====\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n===== class end ======\n\n=== function begin ===\n\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.0f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\n== function end ======\n*/\n\n?>", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "e7e135d11cfa95bbc278d3008acec554", "src_uid": "41dfc86d341082dd96e089ac5433dc04", "difficulty": 1500} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "b695b33c35db98fb834b40ed550b294c", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "difficulty": 800} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": true, "code_uid": "c51c3635851fe2369c24149cfd50f80d", "src_uid": "ac6971f4feea0662d82da8e0862031ad", "difficulty": 1000} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "90febc2f8019900e36d1d1242ce6b424", "src_uid": "ca65e023be092b2ce25599f52acc1a67", "difficulty": 1000} {"lang": "PHP", "source_code": " '',\n\t\t\"\\n\" => '',\n\t);\n\treturn strtr(fgets($f), $r);\n}\n\nfunction readNumString($f) {\n\treturn trim(fgets($f));\n}\n\nfunction stringToArray($str) {\n\treturn str_split($str);\n}\n\nfunction readNum($f, $is_int = false) {\n\t$v = readNumString($f);\n\treturn $is_int ? intval($v) : floatval($v);\n}\n\nfunction readStringExplode($f, $delimiter = ' ') {\n\t$v = readNumString($f);\n\tif ($delimiter == '') {\n\t\t$return = stringToArray($v);\n\t} else {\n\t\t$return = explode($delimiter, $v);\n\t}\n\t$callf = 'trim';\n\treturn array_map($callf, $return);\n}\n\nfunction readStringExplodeNum($f, $delimiter = ' ', $is_int = false) {\n\t$v = readNumString($f);\n\tif ($delimiter == '') {\n\t\t$return = stringToArray($v);\n\t} else {\n\t\t$return = explode($delimiter, $v);\n\t}\n\t$callf = $is_int ? 'intval' : 'floatval';\n\treturn array_map($callf, $return);\n}\n\nfunction readNumArray($f) {\n\treturn readStringExplodeNum($f, ' ', true);\n}\n\nfunction readArray($f) {\n\treturn readStringExplodeNum($f, ' ');\n}\n\nfunction readTrimString($f) {\n\treturn trim(readString($f));\n}\n\n###### /IO ######\n# for($i=0;$i<$n;$i++)\n\nfunction getDiffCount($base, $l) {\n\t$return = 0;\n\tforeach ($base as $i => $v) {\n\t\tif ($base[$i] != $l[$i]) {\n\t\t\t$return++;\n\t\t}\n\t}\n\treturn $return;\n}\n\nfunction getAnswer($is_test = false, $f = false) {\n\tif ($is_test === false) {\n\t\t$f = STDIN;\n\t}\n\t/* begin body */\n\tlist($n, $k) = readNumArray($f);\n\t$str = trim(readString($f));\n\t$positions = array_combine(range('A', 'Z'), array_fill(0, 26, 0));\n\tfor ($i = 0; $i < $n; $i++) {\n\t\t$positions[$str[$i]] ++;\n\t}\n\n\t$oPos = array_combine(range(0, $k - 1), array_fill(0, $k, ''));\n\tfor ($i = 0; $i < $n; $i++) {\n\t\t$founded = false;\n\t\tfor ($j = 0; $j < $k; $j++) {\n\t\t\tif (empty($oPos[$j]) || $oPos[$j] == $str[$i]) {\n\t\t\t\t$oPos[$j] = $str[$i];\n\t\t\t\t$positions[$str[$i]] --;\n\t\t\t\tif (empty($positions[$str[$i]])) {\n\t\t\t\t\t$oPos[$j] = '';\n\t\t\t\t}\n\t\t\t\t$founded = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!$founded) {\n\t\t\techo 'YES';\n\t\t\treturn;\n\t\t}\n\t}\n\techo 'NO';\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "d9065f1888733acff160de5f71e12c47", "src_uid": "216323563f5b2dd63edc30cb9b4849a5", "difficulty": 1100} {"lang": "PHP", "source_code": " 1, b => 2, c => 3, d => 4, e => 5, f => 6, g => 7, h => 8);\n$f = $e[$a[0]];\n$g = $a[1];\n$h = $e[$b[0]];\n$i = $b[1];\n$j = $e[$c[0]];\n$k = $c[1];\n$l = $e[$d[0]];\n$m = $d[1];\n$n = array(1 => array(), 2 => array(), 3 => array(), 4 => array(), 5 => array(), 6 => array(), 7 => array(), 8 => array());\n$o = array_fill(1, 8, 1);\nfor($x = 1; $x <= 8; $x++)\n{\n $n[$x] = $o;\n}\nif($n[$j - 1][$k - 1] == TRUE)\n{\n $n[$j - 1][$k - 1] = 2;\n}\nif($n[$j - 1][$k] == TRUE)\n{\n $n[$j - 1][$k] = 2;\n}\nif($n[$j - 1][$k + 1] == TRUE)\n{\n $n[$j - 1][$k + 1] = 2;\n}\nif($n[$j][$k - 1] == TRUE)\n{\n $n[$j][$k - 1] = 2;\n}\nif($n[$j][$k] == TRUE)\n{\n $n[$j][$k] = 3;\n}\nif($n[$j][$k + 1] == TRUE)\n{\n $n[$j][$k + 1] = 2;\n}\nif($n[$j + 1][$k - 1] == TRUE)\n{\n $n[$j + 1][$k - 1] = 2;\n}\nif($n[$j + 1][$k] == TRUE)\n{\n $n[$j + 1][$k] = 2;\n}\nif($n[$j + 1][$k + 1] == TRUE)\n{\n $n[$j + 1][$k + 1] = 2;\n}\nfor($x = 1; $x <= 8; $x++)\n{\n if(($n[$f - $x][$g] == NULL) || ($n[$f - $x][$g] == $n[$j][$k]))\n {\n break;\n }\n else\n {\n $n[$f - $x][$g] = 2;\n }\n}\nfor($x = 1; $x <= 8; $x++)\n{\n if(($n[$f + $x][$g] == NULL) || ($n[$f + $x][$g] == $n[$j][$k]))\n {\n break;\n }\n else\n {\n $n[$f + $x][$g] = 2;\n }\n}\nfor($x = 1; $x <= 8; $x++)\n{\n if(($n[$f][$g - $x] == NULL) || ($n[$f][$g - $x] == $n[$j][$k]))\n {\n break;\n }\n else\n {\n $n[$f][$g - $x] = 2;\n }\n}\nfor($x = 1; $x <= 8; $x++)\n{\n if(($n[$f][$g + $x] == NULL) || ($n[$f][$g + $x] == $n[$j][$k]))\n {\n break;\n }\n else\n {\n $n[$f][$g + $x] = 2;\n }\n}\nfor($x = 1; $x <= 8; $x++)\n{\n if(($n[$h - $x][$i] == NULL) || ($n[$h - $x][$i] == $n[$j][$k]))\n {\n break;\n }\n else\n {\n $n[$h - $x][$i] = 2;\n }\n}\nfor($x = 1; $x <= 8; $x++)\n{\n if(($n[$h + $x][$i] == NULL) || ($n[$h + $x][$i] == $n[$j][$k]))\n {\n break;\n }\n else\n {\n $n[$h + $x][$i] = 2;\n }\n}\nfor($x = 1; $x <= 8; $x++)\n{\n if(($n[$h][$i - $x] == NULL) || ($n[$h][$i - $x] == $n[$j][$k]))\n {\n break;\n }\n else\n {\n $n[$h][$i - $x] = 2;\n }\n}\nfor($x = 1; $x <= 8; $x++)\n{\n if(($n[$h][$i + $x] == NULL) || ($n[$h][$i + $x] == $n[$j][$k]))\n {\n break;\n }\n else\n {\n $n[$h][$i + $x] = 2;\n }\n}\n$n[$f][$g] = 4;\n$n[$h][$i] = 4;\n$p = array();\n$r = array();\n$s = array();\nif($n[$l - 1][$m - 1] == TRUE)\n{\n array_push($p, $n[$l - 1][$m - 1]);\n array_push($r, $l - 1);\n array_push($s, $m - 1);\n}\nif($n[$l - 1][$m] == TRUE)\n{\n array_push($p, $n[$l - 1][$m]);\n array_push($r, $l - 1);\n array_push($s, $m);\n}\nif($n[$l - 1][$m + 1] == TRUE)\n{\n array_push($p, $n[$l - 1][$m + 1]);\n array_push($r, $l - 1);\n array_push($s, $m + 1);\n}\nif($n[$l][$m - 1] == TRUE)\n{\n array_push($p, $n[$l][$m - 1]);\n array_push($r, $l);\n array_push($s, $m - 1);\n}\nif($n[$l][$m] == TRUE)\n{\n array_push($p, $n[$l][$m]);\n array_push($r, $l);\n array_push($s, $m);\n}\nif($n[$l][$m + 1] == TRUE)\n{\n array_push($p, $n[$l][$m + 1]);\n array_push($r, $l);\n array_push($s, $m + 1);\n}\nif($n[$l + 1][$m - 1] == TRUE)\n{\n array_push($p, $n[$l + 1][$m - 1]);\n array_push($r, $l + 1);\n array_push($s, $m - 1);\n}\nif($n[$l + 1][$m] == TRUE)\n{\n array_push($p, $n[$l + 1][$m]);\n array_push($r, $l + 1);\n array_push($s, $m);\n}\nif($n[$l + 1][$m + 1] == TRUE)\n{\n array_push($p, $n[$l + 1][$m + 1]);\n array_push($r, $l + 1);\n array_push($s, $m + 1);\n}\n$t = array_unique($p);\nsort($t);\nif($t[0] == 1)\n{\n print \"OTHER\";\n}\nelseif((count($t) == 1) && ($t[0] == 2))\n{\n print \"CHECKMATE\";\n}\nelse\n{\n for($x = 0; $x < count($p); $x++)\n {\n if($p[$x] != 4)\n {\n array_splice($p, $x, 1);\n array_splice($r, $x, 1);\n array_splice($s, $x, 1);\n $x--;\n }\n }\n for($x = 0; $x < count($p); $x++)\n {\n $q = 0;\n if($p[$x] == 4)\n {\n $u = $r[$x];\n $v = $s[$x];\n if(($n[$u - 1][$v - 1] == TRUE) && ($n[$u - 1][$v - 1] == 3))\n {\n $q = 1;\n }\n if(($n[$u - 1][$v] == TRUE) && ($n[$u - 1][$v] == 3))\n {\n $q = 1;\n }\n if(($n[$u - 1][$v + 1] == TRUE) && ($n[$u - 1][$v + 1] == 3))\n {\n $q = 1;\n }\n if(($n[$u][$v - 1] == TRUE) && ($n[$u][$v - 1] == 3))\n {\n $q = 1;\n }\n if(($n[$u][$v + 1] == TRUE) && ($n[$u][$v + 1] == 3))\n {\n $q = 1;\n }\n if(($n[$u + 1][$v - 1] == TRUE) && ($n[$u + 1][$v - 1] == 3))\n {\n $q = 1;\n }\n if(($n[$u + 1][$v] == TRUE) && ($n[$u + 1][$v] == 3))\n {\n $q = 1;\n }\n if(($n[$u + 1][$v + 1] == TRUE) && ($n[$u + 1][$v + 1] == 3))\n {\n $q = 1;\n }\n for($y = 0; $y < count($p); $y++)\n {\n if($x != $y)\n {\n if($p[$x] == 4)\n {\n $w = $r[$y];\n $z = $s[$y];\n if(($u == $w) || ($v == $z))\n {\n $q = 1;\n break;\n }\n }\n }\n }\n }\n if($q == 0)\n {\n break;\n }\n }\n if($q == 0)\n {\n print \"OTHER\";\n }\n elseif($q == 1)\n {\n print \"CHECKMATE\";\n }\n}\n?>", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "df7224de4dad58060f90b62e91d11367", "src_uid": "5d05af36c7ccb0cd26a4ab45966b28a3", "difficulty": 1700} {"lang": "PHP", "source_code": " array(), b => array(), c => array(), d => array(), e => array(), f => array(), g => array(), h => array());\n$f = array_keys($e);\nfor($x = 0; $x <= 7; $x++)\n{\n $g = array_fill(1, 8, 1);\n $e[$f[$x]] = $g;\n}\n$h = $a[0];\n$i = $a[1];\n$j = array_fill(1, 8, 0);\n$e[$h] = $j;\nfor($x = 0; $x <= 7; $x++)\n{\n $e[$f[$x]][$i] = 0;\n}\n$k = $b[0];\n$l = $b[1];\n$m = array_fill(1, 8, 0);\n$e[$k] = $m;\nfor($x = 0; $x <= 7; $x++)\n{\n $e[$f[$x]][$l] = 0;\n}\n$n = $c[0];\n$o = $c[1];\n$p = array();\nfor($x = 0; $x <= 7; $x++)\n{\n if($f[$x] == $n)\n {\n if(is_array($e[$f[$x - 1]]) == TRUE)\n {\n array_push($p, $f[$x - 1]);\n }\n if(is_array($e[$f[$x + 1]]) == TRUE)\n {\n array_push($p, $f[$x + 1]);\n }\n break;\n }\n}\nif($e[$n][$o - 1] == TRUE)\n{\n $e[$n][$o - 1] = 0;\n}\nif($e[$n][$o] == TRUE)\n{\n $e[$n][$o] = 0;\n}\nif($e[$n][$o + 1] == TRUE)\n{\n $e[$n][$o + 1] = 0;\n}\nfor($x = 0; $x < count($p); $x++)\n{\n if($e[$p[$x]][$o - 1] == TRUE)\n {\n $e[$p[$x]][$o - 1] = 0;\n }\n if($e[$p[$x]][$o] == TRUE)\n {\n $e[$p[$x]][$o] = 0;\n }\n if($e[$p[$x]][$o + 1] == TRUE)\n {\n $e[$p[$x]][$o + 1] = 0;\n }\n}\n$q = $d[0];\n$r = $d[1];\n$s = 0;\n$t = array();\nfor($x = 0; $x <= 7; $x++)\n{\n if($f[$x] == $q)\n {\n if(is_array($e[$f[$x - 1]]) == TRUE)\n {\n array_push($t, $f[$x - 1]);\n }\n if(is_array($e[$f[$x + 1]]) == TRUE)\n {\n array_push($t, $f[$x + 1]);\n }\n break;\n }\n}\nif($e[$q][$r - 1] == TRUE)\n{\n $s = 1;\n}\nif($e[$q][$r + 1] == TRUE)\n{\n $s = 1;\n}\nfor($x = 0; $x < count($t); $x++)\n{\n if($e[$t[$x]][$r - 1] == TRUE)\n {\n $s = 1;\n }\n if($e[$t[$x]][$r] == TRUE)\n {\n $s = 1;\n }\n if($e[$t[$x]][$r + 1] == TRUE)\n {\n $s = 1;\n }\n}\nif(($e[$q][$r] == 0) && ($s == 0))\n{\n $u = array(a => 1, b => 2, c => 3, d => 4, e => 5, f => 6, g => 7, h => 8);\n $v = abs($u[$h] - $u[$q]);\n $w = abs($i - $r);\n if(($v <= 1) && ($w <= 1))\n {\n $v = abs($u[$h] - $u[$n]);\n $w = abs($i - $o);\n if(($v <= 1) && ($w <= 1))\n {\n $v = abs($u[$h] - $u[$k]);\n $w = abs($i - $l);\n if(($v <= 1) && ($w <= 1))\n {\n $v = abs($u[$k] - $u[$l]);\n $w = abs($n - $o);\n if(($v <= 1) && ($w <= 1))\n {\n print \"CHECKMATE\";\n }\n else\n {\n if(($u[$h] == $u[$k]) || ($i == $l))\n {\n print \"CHECKMATE\";\n }\n else\n {\n print \"OTHER\";\n }\n }\n }\n else\n {\n print \"CHECKMATE\";\n }\n }\n else\n {\n if(($u[$h] == $u[$k]) || ($i == $l))\n {\n print \"CHECKMATE\";\n }\n else\n {\n print \"OTHER\";\n }\n }\n }\n else\n {\n $v = abs($u[$h] - $u[$k]);\n $w = abs($i - $l);\n if(($v <= 1) && ($w <= 1))\n {\n $v = abs($u[$k] - $u[$l]);\n $w = abs($n - $o);\n if(($v <= 1) && ($w <= 1))\n {\n print \"CHECKMATE\";\n }\n else\n {\n if(($u[$h] == $u[$k]) || ($i == $l))\n {\n print \"CHECKMATE\";\n }\n else\n {\n print \"OTHER\";\n }\n }\n }\n else\n {\n print \"CHECKMATE\";\n }\n }\n}\nelse\n{\n print \"OTHER\";\n}\n?>", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "faac2140e78e9ed012168ab7cec48887", "src_uid": "5d05af36c7ccb0cd26a4ab45966b28a3", "difficulty": 1700} {"lang": "PHP", "source_code": "$b)\n echo $b-$a;\nelseif (($min>$a)&&($min<$b))\n echo $min - $a;\nelse \n echo 0;\n?>", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "b95100216fb59fced31f585906af1975", "src_uid": "63b9dc70e6ad83d89a487ffebe007b0a", "difficulty": 1100} {"lang": "PHP", "source_code": "2) $d1++;\n for($i=1;$i<$m1;$i++)\n $d1+=$month[$i];\n for($i=1900;$i<$y2;$i++)\n if($i%4==0 && $i%100!=0 || $i%400==0) $d2+=366;\n else $d2+=365;\n if($y2%4==0 && $y2%100!=0 || $y2%400==0)\n if($m2>2) $d2++;\n for($i=1;$i<$m2;$i++)\n $d2+=$month[$i];\n //echo $d1.\" \".$d2.\"\\n\";\n echo abs($d1-$d2);\n?>", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "c284e1672533f726960eb5179435f346", "src_uid": "bdf99d78dc291758fa09ec133fff1e9c", "difficulty": 1300} {"lang": "PHP", "source_code": " 0, B => 0, Y => 0, G => 0);\n$c = 0;\n$d = 0;\nfor($x = 0; $x < count($a); $x++)\n{\n if($a[$x] != \"!\")\n {\n $d++; \n }\n else\n {\n $c = max($c, $d);\n $d = 0;\n }\n}\n$c = max($c, $d);\nif($c == count($a))\n{\n print implode(\" \", $b);\n}\nelseif($c == 1)\n{\n $d2 = 0;\n for($x = 0; $x < count($a); $x++)\n {\n if($a[$x] == \"!\")\n {\n $d2++;\n }\n }\n $e = 0;\n for($x = 0; $x < count($a); $x++)\n {\n if($a[$x] != \"!\")\n {\n $e++;\n if(($e == 1) && ($x > 1))\n {\n break;\n }\n }\n else\n {\n $e = 0;\n }\n }\n $f = array(R => 0, B => 0, Y => 0, G => 0);\n $f[$a[$x]]++;\n asort($f);\n $g = array_keys($f);\n $h = $g[0];\n $i = $g[1];\n $j = $g[2];\n for($w = 1; $w <= 1; $w++)\n {\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x - 1] == \"!\") && ($a2[$x - 2] == \"!\"))\n {\n $a2[$x - 1] = $h;\n $a2[$x - 2] = $i;\n $b2[$h]++;\n $b2[$i]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x + 1] == \"!\") && ($a2[$x + 2] == \"!\"))\n {\n $a2[$x + 1] = $h;\n $a2[$x + 2] = $i;\n $b2[$h]++;\n $b2[$i]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x - 1] == \"!\") && ($a2[$x - 2] == \"!\"))\n {\n $a2[$x - 1] = $h;\n $a2[$x - 2] = $j;\n $b2[$h]++;\n $b2[$j]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x + 1] == \"!\") && ($a2[$x + 2] == \"!\"))\n {\n $a2[$x + 1] = $h;\n $a2[$x + 2] = $j;\n $b2[$h]++;\n $b2[$j]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x - 1] == \"!\") && ($a2[$x - 2] == \"!\"))\n {\n $a2[$x - 1] = $i;\n $a2[$x - 2] = $h;\n $b2[$i]++;\n $b2[$h]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x + 1] == \"!\") && ($a2[$x + 2] == \"!\"))\n {\n $a2[$x + 1] = $i;\n $a2[$x + 2] = $h;\n $b2[$i]++;\n $b2[$h]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x - 1] == \"!\") && ($a2[$x - 2] == \"!\"))\n {\n $a2[$x - 1] = $i;\n $a2[$x - 2] = $j;\n $b2[$i]++;\n $b2[$j]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x + 1] == \"!\") && ($a2[$x + 2] == \"!\"))\n {\n $a2[$x + 1] = $i;\n $a2[$x + 2] = $j;\n $b2[$i]++;\n $b2[$j]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x - 1] == \"!\") && ($a2[$x - 2] == \"!\"))\n {\n $a2[$x - 1] = $j;\n $a2[$x - 2] = $h;\n $b2[$j]++;\n $b2[$h]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x + 1] == \"!\") && ($a2[$x + 2] == \"!\"))\n {\n $a2[$x + 1] = $j;\n $a2[$x + 2] = $h;\n $b2[$j]++;\n $b2[$h]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x - 1] == \"!\") && ($a2[$x - 2] == \"!\"))\n {\n $a2[$x - 1] = $j;\n $a2[$x - 2] = $i;\n $b2[$j]++;\n $b2[$i]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x + 1] == \"!\") && ($a2[$x + 2] == \"!\"))\n {\n $a2[$x + 1] = $j;\n $a2[$x + 2] = $i;\n $b2[$j]++;\n $b2[$i]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n }\n}\nelseif($c == 2)\n{\n $d2 = 0;\n for($x = 0; $x < count($a); $x++)\n {\n if($a[$x] == \"!\")\n {\n $d2++;\n }\n }\n $e = 0;\n for($x = 0; $x < count($a); $x++)\n {\n if($a[$x] != \"!\")\n {\n $e++;\n if($e == 2)\n {\n break;\n }\n }\n else\n {\n $e = 0;\n }\n }\n $f = array(R => 0, B => 0, Y => 0, G => 0);\n $f[$a[$x]]++;\n $f[$a[$x - 1]]++;\n asort($f);\n $g = array_keys($f);\n $h = $g[0];\n $i = $g[1];\n $a2 = $a;\n $b2 = $b;\n if($a[$x - 2] == \"!\")\n {\n $a[$x - 2] = $h;\n $b[$h]++;\n }\n if($a[$x + 1] == \"!\")\n {\n $a[$x + 1] = $i;\n $b[$i]++;\n }\n if($a2[$x - 2] == \"!\")\n {\n $a2[$x - 2] = $i;\n $b2[$i]++;\n }\n if($a2[$x + 1] == \"!\")\n {\n $a2[$x + 1] = $h;\n $b2[$h]++;\n }\n $d = 0;\n for($x = 0; $x < count($a); $x++)\n {\n if($a[$x] != \"!\")\n {\n $d++;\n if($c == $d)\n {\n break;\n }\n }\n else\n {\n $d = 0;\n }\n }\n for($y = $x; $y >= 0; $y--)\n {\n if($a[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a[$y] = \"R\";\n $b[R]++;\n }\n elseif($e[B] == 0)\n {\n $a[$y] = \"B\";\n $b[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a[$y] = \"Y\";\n $b[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a[$y] = \"G\";\n $b[G]++;\n }\n }\n }\n for($y = $x; $y < count($a); $y++)\n {\n if($a[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a[$y] = \"R\";\n $b[R]++;\n }\n elseif($e[B] == 0)\n {\n $a[$y] = \"B\";\n $b[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a[$y] = \"Y\";\n $b[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a[$y] = \"G\";\n $b[G]++;\n }\n }\n }\n if(array_sum($b) == $d2)\n {\n print implode(\" \", $b);\n }\n else\n {\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n print implode(\" \", $b2);\n }\n}\nelseif($c >= 3)\n{\n $d = 0;\n for($x = 0; $x < count($a); $x++)\n {\n if($a[$x] != \"!\")\n {\n $d++;\n if($c == $d)\n {\n break;\n }\n }\n else\n {\n $d = 0;\n }\n }\n for($y = $x; $y >= 0; $y--)\n {\n if($a[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a[$z]]++;\n }\n if($e[R] == 0)\n {\n $a[$y] = \"R\";\n $b[R]++;\n }\n elseif($e[B] == 0)\n {\n $a[$y] = \"B\";\n $b[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a[$y] = \"Y\";\n $b[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a[$y] = \"G\";\n $b[G]++;\n }\n }\n }\n for($y = $x; $y < count($a); $y++)\n {\n if($a[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a[$z]]++;\n }\n if($e[R] == 0)\n {\n $a[$y] = \"R\";\n $b[R]++;\n }\n elseif($e[B] == 0)\n {\n $a[$y] = \"B\";\n $b[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a[$y] = \"Y\";\n $b[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a[$y] = \"G\";\n $b[G]++;\n }\n }\n }\n print implode(\" \", $b);\n}\n?>", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "f4955999349eb548d2ea0e8d7602eb0f", "src_uid": "64fc6e9b458a9ece8ad70a8c72126b33", "difficulty": 1100} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "a88b54d561a0c84660a81b7e25fb9c7a", "src_uid": "c05d0a9cabe04d8fb48c76d2ce033648", "difficulty": 900} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "cfbf21b7bf47f42adc18ec9a9339ca84", "src_uid": "65f81f621c228c09915adcb05256c634", "difficulty": 1600} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "aec4f1cf36396921ebc1d913e61ccc68", "src_uid": "a5002ddf9e792cb4b4685e630f1e1b8f", "difficulty": 1000} {"lang": "PHP", "source_code": "=$j) { $i=$i%$j; } else { $j=$j%$i; } }\n return $i+$j;\n}\n\n// uprosh drob\n$nod=nod($x,$y);\nwhile ($nod>1)\n{\n $x=$x/$nod;\n $y=$y/$nod;\n $nod=nod($x,$y);\n}\n$a2=0;\n$b2=0;\nwhile (($a2+$x<$a)&&($b2+$y<$b))\n{\n $a2=$a2+$x;\n $b2=$b2+$y;\n}\n\n\n\n\n$stdout=fopen('php://stdout','w');\nfwrite($stdout,$a2.' '.$b2);\nfclose($stdout);\n\n?>", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "b859e9b035bb95ac9dd67f1c05991653", "src_uid": "97999cd7c6de79a4e39f56a41ff59e7a", "difficulty": 1800} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "a7dfc84c574854750c47c242b168bc72", "src_uid": "956228e31679caa9952b216e010f9773", "difficulty": 1800} {"lang": "PHP", "source_code": "= $b) && ($h <= $c))\n{\n print $h . \" \" . $d . \" \" . $f;\n}\nelseif($h > $c)\n{\n $i = $a - ($c + $f);\n if(($i >= $d) && ($i <= $e))\n {\n print $c . \" \" . $i . \" \" . $f;\n }\n else\n {\n $j = $a - $c - $e;\n print $c . \" \" . $e . \" \" . $j;\n }\n}\n?>", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "f401a593451fedc86c7354306a540df0", "src_uid": "3cd092b6507079518cf206deab21cf97", "difficulty": 1100} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "a4d4e1156a19b6d9a6cc570971007c7a", "src_uid": "f8eb96deeb82d9f011f13d7dac1e1ab7", "difficulty": 900} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "dcae52d4c6a4362299e02a114ea1cf27", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "difficulty": 1400} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "260c335588dc1d71e1ab6a3b9cc89ab2", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "difficulty": 1400} {"lang": "PHP", "source_code": " $c)\n {\n $b -= $c;\n if($d == 1)\n {\n if($b < $a - $c)\n {\n $g = 1;\n break;\n }\n }\n }\n elseif($b == $c)\n {\n $b = $b2;\n if($d == 1)\n {\n if($b < $a - $c)\n {\n $g = 1;\n break;\n }\n }\n $h++;\n }\n elseif($b < $c)\n {\n $g = 1;\n break;\n }\n }\n else\n {\n $j = $i % 2;\n $i++;\n if($j == 0)\n {\n if($x == $d + 1)\n {\n if($f / 2 > $b)\n {\n $b = $b2;\n $h++;\n }\n break;\n }\n else\n {\n if($f > $b)\n {\n $b = $b2;\n if($b < $e)\n {\n $g = 1;\n break;\n }\n $h++;\n }\n $b -= $f;\n }\n }\n else\n {\n if($x == $d + 1)\n {\n if($e / 2 > $b)\n {\n $b = $b2;\n $h++;\n }\n break;\n }\n else\n {\n if($e > $b)\n {\n $b = $b2;\n if($b < $f)\n {\n $g = 1;\n break;\n }\n $h++;\n }\n $b -= $e;\n }\n }\n }\n}\nif($g == 0)\n{\n print $h;\n}\nelse\n{\n print \"-1\";\n}\n?>", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "ef443268f2b45701a030d76f72abf343", "src_uid": "283aff24320c6518e8518d4b045e1eca", "difficulty": 1500} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "697f7ae0094c089d658037a0840ec36d", "src_uid": "6330891dd05bb70241e2a052f5bf5a58", "difficulty": 1200} {"lang": "PHP", "source_code": "= min($aData[$i][$t] , $aData[$j][$t]) && $aData[$k][$t] <= max($aData[$i][$t],$aData[$j][$t])){\n echo 2;\n exit;\n }\n\n }\n }\n}\n\necho 3;\n#var_dump($aData);\n", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "0d46d78c9cea29f0f639cefbe7688bed", "src_uid": "36fe960550e59b046202b5811343590d", "difficulty": 1700} {"lang": "PHP", "source_code": " $ans) $ans = $t;\n\t}\necho $ans;\n\t\n?>", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "361239b92f50a965f0338dc24950aa88", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "difficulty": 1200} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "cf3c01772bb149579ec6368d3450e488", "src_uid": "23f2c8cac07403899199abdcfd947a5a", "difficulty": 1600} {"lang": "PHP", "source_code": "#!/usr/bin/php\n\"vaporeon\",\n\t\t 1=>\"jolteon\",\n\t\t 2=>\"flareon\", \n\t\t 3=>\"espeon\", \n\t\t 4=>\"umbreon\",\n\t\t 5=>\"leafeon\", \n\t\t 6=>\"glaceon\", \n\t\t 7=>\"sylveon\"\n ];\n \n \n $flag=0;\n $max=0;\nfor ($i=0; $i =$max)\n {\n \t$max=$count;\n \t$str3=$eve[$i];\n }\n //echo \"$max\\n\";\n\n if($flag==1)\n \tbreak;\n \n}\t\necho \"$str3\\n\";\n}", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "cd97dd290c17e3157516f95b64cf7845", "src_uid": "ec3d15ff198d1e4ab9fd04dd3b12e6c0", "difficulty": 1000} {"lang": "PHP", "source_code": " $name){\n if($pos[$k] && $s[$i]!=$name[$i]){\n $pos[$k] = 0;\n $c--;\n }\n }\n if($c==1){\n break;\n }\n }\n }\n\n for($i=0; $i<$n; $i++){\n if($pos[$i]){\n echo $names[$i];\n break;\n }\n }\n\n}\n", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "7f3667d33286676efda90c896f2042eb", "src_uid": "ec3d15ff198d1e4ab9fd04dd3b12e6c0", "difficulty": 1000} {"lang": "PHP", "source_code": "= 1; $z--)\n {\n $g = $e[$y];\n for($z2 = 0; $z2 < $x - 1; $z2++)\n {\n if($g[$z2] == $z)\n {\n $g[$z2] = $x;\n }\n }\n $g = $z . $g;\n $f[count($f)] = $g;\n }\n }\n $e = $f;\n $f = array();\n}\n$h = 1000000000;\nfor($x = 0; $x < count($e); $x++)\n{\n $i = array();\n $j = $e[$x];\n for($y = 0; $y < $a; $y++)\n {\n $k = \"\";\n for($z = 0; $z < $b; $z++)\n {\n $l = $c[$y];\n $k .= $l[$j[$z] - 1];\n }\n $i[$y] = $k;\n }\n $m = max($i) - min($i);\n $h = min($h, $m);\n}\nprint $h;\n?>", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "2aa7aa1a28815eab1f69ab24836384c1", "src_uid": "08f85cd4ffbd135f0b630235209273a4", "difficulty": 1400} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "6ccafb4e364e56bb33a85245db447d6e", "src_uid": "073023c6b72ce923df2afd6130719cfc", "difficulty": 1200} {"lang": "PHP", "source_code": " 0)\n {\n $f += $a;\n }\n}\nif(($x == $b - 1) && ($i == 0))\n{\n $f += $a;\n}\nelseif(($x == $b - 1) && ($i == 1))\n{\n $f += $h;\n}\n$e[count($e)] = $f;\n$j = array_sum($d);\nfor($x = 0; $x < $a; $x++)\n{\n $c2 = $c;\n $k = 0;\n for($y = 0; $y <= $x; $y++)\n {\n $c2 -= $j;\n if($c2 < 0)\n {\n $c2 += $j;\n for($z = 0; $z < $b; $z++)\n {\n $g = $d[$z] * ($a - $y);\n $c2 -= $g;\n if($c2 < 0)\n {\n $c2 += $g;\n $h = floor($c2 / $d[$z]);\n $k += $h;\n break;\n }\n elseif($c2 == 0)\n {\n $k += ($a - $y);\n break;\n }\n elseif($c2 > 0)\n {\n $k += ($a - $y);\n }\n }\n break;\n }\n elseif($c2 == 0)\n {\n $k += $b + 1;\n break;\n }\n elseif($c2 > 0)\n {\n $k += $b + 1;\n }\n }\n if($c2 > 0)\n {\n $i = 0;\n for($z = 0; $z < $b; $z++)\n {\n $g = $d[$z] * ($a - $y);\n $c2 -= $g;\n if($c2 < 0)\n {\n $c2 += $g;\n $h = floor($c2 / $d[$z]);\n $k += $h;\n break;\n }\n elseif($c2 == 0)\n {\n $k += ($a - $y);\n break;\n }\n elseif($c2 > 0)\n {\n $k += ($a - $y);\n }\n }\n if(($x == $b - 1) && ($i == 0))\n {\n $k += ($a - $y);\n }\n elseif(($x == $b - 1) && ($i == 1))\n {\n $k += $h;\n }\n }\n $e[count($e)] = $k;\n}\nprint max($e);\n?>", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "a1b57a27db714c8a00e43788f0f0ff09", "src_uid": "d659e92a410c1bc836be64fc1c0db160", "difficulty": 1800} {"lang": "PHP", "source_code": " $c[$x])\n {\n $f = $c[$x + 1] - $c[$x];\n if($d[$c[$x]] == 0)\n {\n $d[$c[$x]] = $f;\n }\n elseif($d[$c[$x]] != $f)\n {\n $e = 1;\n break;\n }\n }\n elseif($c[$x + 1] == $c[$x])\n {\n $f = $c[$x];\n if($d[$c[$x]] == 0)\n {\n $d[$c[$x]] = $f;\n }\n elseif($d[$c[$x]] != $f)\n {\n $e = 1;\n break;\n }\n }\n elseif($c[$x + 1] < $c[$x])\n {\n $f = $a + $c[$x + 1] - $c[$x];\n if($d[$c[$x]] == 0)\n {\n $d[$c[$x]] = $f;\n }\n elseif($d[$c[$x]] != $f)\n {\n $e = 1;\n break;\n }\n }\n }\n if($e == 0)\n {\n $g = array_unique($d);\n sort($g);\n if(($g[0] == 0) && (count($g) < count($d)))\n {\n print \"-1\";\n }\n else\n {\n print implode(\" \", $d);\n }\n }\n else\n {\n print \"-1\";\n }\n}\n?>", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "d6a5240b441f6e9b05b3882b17250004", "src_uid": "4a7c959ca279d0a9bd9bbf0ce88cf72b", "difficulty": 1600} {"lang": "PHP", "source_code": "\n\n", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "e7be4dfc97cd12f02bec89489a7b456e", "src_uid": "14b69f42bc192ea472e82f3a3209f1c1", "difficulty": 1700} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "75ce0f0de822b997cac697449ded60be", "src_uid": "897bd80b79df7b1143b652655b9a6790", "difficulty": 1000} {"lang": "PHP", "source_code": " 0; $x--)\n{\n $a += $x;\n if($x == $d)\n {\n $a -= $c;\n if($a < 0)\n {\n $a = 0;\n }\n }\n elseif($x == $f)\n {\n $a -= $e;\n if($a < 0)\n {\n $a = 0;\n }\n }\n}\nprint $a;\n?>", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "25bb8cc9f0c853d001d26dd994900b35", "src_uid": "084a12eb3a708b43b880734f3ee51374", "difficulty": 800} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "3abf64166754c44b7f3c7d2ed43d99c9", "src_uid": "0fd33e1bdfd6c91feb3bf00a2461603f", "difficulty": 1600} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "31faf121acbe4f2a41dc90b9111098b1", "src_uid": "b4af2b8a7e9844bf58ad3410c2cb5223", "difficulty": 800} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "b0d11fdaa5190fedebaa0f1cf45ea689", "src_uid": "c9c22e03c70a94a745b451fc79e112fd", "difficulty": 1300} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "3aec8f63c414efe0c00769dfbbcb63b4", "src_uid": "c9c22e03c70a94a745b451fc79e112fd", "difficulty": 1300} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "18f2215148066d7065051fb90facf85b", "src_uid": "59f40d9f35e5fe402112214b42b682b5", "difficulty": 1500} {"lang": "PHP", "source_code": " 0) {\r\n $iVal = bcmul($iVal, $iNumber);\r\n if (strlen($iVal) >= $iLen) {\r\n return true;\r\n }\r\n $aData[$iVal] = $iVal;\r\n }\r\n }\r\n return false;\r\n }\r\n \r\n \r\n list($n, $x) = explode(' ', trim(fgets(STDIN)));\r\n $aData[$x] = $x;\r\n $iCheck = 0;\r\n $bCheck = false;\r\n while(!$bCheck) {\r\n if (strlen($x) >= $n) {\r\n echo 0 . PHP_EOL;\r\n exit;\r\n } elseif (mb_strpos($x, 1) !== false) {\r\n echo -1 . PHP_EOL;\r\n exit;\r\n } else {\r\n foreach ($aData as $iVal) {\r\n if (strlen($iVal) >= $n) {\r\n echo $iCheck . PHP_EOL;\r\n exit;\r\n }\r\n $bCheck = getNumber($iVal, $aData, $n);\r\n if ($bCheck) {\r\n $iCheck++;\r\n echo $iCheck . PHP_EOL;\r\n exit;\r\n }\r\n }\r\n $iCheck++;\r\n }\r\n }\r\n \r\n?>", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "dd55d553c56216ebfc8afcefaa97123e", "src_uid": "cedcc3cee864bf8684148df93804d029", "difficulty": 1700} {"lang": "PHP", "source_code": " $perm) {\n $score = 0;\n for ($i = 0; $i < $n; $i++) {\n for ($j = $i; $j < $n; $j++) {\n $score += min(array_slice($perm, $i, $j - $i + 1));\n }\n }\n $scores[$score][] = $permI;\n}\n\nkrsort($scores);\necho implode(\" \", $allP[$scores[key($scores)][$m - 1]]), \"\\n\";\n", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "8379e4a9e2d9c375e5c662545b34aa46", "src_uid": "a8da7cbd9ddaec8e0468c6cce884e7a2", "difficulty": 1400} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "5659de07fcff8b8858a1c05fdb0acd5e", "src_uid": "e8148140e61baffd0878376ac5f3857c", "difficulty": 800} {"lang": "PHP", "source_code": "= 0; $y--)\n {\n $h = $e[$x];\n $g[$y][$x] = $h[$y];\n }\n}\n$i = array();\nfor($x = 3; $x >= 0; $x--)\n{\n $j = $g[$x];\n $i[count($i)] = $j;\n}\nfor($x = 0; $x < 4; $x++)\n{\n for($y = 0; $y < 2; $y++)\n {\n if(($i[$x][$y] == \"x\") && ($i[$x][$y + 1] == \"x\") && ($i[$x][$y + 2] == \".\"))\n {\n $f = 1;\n break;\n }\n }\n for($y = 0; $y < 2; $y++)\n {\n if(($i[$x][$y] == \".\") && ($i[$x][$y + 1] == \"x\") && ($i[$x][$y + 2] == \"x\"))\n {\n $f = 1;\n break;\n }\n }\n for($y = 0; $y < 2; $y++)\n {\n if(($i[$x][$y] == \"x\") && ($i[$x][$y + 1] == \".\") && ($i[$x][$y + 2] == \"x\"))\n {\n $f = 1;\n break;\n }\n }\n}\nif(($e[0][1] == \"x\") && ($e[1][2] == \"x\") && ($e[2][3] == \".\"))\n{\n $f = 1;\n}\nelseif(($e[0][1] == \".\") && ($e[1][2] == \"x\") && ($e[2][3] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[0][1] == \"x\") && ($e[1][2] == \".\") && ($e[2][3] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[0][0] == \"x\") && ($e[1][1] == \"x\") && ($e[2][2] == \".\"))\n{\n $f = 1;\n}\nelseif(($e[1][1] == \"x\") && ($e[2][2] == \"x\") && ($e[3][3] == \".\"))\n{\n $f = 1;\n}\nelseif(($e[0][0] == \"x\") && ($e[1][1] == \".\") && ($e[2][2] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[1][1] == \"x\") && ($e[2][2] == \".\") && ($e[3][3] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[0][0] == \"x\") && ($e[1][1] == \".\") && ($e[2][2] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[1][1] == \".\") && ($e[2][2] == \"x\") && ($e[3][3] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[1][0] == \"x\") && ($e[2][1] == \"x\") && ($e[3][2] == \".\"))\n{\n $f = 1;\n}\nelseif(($e[1][0] == \".\") && ($e[2][1] == \"x\") && ($e[3][2] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[1][0] == \"x\") && ($e[2][1] == \".\") && ($e[3][2] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[0][2] == \"x\") && ($e[1][1] == \"x\") && ($e[2][0] == \".\"))\n{\n $f = 1;\n}\nelseif(($e[0][2] == \".\") && ($e[1][1] == \"x\") && ($e[2][0] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[0][2] == \"x\") && ($e[1][1] == \".\") && ($e[2][0] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[0][3] == \"x\") && ($e[1][2] == \"x\") && ($e[2][1] == \".\"))\n{\n $f = 1;\n}\nelseif(($e[0][3] == \".\") && ($e[1][2] == \"x\") && ($e[2][1] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[0][3] == \"x\") && ($e[1][2] == \".\") && ($e[2][1] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[1][3] == \"x\") && ($e[2][1] == \".\") && ($e[3][0] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[1][3] == \"x\") && ($e[2][1] == \".\") && ($e[3][0] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[1][3] == \".\") && ($e[2][1] == \"x\") && ($e[3][0] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[1][3] == \"x\") && ($e[2][2] == \"x\") && ($e[3][1] == \".\"))\n{\n $f = 1;\n}\nelseif(($e[1][3] == \".\") && ($e[2][2] == \"x\") && ($e[3][1] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[1][3] == \"x\") && ($e[2][2] == \".\") && ($e[3][1] == \"x\"))\n{\n $f = 1;\n}\nif($f == 1)\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "f491e60d0ec80c94d1e78a8436904ee0", "src_uid": "ca4a77fe9718b8bd0b3cc3d956e22917", "difficulty": 1100} {"lang": "PHP", "source_code": " $a) | ($sumTop % 2 != $sumBot % 2))\n {\n $res = -1;\n break;\n }\n else\n {\n $sumTop += $dBot[$up] - $dTop[$up];\n $sumBot += $dTop[$up] - $dBot[$up];\n }\n \n }\n\n printf($res);\n?>", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "e3b421ec94321055a8fd1bea89888342", "src_uid": "f9bc04aed2b84c7dd288749ac264bb43", "difficulty": 1200} {"lang": "PHP", "source_code": "= max(1, $a - 1 - 100000); $x--)\n{\n $c = str_split($x);\n $d = array_sum($c);\n $e = $x + $d;\n if($a == $e)\n {\n $b[count($b)] = $x;\n }\n}\nif(count($b) == 0)\n{\n print \"0\";\n}\nelse\n{\n print count($b) . \"\\n\";\n for($x = 0; $x < count($b); $x++)\n {\n print $b[$x] . \"\\n\";\n }\n}\n?>", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "419f60a78cf31eace21ad44b49c83244", "src_uid": "ae20ae2a16273a0d379932d6e973f878", "difficulty": 1200} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "ded0517755575e42a8aa739a353b424d", "src_uid": "8ffee18bbc4bb281027f91193002b7f5", "difficulty": 1200} {"lang": "PHP", "source_code": "= $b[$x] * 2)\n {\n $c[count($c)] = $x + 1;\n $e += $b[$x];\n unset($b[$x]);\n }\n};\nif($e > $d / 2)\n{\n print count($c) . \"\\n\";\n print implode(\" \", $c);\n}\nelse\n{\n print \"0\";\n}\n?>", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "c8f62a01b067170e9d5166339e121db5", "src_uid": "0a71fdaaf08c18396324ad762b7379d7", "difficulty": 800} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "e64167437fad6fad1f75487ce32f5bf1", "src_uid": "3c4b2d1c9440515bc3002eddd2b89f6f", "difficulty": 1100} {"lang": "PHP", "source_code": "':\n\t\t\t\treturn \"8\";\n\t\t\tcase '<':\n\t\t\t\treturn \"9\";\n\t\t\tcase '+':\n\t\t\t\treturn \"10\";\n\t\t\tcase '-':\n\t\t\t\treturn \"11\";\n\t\t\tcase '.':\n\t\t\t\treturn \"12\";\n\t\t\tcase ',':\n\t\t\t\treturn \"13\";\n\t\t\tcase '[':\n\t\t\t\treturn \"14\";\n\t\t\tcase ']':\n\t\t\t\treturn \"15\";\n\t\t}\n\t}\n\t$stdin = fopen(\"php://stdin\", \"r\");\n\t$str = fgets($stdin);\n\t$len = strlen($str);\n\t$num = \"0\";\n\tfor($i = 0; $i < $len-1; $i++)\n\t{\n\t\t$num = bcmul($num, \"16\");\n\t\t$num = bcadd($num, gao($str[$i]));\n\t}\n\techo (bcmod($num, \"1000003\")).\"\\n\";\n?>\n", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "ce42a6483cce6a7ab2301f16c1618011", "src_uid": "04fc8dfb856056f35d296402ad1b2da1", "difficulty": 1200} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "5a322ace6e66351a9f0168516a310d9c", "src_uid": "a081d400a5ce22899b91df38ba98eecc", "difficulty": 1300} {"lang": "PHP", "source_code": "", "lang_cluster": "PHP", "compilation_error": false, "code_uid": "0765e39642831ea97da4a8a94a24b285", "src_uid": "b3f29d9c27cbfeadb96b6ac9ffd6bc8f", "difficulty": 2200}