{"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n int\n\tvar t int\n\tfmt.Scanf(\"%d %s\", &n, &t)\n\tfmt.Print(solution(n, t))\n}\n\nfunc solution(n int, t string) string {\n\n\tlenT := len(t)\n\tif n == 1 && lenT > 1 {\n\t\treturn \"-1\"\n\t}\n\tif lenT > 1 {\n\t\trunes := []rune(strings.Repeat(t, n))\n\t\treturn string(runes[:n - lenT]) + t\n\t}\n\treturn strings.Repeat(t, n)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "2a4855da65554e4ec762859acb5ee2c5", "src_uid": "77ffc1e38c32087f98ab5b3cb11cd2ed", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n \nimport (\n \"fmt\"\n \"strconv\"\n)\n \nfunc main(){\n var text string\n fmt.Scanf(text)\n i, _ := strconv.Atoi(text)\n if (i%2==0 i>2) {\n fmt.Println(\"YES\")\n return\n }\n fmt.Println(\"NO\")\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "b3fbcb3be7ce629d7eb2ab05fb257a2b", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main \n \nimport \"fmt\"\n \n// main function \nfunc main() {\n var int temp\n fmt.Scanln(&temp)\n if(temp%2 == 0)\n {\n if((temp/2)%2 == 0) fmt.Println(\"YES\")\n else fmt.Println(\"NO\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "6b0986f4857d28ca1c8bca0caa1fcb36", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var w int\n fmt.scanf(\"%d\", &w)\n if w % 2 == 0 {\n fmt.println(\"YES\")\n } else {\n fmt.println(\"NO\")\n }\n \n return 0\n}\n ", "lang_cluster": "Go", "compilation_error": true, "code_uid": "fbae9d7657612f6ffef49179ea344aa8", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "\npackage main\n\nimport (\n \"bufio\" \"fmt\")\n\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\ntext:= reader.ReadString('\\n')\nif text > 2 $ text % 2 == 0{\nfmt.Println('YES')\n}\nelse{\n fmt.Println('NO')\n}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "93785a6bf66957d2ae10f518fa376e96", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "import \"fmt\"\n\nfunc main() {\n var w int\n fmt.Scanfln(&w)\n return w % 4 == 0\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "3fc13b6100e9f7cf2000460b90d8a88d", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n)\n \nfunc main(){\n reader := bufio.NewReader(os.Stdin)\n fmt.Print(\"Enter text: \")\n text, _ := reader.ReadString('\\n')\n i, _ = strconv.Atoi(text)\n if i%2==0 {\n fmt.Println(\"YES\")\n return\n }\n fmt.Println(\"NO\")\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "4f376c394b758d6cef9066e1372ffbc9", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main(){\n var n int\n fmt.Scan(&n)\n if n % 2 == 0 && n > 2{\n fmt.Println(\"YES\")\n }else{\n fmt.Println(\"NO\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "69d60df3f515eaac76786b5020efc581", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"math\"\n)\n \nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tvar w uint8\n\tfmt.Fscanf(in, \"%d\\n\", &w)\n\tif w == 2 {\n\t\tfmt.Println(\"NO\")\n\t}\n\tif w % 2 == 0{\n\t\tfmt.Println(\"YES\")\n\t}else{\n\t\tfmt.Println(\"NO\")\n\t}\n} \n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "87a897c8309d7697b2838ffee089bac4", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc check(n int) int {\n\treturn n%2\n}\n\nfunc main() {\n\tvar n\n\tfmt.Scanf(\"%d\",&n)\n\tif check(n) == 0 && n != 2 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "6512d52aa407e4f50ee5cb22ea1f2ea1", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var melon int\n fmt.Scanln(&melon)\n if melon % 2 == 1 or melon == 0: {\n fmt.Println(\"NO\")\n } else {\n fmt.Println(\"YES\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "22a84411c33fab9a1680cee294884e8c", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nfunc main() {\n r := bufio.NewReader(os.Stdin)\n\ts, _ := r.ReadString('\\n')\n\tn, _ := strconv.Atoi(s)\n\tif n %2 == 0 {\n\t fmt.Println(\"YES\")\n\t return\n\t}\n\tfmt.Prinln(\"NO\")\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "3e0ee23a82ffa189ac858b61ff2fb91a", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n \"fmt\"\n \"os\"\n)\n \nfunc main(){\n reader := bufio.NewReader(os.Stdin)\n fmt.Print(\"Enter text: \")\n text, _ := reader.ReadString('\\n')\n if int(text)%2==0 {\n fmt.Println(\"YES\")\n return\n }\n fmt.Println(\"NO\")\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "5b0c901c680b7553254e6ad4a2054e42", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main \n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar w int\n\tif(w % 2 == 0){\n\t\tfmt.println(\"YES\")\n\t}else{\n\t\tfmt.println(\"NO\")\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "e50c88442d74febc7197ec3c02d7cbaf", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc check(n int) int {\n\treturn n%2\n}\n\nfunc main() {\n\tn int\n\tfmt.Scanf(\"%d\",&n)\n\n\tif check(n) == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "3ca6406ed09bf2f84a443be60920b74b", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\nfunc main() {\n var w int\n fmt.Scan(&w)\n\tif w%2 == 0 && w > 2 {\n\t\tfmt.Println(\"YES\")\n\t} \n\telse {\n\t\tfmt.Println(\"NO\")\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "c918df19fbb648b78104351039ab82bf", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n)\n \nfunc main(){\n reader := bufio.NewReader(os.Stdin)\n fmt.Print(\"Enter text: \")\n text, _ := reader.ReadString('\\n')\n if int(text)%2==0 {\n fmt.Println(\"YES\")\n return\n }\n fmt.Println(\"NO\")\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "82481a03acc0f74f75b22a0f456cc61b", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "//1.11 | CodeForces.Com\npackage main\nimport \"fmt\"\nfunc main()\n{\n var weight int8\n fmt.Scan(&weight)\n \n if(weight & 1 == 1 || weight == 2) {\n fmt.Print(\"NO\")\n } else {\n fmt.Print(\"YES\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "ee293d4ce547eedc980fa980bf815119", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n )\n\nfunc main() {\n var kilos int := 0\n fmt.Scan(kilos)\n if kilos < 2 {\n fmt.Println(\"NO\")\n else if kilos %2 == 0 {\n fmt.Println(\"YES\")\n }\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "92ebd68ed0958d9b314c51b1e12301fe", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc check(int n) int{\n\treturn n%2\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\",&n)\n\tif check(n) == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "78b5aa189016f81a0f37a1ec034a1ea9", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "func main() {\n\tfmt.Println(\"Enter weight of the watermelon: \")\n\tvar wt int\n\t// Taking input from user\n\tfmt.Scanln(&wt)\n\n\tif wt%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t}\n\tfmt.Println(\"NO\")\n\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "65829c822ca02f250b2c636b2b3db45d", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tyear, _ := reader.ReadString('\\n')\n\tyear = strings.TrimSuffix(year, \"\\n\")\n\tisUnique := false\n\tfor !isUnique {\n\t\tfmt.Println(year)\n\t\tyearInt, err := strconv.ParseInt(year, 10, 64)\n\t\tfmt.Println(yearInt, year, err)\n\t\tyearInt++\n\t\tyear = strconv.Itoa(yearInt)\n\t\tfor _, val := range year {\n\t\t\tif strings.Count(year, string(val)) < 2 {\n\t\t\t\tisUnique = true\n\t\t\t} else {\n\t\t\t\tisUnique = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfmt.Println(year, isUnique)\n\t\tif isUnique {\n\t\t\tfmt.Print(yearInt)\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "78cb50b350e0a3be07358336b2649ae6", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tyear, _ := reader.ReadString('\\n')\n\tyear = strings.TrimSuffix(year, \"\\n\")\n\tisUnique := false\n\tfor !isUnique {\n\t\tfmt.Println(year)\n\t\tyearInt, err := strconv.ParseInt(year, 0, 64)\n\t\tfmt.Println(yearInt, year, err)\n\t\tyearInt++\n\t\tyear = strconv.Itoa(yearInt)\n\t\tfor _, val := range year {\n\t\t\tif strings.Count(year, string(val)) < 2 {\n\t\t\t\tisUnique = true\n\t\t\t} else {\n\t\t\t\tisUnique = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfmt.Println(year, isUnique)\n\t\tif isUnique {\n\t\t\tfmt.Print(yearInt)\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "285e0decb2a9b7520b717f5a2638623e", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n \nfunc main() {\n\tvar s string\n\tfmt.Scanf(\"%s\\n\", &s)\n\tstrings.toLower(s)\n\tfor i:=0; i\n\nusing namespace std;\n\nint main() {\n string str;\n cin >> str;\n int n;\n\tn = str.size();\n\tfor(int i=0;i= margin && solved [i] >= 0{\n cnt++\n }\n \n }\n \n fmt.Printf(\"%d\", cnt)\n}}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "ec0271ab456861c03f6844b9df715ee6", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\nimport \"math\"\n\nfunc main(){\n{\n var n, k , cnt int \n \n fmt.Scanf (\"%d %d\", &n, &k)\n \n var solved [50 + 10] int \n \n for i := 0; i < n; i++ {\n fmt.Scanf (\"%d\", &solved [i])\n }\n \n margin := solved [k - 1]\n \n var i int\n i = 0\n \n for i = 0; i < n; i++ {\n if solved[i] >= margin && solved [i] >= 0{\n cnt++\n }\n \n }\n \n fmt.Printf(\"%d\", cnt)\n}}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a35860aac061f6d3b89e0633e86ced81", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "Go", "source_code": "\tpackage main\n\n\timport \"fmt\"\n\n\tfunc main() {\n\t\tvar input string\n\t\tvar count,trans int \n\t\t//fmt.Println(\"enter the value of input:\")\n\t\tfmt.Scanln(&input)\n\t\tlen:=len(input)\n\t\tfor i := 0; i < len; i++ {\n\t\t\tif i==0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif count>=7 {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif input[i]==input[i-1] {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t\t\n\t\t\tfmt.Println(\"NO\")\n\t\t\n\t}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a7ddc9dc8960de02c1f4463deb6b6620", "src_uid": "ed9a763362abc6ed40356731f1036b38", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main(){\n\tvar s string\n\tfmt.Scanf(\"%s\", &s)\n\n\tif strings.Contains(s, \"1111111\") || strings.Contains(s, \"0000000\"){\n\t\tfmt.Println(\"YES\")\n\t}else{\n\t\tfmt.Println(\"NO\")\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "de420b4671e0865e64728d50bd1d946b", "src_uid": "ed9a763362abc6ed40356731f1036b38", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var m, n int\n fmt.Scanf(&m, &n)\n fmt.Println(m * n / 2)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "09fe807b2c5b74e9fb395ebcfd3b2224", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nfunc main() {\n\tvar n, m, a, count int\n\tfmt.Scanf(\"%d%d%d\", &n, &m, &a)\n\tvar nn, mm int = n, m\n\tfor {\n\t\tif nn < n {\n\t\t\tnn += n\n\t\t\tcount++\n\t\t}\n\t\tif mm < m {\n\t\t\tmm += m\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "38258ab0ed4d44d6f857dd0821a86dce", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n \nimport (\n \"fmt\"\n)\n \nfunc main(){\n var i, j int\n var k int64\n fmt.Scanf(\"%d %d %d\\n\", &i, &j, &k)\n var int n = i/k\n var int m = j/k\n if i%k!=0{\n n++\n }\n if j%k!=0{\n m++\n }\n fmt.Println(n*m)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "1fa79c35d09ad2d7a17127935ab6ce71", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"strconv\"\n\t\"os\"\n)\n\nfunc main() {\n\tn, m, a := s.Next(), s.Next(), s.Next()\n\tn, m = n / a, m / a\n\tif n % a != 0 {\n\t\tn++\n\t}\n\tif m % a != 0 {\n\t m++\n\t}\n\ts.Println(n * m)\n\ts.Flush()\n}\n\nfunc init() {\n\ts := NewInOut(os.Stdin, os.Stdout)\n}\n\nvar (\n\ts InOut\n)\n\n// IO Lib\ntype InOut struct {\n\t*bufio.Reader\n\t*bufio.Writer\n}\n\nfunc NewInOut(r io.Reader, w io.Writer) *InOut {\n\treturn &InOut{bufio.NewReader(r), bufio.NewWriter(w)}\n}\n\n// Get Next Integer\nfunc (s *InOut) Next() (r int) {\n\tb, _ := s.ReadByte()\n\tp := 1\n\tfor (b < '0' || '9' < b) && b != '-' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tif b == '-' {\n\t\tp = -1\n\t\tb, _ = s.ReadByte()\n\t}\n\tfor '0' <= b && b <= '9' {\n\t\tr = 10*r + int(b-'0')\n\t\tb, _ = s.ReadByte()\n\t}\n\treturn r * p\n}\n\n// Get Next Line String\nfunc (s *InOut) NextLine() (r string) {\n\tb, _ := s.ReadByte()\n\tfor b == '\\n' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tbuf := make([]byte, 0)\n\tfor ; b != '\\n'; b, _ = s.ReadByte() {\n\t\tbuf = append(buf, b)\n\t}\n\treturn string(buf)\n}\n\n// Get Next String using delimiter whitespace\nfunc (s *InOut) NextStr() (r string) {\n\tb, _ := s.ReadByte()\n\tfor b == '\\n' || b == ' ' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tbuf := make([]byte, 0)\n\tfor ; b != '\\n' && b != ' '; b, _ = s.ReadByte() {\n\t\tbuf = append(buf, b)\n\t}\n\treturn string(buf)\n}\n\n// Print Strings using the suitable way to change type\nfunc (s *InOut) Print(os ...interface{}) {\n\tfor _, o := range os {\n\t\tswitch o.(type) {\n\t\tcase byte:\n\t\t\ts.WriteByte(o.(byte))\n\t\tcase string:\n\t\t\ts.WriteString(o.(string))\n\t\tcase int:\n\t\t\ts.WriteString(strconv.Itoa(o.(int)))\n\t\tcase int64:\n\t\t\ts.WriteString(strconv.FormatInt(o.(int64), 10))\n\t\tdefault:\n\t\t\ts.WriteString(fmt.Sprint(o))\n\t\t}\n\t}\n}\n\n// Print Strings using the suitable way to change type with new line\nfunc (s *InOut) Println(os ...interface{}) {\n\tfor _, o := range os {\n\t\ts.Print(o)\n\t}\n\ts.Print(\"\\n\")\n}\n\n// Print immediately with new line (for debug)\nfunc (s *InOut) PrintlnNow(o interface{}) {\n\tfmt.Println(o)\n}\n\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "00e46d31dbce7c6c5c06f947351a5bd1", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "/*A. Theatre Square\ntime limit per test1 second\nmemory limit per test256 megabytes\ninputstandard input\noutputstandard output\nTheatre Square in the capital city of Berland has a rectangular shape with the size n\u2009\u00d7\u2009m meters. On the occasion of the city's anniversary, a decision was taken to pave the Square with square granite flagstones. Each flagstone is of the size a\u2009\u00d7\u2009a.\n\nWhat is the least number of flagstones needed to pave the Square? It's allowed to cover the surface larger than the Theatre Square, but the Square has to be covered. It's not allowed to break the flagstones. The sides of flagstones should be parallel to the sides of the Square.\n\nInput\nThe input contains three positive integer numbers in the first line: n,\u2009\u2009m and a (1\u2009\u2264\u2009\u2009n,\u2009m,\u2009a\u2009\u2264\u2009109).\n\nOutput\nWrite the needed number of flagstones.\n\nExamples\ninputCopy\n6 6 4\noutputCopy\n4\n*/\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, m, a float32\n\tfmt.Scanf(\"%b %b %b\", &n, &m, &a)\n\n\ta_in_n_ceil := uint64(math.Ceil(n / a))\n\n\ta_in_m_ceil := uint64(math.Ceil(m / a))\n\n\ta_in_n_and_m := a_in_n_ceil * a_in_m_ceil\n\n\t/*\tsquare_volume := n * m\n\t\tflagstone_volume := a * a\n\n\t\tif flagstone_volume >= square_volume {\n\t\t\ta_in_n_and_m = 1\n\t\t}\n\t*/\n\tfmt.Println(a_in_n_and_m)\n\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "58cef6a195612cdcbfb3c009fc6a1494", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"strconv\"\n\t\"os\"\n)\n\nfunc main() {\n\tn, m, a := s.NextInt64(), s.NextInt64(), s.NextInt64()\n\tx, y := n / a, m / a\n\tif n % a != 0 {\n\t\tx++\n\t}\n\tif m % a != 0 {\n\t\ty++\n\t}\n\ts.Println(x * y)\n\ts.Flush()\n}\n\nvar (\n\ts *InOut\n)\n\nfunc init() {\n\ts = NewInOut(os.Stdin, os.Stdout)\n}\n\ntype InOut struct {\n\t*bufio.Reader\n\t*bufio.Writer\n}\n\nfunc NewInOut(r io.Reader, w io.Writer) *InOut {\n\treturn &InOut{bufio.NewReader(r), bufio.NewWriter(w)}\n}\n\n// Get Next Integer\nfunc (s *InOut) Next() (r int) {\n\tb, _ := s.ReadByte()\n\tp := 1\n\tfor (b < '0' || '9' < b) && b != '-' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tif b == '-' {\n\t\tp = -1\n\t\tb, _ = s.ReadByte()\n\t}\n\tfor '0' <= b && b <= '9' {\n\t\tr = 10*r + int(b-'0')\n\t\tb, _ = s.ReadByte()\n\t}\n\treturn r * p\n}\n\nfunc (s *InOut) NextInt64() (r int64) {\n\tb, _ := s.ReadByte()\n\tp := 1\n\tfor (b < '0' || '9' < b) && b != '-' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tif b == '-' {\n\t\tp = -1\n\t\tb, _ = s.ReadByte()\n\t}\n\tfor '0' <= b && b <= '9' {\n\t\tr = 10*r + int(b-'0')\n\t\tb, _ = s.ReadByte()\n\t}\n\treturn r * p\n}\n\n// Get Next Line String\nfunc (s *InOut) NextLine() (r string) {\n\tb, _ := s.ReadByte()\n\tfor b == '\\n' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tbuf := make([]byte, 0)\n\tfor ; b != '\\n'; b, _ = s.ReadByte() {\n\t\tbuf = append(buf, b)\n\t}\n\treturn string(buf)\n}\n\n// Get Next String using delimiter whitespace\nfunc (s *InOut) NextStr() (r string) {\n\tb, _ := s.ReadByte()\n\tfor b == '\\n' || b == ' ' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tbuf := make([]byte, 0)\n\tfor ; b != '\\n' && b != ' '; b, _ = s.ReadByte() {\n\t\tbuf = append(buf, b)\n\t}\n\treturn string(buf)\n}\n\n// Print Strings using the suitable way to change type\nfunc (s *InOut) Print(os ...interface{}) {\n\tfor _, o := range os {\n\t\tswitch o.(type) {\n\t\tcase byte:\n\t\t\ts.WriteByte(o.(byte))\n\t\tcase string:\n\t\t\ts.WriteString(o.(string))\n\t\tcase int:\n\t\t\ts.WriteString(strconv.Itoa(o.(int)))\n\t\tcase int64:\n\t\t\ts.WriteString(strconv.FormatInt(o.(int64), 10))\n\t\tdefault:\n\t\t\ts.WriteString(fmt.Sprint(o))\n\t\t}\n\t}\n}\n\n// Print Strings using the suitable way to change type with new line\nfunc (s *InOut) Println(os ...interface{}) {\n\tfor _, o := range os {\n\t\ts.Print(o)\n\t}\n\ts.Print(\"\\n\")\n}\n\n// Print immediately with new line (for debug)\nfunc (s *InOut) PrintlnNow(o interface{}) {\n\tfmt.Println(o)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "d643a2e9f010d8f9a066f9daafb84a33", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n var n,m,a int64 \n fmt.Scan(&n,&m,&a)\n var tiles1,tiles2 float = n/a, m/a\n \n if(n%a!=0) {tiles1++}\n if(m%a!=0) {tiles2++}\n \n var hasil float = tiles1 * tiles2\n fmt.Println(hasil)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "f1e5822bf00125968ff8fb9eee972552", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var m, n, a int64;\n fmt.Scanf(\"%d\", &m)\n fmt.Scanf(\"%d\", &n)\n fmt.Scanf(\"%d\", &a)\n\n var x, y int;\n for x=m/a; x*a < m; x++ {}\n for y=n/a; y*a < n; y++ {}\n\n fmt.Println(x*y)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "b6b682cc46d365c3cabecc9ea2e196c7", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\\n\", &n)\n\tif n == 1000000000000000{\n\t\tfmt.Println(500000000000000)\n\t}\n\tif n&1 == 0 {\n\t\tfmt.Println(n >> 1)\n\t}else{\n\t\tfmt.Println(-(n + 1) >> 1)\n\t}\n\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "49c9c5593bdd4ac2cdf73e420c50af73", "src_uid": "689e7876048ee4eb7479e838c981f068", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\nimport (\n \"fmt\"\n) \nfunc main() {\n var n,k int\n fmt.Scan(&n)\n for _,i := range({100,20,10,5,1}){\n k += n/i\n n %= i\n }\n fmt.Println(k)", "lang_cluster": "Go", "compilation_error": true, "code_uid": "1f6390250760ab11151c36a11deaacb7", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n \nvar reader *bufio.Reader\n \nfunc init() {\n\tstdin := os.Stdin\n\t// stdin, _ = os.Open(\"1.in\")\n\treader = bufio.NewReaderSize(stdin, 1<<20)\n}\n \nvar n int\n \nfunc main() {\n\tfmt.Fscan(reader, &n)\n\tans := 0\n\tans += n / 100\n\tn %= 100\n\tans += n / 20\n\tn %= 20\n\tans += n / 10\n\tn %= 10\n\tans += n / 5\n\tn %= 5\n\tans += n\n\tfmt.Println(ans)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a7418267856c0d1160523592d192bbd3", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\n)\n\nfunc main() {\n arr := []int{1,5,10,20,100}\n var num int\n \n fmt.Scan(&num)\n count := 0\n startIndex := 4\n for num > 0 {\n if num < arr[startIndex] {\n startIndex--\n continue\n }\n count += num / arr[startIndex]\n num = num % arr[startIndex]\n startIndex--\n }\n \n fmt.Println(num)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "ad8831a9ab960901f0e0914e61789c74", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst lineDelim = '\\r'\n\nfunc readInts(r *bufio.Reader) []int64 {\n\tstr, _ := r.ReadString(lineDelim)\n\tstr = str[:len(str)-1]\n\tnumbersRaw := strings.Split(str, \" \")\n\tvar numbers []int64\n\tfor _, i := range numbersRaw {\n\t\tn, _ := strconv.Atoi(i)\n\t\tnumbers = append(numbers, int64(n))\n\t}\n\n\treturn numbers\n}\n\nfunc readInt(r *bufio.Reader) int64 {\n\tstr, _ := r.ReadString(lineDelim)\n\tstr = str[:len(str)-1]\n\tn, _ := strconv.Atoi(str)\n\n\treturn int64(n)\n}\n\nfunc readString(r *bufio.Reader) string {\n\tstr, _ := r.ReadString(lineDelim)\n\tstr = str[:len(str)-1]\n\n\treturn str\n}\n\nfunc debug(s string, mask int) {\n\tfmt.Printf(\"%s: %#v\\n\", s, strconv.FormatInt(int64(mask), 2))\n}\n\nfunc decbin(dec int) string {\n\treturn strconv.FormatInt(int64(dec), 2)\n}\n\nfunc check(mask, target int) bool {\n\treturn mask&target == target\n}\n\nfunc takeBlueOut(mask int) int {\n\treturn mask\n}\n\nfunc makeRed(mask, i int) int {\n\treturn (mask | (1 << i))\n}\n\nfunc isRed(mask, i int) bool {\n\treturn (mask & (1 << i)) == (1 << i)\n}\n\nfunc isBlue(mask, i int) bool {\n\treturn !isRed(mask, i)\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tn := int(readInt(reader))\n\tmask := 0\n\ttarget := 0\n\tfor i := 0; i < n; i++ {\n\t\tb, _ := reader.ReadByte()\n\t\tmask ^= (int(b) % 3) << i\n\t\ttarget ^= 1 << i\n\t\t// debug(\"mask\", mask)\n\t\t// debug(\"target\", target)\n\t}\n\n\tj := 0\n\tfor {\n\t\tblueFill := 0\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif check(mask, target) {\n\t\t\t\tfmt.Println(j)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tshift := (1 << i)\n\t\t\t// fmt.Printf(\"i: %d | j: %d | 1 << %d: %d | isRed: %t | blueFill: %s | mask: %s\\n\", i, j, i, shift, isRed(mask, i), decbin(blueFill), decbin(mask))\n\t\t\tif isBlue(mask, i) {\n\t\t\t\tj++\n\t\t\t\tmask = makeRed(mask, i)\n\t\t\t\tmask ^= blueFill\n\t\t\t\tblueFill ^= blueFill\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tblueFill ^= shift\n\t\t\t}\n\t\t\t// fmt.Printf(\"i: %d | j: %d | 1 << %d: %d | isRed: %t | blueFill: %s | mask: %s\\n\", i, j, i, shift, isRed(mask, i), decbin(blueFill), decbin(mask))\n\t\t\t// time.Sleep(2 * time.Second)\n\t\t}\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "cc226e052faac9497fc4b0c29ea0e91a", "src_uid": "d86a1b5bf9fe9a985f7b030fedd29d58", "difficulty": null} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\nfunc check(e error) {\n\tif e != nil {\n\t\tpanic(e)\n\t}\n}\n\nfunc main() {\n\tA := 4\n\tB := 1001\n\tvar n,m int\n\tscanf(\"%d %d\\n\",&n, &m)\n\tf := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tscanf(\"%d\",&f[i])\n\t}\n\tsort.Ints(f)\n\tfor i, v := range f {\n\t\tif i < n {\n\t\t\tif v > A {\n\t\t\t\tA = v\n\t\t\t}\n\n\t\t\tif v < B {\n\t\t\t\tB = v\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"%d\", A-B)\n}\n\nfunc printf(format string, x ...interface{}) {\n\tfmt.Fprintf(os.Stdout, format, x...)\n}\n\nfunc scanf(format string, x ...interface{}) {\n\tif _, err := fmt.Fscanf(os.Stdin, format, x...); err != nil {\n\t\tpanic(err)\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "e9294943498a488911a9173d2e65f69b", "src_uid": "7830aabb0663e645d54004063746e47f", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main(){\n\tvar c string\n\tvar ct [5]string\n\tfmt.Scan(&c)\n\tfor i:=0; i<5; i++{\n\t\tfmt.Scan(&ct[i])\n\t\t\tif(c[0] == ct[i][0] || c[1] == ct[i][1]){\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\tos.Exit(0)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "77f11a9f1709271f5486ffe49119ae8b", "src_uid": "699444eb6366ad12bc77e7ac2602d74b", "difficulty": 800.0} {"lang": "Go", "source_code": "//HOWDY! IT'S ME! A HARD BLACKISH DICK MOVE!\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := PrintlnInts(X...)\n\n/*******************************************************************/\n\nfunc ans(b bool) string {\n\tif b {\n\t\treturn \"YES\"\n\t}\n\treturn \"NO\"\n}\n\nfunc main() {\n\ta := ReadIntSlice(4)\n\tsort.Ints(a)\n\tans := ans(a[0]+a[3] == a[1]+a[2])\n\tfmt.Println(ans)\n}\n\n/*********** Math ***********/\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc min(args ...int) int {\n\tif len(args) == 0 {\n\t\tpanic(\"empty!\")\n\t}\n\tmin := args[0]\n\tfor i := 1; i < len(args); i++ {\n\t\tif args[i] < min {\n\t\t\tmin = args[i]\n\t\t}\n\t}\n\treturn min\n}\n\nfunc max(args ...int) int {\n\tif len(args) == 0 {\n\t\tpanic(\"empty!\")\n\t}\n\tmax := args[0]\n\tfor i := 1; i < len(args); i++ {\n\t\tif args[i] > max {\n\t\t\tmax = args[i]\n\t\t}\n\t}\n\treturn max\n}\n\nfunc _gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn _gcd(b, a%b)\n}\n\nfunc gcd(args ...int) int {\n\tif len(args) == 0 {\n\t\tpanic(\"empty!\")\n\t}\n\tgcd := args[0]\n\tfor i := 1; i < len(args); i++ {\n\t\tgcd = _gcd(gcd, args[i])\n\t}\n\treturn gcd\n}\n\nfunc sum(a []int) int {\n\tret := 0\n\tfor _, v := range a {\n\t\tret += v\n\t}\n\treturn ret\n}\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\tReadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\t// Split sets the split function for the Scanner. The default split function is ScanLines.\n\t// Split panics if it is called after scanning has started.\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintlnInts(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "512b4b9e672ed621e2aba1aaca9fe52e", "src_uid": "5a623c49cf7effacfb58bc82f8eaff37", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString, readBytes = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+10))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\treturn []byte(f1())\n\t}\n\treturn f1, f2\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc max64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc abs64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc gcd64(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd64(b, a%b)\n}\n\n// readString() string\n// readInt() int\n// readInt64() int64\n// readFloat64() float64\n\n// -----------------------------------------------------------------------------\n\nfunc main() {\n\tdefer stdout.Flush()\n\tn := readInt64()\n\tk := readInt()\n\n\tvar ans int64 = n\n\tfor i := 0; i < k; i++ {\n\t\tif ans%10 == 0 {\n\t\t\tans /= 10\n\t\t} else {\n\t\t\tans--\n\t\t}\n\t}\n\tprintln(ans)\n}\n\n// -----------------------------------------------------------------------------\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "dadc7a1157ff230eae4cd3c8b919d874", "src_uid": "064162604284ce252b88050b4174ba55", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main1() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\n\tline := make([]int, n)\n\tfor i, _ := range line {\n\t\tfmt.Scanf(\"%d\", &line[i])\n\t}\n\n\tcount := 0\n\n\tfor ; !sort.SliceIsSorted(line, compare(line)); {\n\n\t}\n\tfmt.Print(count)\n\n}\n\nfunc compare(line []int) func(i int, j int) bool {\n\treturn func(i, j int) bool {\n\t\treturn line[i] < line[j]\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "2d140f3c90c15dc884fb2d85e83774da", "src_uid": "064162604284ce252b88050b4174ba55", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d \\n\", &n)\n\tfmt.Println(findMinBacteries(float64(n)))\n}\n\nfunc findMinBacteries(n float64) int {\n\tc := 0\n\tfor p := 0; n > 0; p++ {\n\t\ts := math.Pow(2, float64(p))\n\t\tif s > n {\n\t\t\tn -= math.Pow(2, float64(p-1))\n\t\t\tp = 0\n\t\t\tc++\n\t\t} else if s == n {\n\t\t\tn = 0\n\t\t\tc++\n\t\t}\n\t}\n\treturn c\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "d4cd44272b460a192025c58c0194c34f", "src_uid": "03e4482d53a059134676f431be4c16d2", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\ttext := scanner.Text()\n\tn, _ := strconv.Atoi(text)\n\tres := \"EASY\"\n\tscanner.Scan()\n\tans := strings.Split(scanner.Text(), \" \")\n\tfor i := 0; i < n; i++ {\n\t\tif a, _ := strconv.Atoi(ans[i]); a == 1 {\n\t\t\tres = \"HARD\"\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "f3c3cc67246629b84fd2c8a775bd2fe2", "src_uid": "060406cd57739d929f54b4518a7ba83e", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var plus,num,current int\n current=0\n plus=1 \nfmt.Scan(&num)\nfor current= num {\nfmt.Println(\"Sheldon\")\nbreak\n}\ncurrent += plus\nif current >= num {\nfmt.Println(\"Leonard\")\nbreak\n}\ncurrent += plus\nif current >= num {\nfmt.Println(\"Penny\")\nbreak\n}\ncurrent += plus\nif current >= num {\nfmt.Println(\"Rajesh\")\nbreak\n}\ncurrent += plus\nif current >= num {\nfmt.Println(\"Howard\")\nbreak\n}\nplus *= 2\n}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a0c055f138b0075174c72280e8031290", "src_uid": "023b169765e81d896cdc1184e5a82b22", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\n\nvar (\n n int32\n m int 32\n k int32\n\n)\n\nfunc in() {\n fmt.Scanf(\"%d%d\", &n, &m)\n \n}\n\nfunc out() {\n fmt.Println(k)\n}\n\nfunc run() {\n for n > 0 {\n k++\n if k % m == 0 {\n k++\n }\n n--\n }\n}\n\nfunc main() {\n in()\n run()\n out()\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "9d7514a152dff36a1b7f00edd068ee79", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc solve(s string) int {\n\tvar current byte = 'a'\n\tsum := 0\n\tfor i := range s {\n\t\td := abs(int(current), int(s[i]))\n\t\tif d < 13 {\n\t\t\tsum += d\n\t\t} else {\n\t\t\tsum += 26 - d\n\t\t}\n\t\tcurrent = s[i]\n\t}\n\n\treturn sum\n}\n\nfunc abs(n1 int, n2 int) int {\n\td := n1 - n2\n\tif d > 0 {\n\t\treturn d\n\t}\n\n\treturn n2 - n1\n}\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\n\tvar s string\n\n\tfmt.Fscanf(r, \"%s\\n\", &s)\n\n\tfmt.Fprintf(os.Stdout, \"%d\\n\", solve(s))\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "2eff6e91f17c8b18ff1f19b68e6df6d4", "src_uid": "ecc890b3bdb9456441a2a265c60722dd", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc getCnt(n int) int {\n sum := 0\n for k:= 2; k*k*k <= n; k++ {\n sum += n/(k*k*k)\n }\n return sum\n}\n\nfunc main() {\n var m int\n fmt.Scan(&m)\n\n lo := 1\n hi := 10000000000000\n for lo+1 < hi {\n mid := (lo+hi)/2\n sum := 0\n for k:= 2; k*k*k <= mid; k++ {\n sum += mid/(k*k*k)\n }\n if sum >= m {\n hi = mid\n } else {\n lo = mid\n }\n }\n hiCnt := getCnt(hi)\n if hiCnt == m {\n fmt.Println(hi)\n } else {\n fmt.Println(-1)\n }\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "625ef5e2c75588e16abb0f0abc926e7d", "src_uid": "602deaad5c66e264997249457d555129", "difficulty": 1700.0} {"lang": "Go", "source_code": "package R593_Div2_B\n\nimport (\n\t\"fmt\"\n\t\"math/big\"\n)\n\nfunc main() {\n\tvar n, m int64\n\n\tfmt.Scanf(\"%d\", &n)\n\tfmt.Scanf(\"%d\", &m)\n\n\tvar tmp big.Int\n\n\tvar t1 = tmp.Exp(big.NewInt(2), big.NewInt(m), nil);\n\tvar t2 = tmp.Sub(t1, big.NewInt(1))\n\tvar t3 = tmp.Exp(t2, big.NewInt(n), big.NewInt(1_000_000_007))\n\n\tfmt.Print(t3)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "dfa6f47a0c0d50b72056427dfa297150", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "difficulty": 1500.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"strconv\"\n \"bufio\"\n \"os\"\n \"fmt\"\n)\n// var file, _ = os.Open(\"input.txt\")\n// var outfile, _ = os.Create(\"output.txt\")\n// var in = bufio.NewScanner(file)\n// var out = bufio.NewWriter(outfile)\nvar in = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc next() string {\n if !in.Scan() {\n panic(\"Scan error\")\n }\n return in.Text()\n}\n\nfunc nextInt() int {\n ret, _ := strconv.Atoi(next())\n return ret\n}\n\nfunc nextFloat() float64 {\n ret, _ := strconv.ParseFloat(next(), 64)\n return ret\n}\n\nfunc main() {\n defer out.Flush()\n in.Split(bufio.ScanWords)\n s := []byte(next())\n t := next()\n ok := false\n for i := 0; i < len(s); i++ {\n if s[i] + 1 < t[i] {\n s[i] = s[i] + 1\n ok = true\n break\n } else if s[i] + 1 == t[i] && i + 1 < len(s) && s[i + 1] < 'z' {\n s[i] + 1 = 'z'\n ok = true\n break\n }\n }\n if ok {\n fmt.Fprintln(out, string(s))\n } else {\n fmt.Fprintln(out, \"No such string\")\n }\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "5ed35e035ede112f6d2eedf37c367294", "src_uid": "47618510d2a17b1cc1e6a688201d51a3", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tintegerWord, _ := reader.ReadString('\\n')\n\tintegerSufx := strings.TrimSuffix(integerWord, \"\\n\")\n\tintV, _ := strconv.Atoi(integerSufx)\n\tstones, _ := reader.ReadString('\\n')\n\tstones = strings.TrimSuffix(stones, \"\\r\\n\")\n\tcopyi := intV\n\tfor _, v := range stones {\n\t\tcount := strings.Count(stones, string(v))\n\t\tif count > 1 {\n\t\t\tcount--\n\t\t\tstones = strings.ReplaceAll(stones, string(v), \"\")\n\t\t\tcopyi = copyi - count\n\t\t}\n\t}\n\n\tfmt.Print(intV - copyi)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "51d41bc251f03bc35a9777ead863e107", "src_uid": "d561436e2ddc9074b98ebbe49b9e27b8", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"fmt\"\n \"strings\"\n \"strconv\"\n )\n \nfunc main() {\n var a [100]int\n stin := bufio.NewScanner(os.Stdin)\n stin.Scan()\n n,_ := strconv.Atoi(stin.Text())\n stin.Scan()\n ss := strings.Fields(stin.Text())\n for i := 0; i < n; i++ {\n a[i],_ = strconv.Atoi(ss[i])\n }\n startPos := 0\n for i := 0; i < n; i++ {\n if a[i] == 1 {\n startPos = i\n break\n }\n }\n if startPos == 0 && a[0] == 0 {\n fmt.Printf(\"%d\", 0)\n return\n }\n finishPos := n-1\n for i := n-1; i >= 0; i-- {\n if a[i] == 1 {\n finishPos = i\n break\n }\n }\n// fmt.Printf(\"start = %d finish = %d\\n\", startPos, finishPos)\n if startPos == finishPos || startPos+1 == finishPos {\n fmt.Printf(\"%d\", 1)\n return\n }\n var totalCount uint64 = 1\n var previous1 int = startPos\n for i := startPos + 1; i <= finishPos; i++ {\n// fmt.Printf(\"totalCount at start = %d \", totalCount)\n// fmt.Printf(\"a[%d] = %d\\n\", i, a[i])\n if a[i] == 1 {\n totalCount *= i - previous1\n previous1 = i\n }\n// fmt.Printf(\"totalCount at finish = %d\\n\", totalCount)\n }\n fmt.Printf(\"%d\", totalCount)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "e34ce3a66e6bae28f2d83bac9165403c", "src_uid": "58242665476f1c4fa723848ff0ecda98", "difficulty": 1300.0} {"lang": "Go", "source_code": "\nRashidov_Anis\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n var afl int64\n var bfa int64\n var lrt int64\n var rgh int64\n var cnt int64\n afl = 1\n bfa = 1\n cnt = 0\n\tfmt.Scan(&lrt)\n\tfmt.Scan(&rgh)\n\tfor it := 0; it <= 19; it++ {\n\t bfa = 1\n\t for jt := 0; jt <= 30; jt ++ {\n\t if afl * bfa >= lrt {\n\t if afl * bfa <= rgh {\n\t cnt = cnt + 1\n\t }\n\t }\n\t bfa = bfa * 2\n\t }\n\t afl = afl * 3\n\t}\n\tfmt.Printf( \"%d\", cnt )\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "1c0eb1dea52ac9c4fa1ef2eedd86121a", "src_uid": "05fac54ed2064b46338bb18f897a4411", "difficulty": 1300.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\nfunc main(){\n var n,i,k,sum,c int32\n var f bool\n f=true\n fmt.Scanln(&n,&k)\n for i=1;i<=n;i++{\n var a int32\n fmt.Scanf(\"%d\",&a)\n if a>8{\n sum=sum+a-8\n c=c+8\n } else {\n\t\t\tif a+sum>8{\n \t\t sum=sum-8+a\n \t \tc=c+8\n \t\t} else {\n \tc=c+a\n \t}\n\t\t}\n if (c>=k){\n f=false\n break\n \t}\n }\n if f=false{\n fmt.Println(i)\n }\n else{\n fmt.Println(-1)\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "26f8ec162e5dc30cf40aeed4bd15149d", "src_uid": "24695b6a2aa573e90f0fe661b0c0bd3a", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\nfunc main(){\n var n,i,k,sum,c int32\n var f bool\n f=true\n fmt.Scanln(&n,&k)\n for i=1;i<=n;i++{\n var a int32\n fmt.Scanf(\"%d\",&a)\n if a>8{\n sum=sum+a-8\n c=c+8\n }\n else if (a+sum>8){\n sum=sum-8+a\n c=c+8\n }\n else{\n c=c+a\n }\n if (c>=k){\n f=false\n break\n \t}\n }\n if f=false{\n fmt.Println(i)\n }\n else{\n fmt.Println(-1)\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "fc2825f53da8232e3d3870c776409a35", "src_uid": "24695b6a2aa573e90f0fe661b0c0bd3a", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\nfunc main(){\n var n,i,k,sum,c int32\n var f bool\n f:=true\n fmt.Scanln(&n,&k)\n for i=1;i<=n;i++{\n var a int32\n fmt.Scanf(\"%d\",&a)\n if a>8{\n sum:=sum+a-8\n c:=c+8\n }\n else if a+sum>8{\n sum:=sum-8+a;\n c:=c+8\n }\n else{\n c:=c+a;\n }\n if c>=k{\n f=false;\n break;\n }\n }\n if f=false{\n fmt.Println(i)\n }\n else{\n fmt.Println(-1)\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a5fc4d4e1243fe29c66c4c5357490ffa", "src_uid": "24695b6a2aa573e90f0fe661b0c0bd3a", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n \"os\"\n)\n\nfunc main(){\n reader := os.Stdin\n\tdefer os.Stdin.Close()\n var target string\n\t_, err := fmt.Fscanln(reader, &target)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n var count, first, second int\n\t_, err := fmt.Fscanln(reader, &count)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n for i:=0; i < count; i++{\n var word string\n\t\t_, err := fmt.Fscanln(reader, &target)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\treturn\n\t\t}\n\n hasFirst := word[0] == target[1]\n hasSecond := word[1] == target[0]\n\n if hasFirst{\n first++\n }\n if hasSecond{\n second++\n }\n }\n if first > 0 && second > 0 {\n fmt.Println(\"YES\")\n return\n }\n fmt.Println(\"NO\")\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "08a2d0446968346b8d062cbfdb432ce1", "src_uid": "cad8283914da16bc41680857bd20fe9f", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n, k int\n\tinput := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(input, &n, &k)\n\tans := 11111111111\n\tfor i := 0; i < n; i++ {\n\t\tvar val int\n\t\tfmt.Fscan(input, &val)\n\t\t// fmt.Scanf(\"%d\", &val)\n\t\tif k%val == 0 {\n\t\t\tif ans > k/val {\n\t\t\t\tans = k / val\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "47c180bac1cb8830c439db0b9135ac35", "src_uid": "80520be9916045aca3a7de7bc925af1f", "difficulty": 900.0} {"lang": "Go", "source_code": "package c\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n, k int\n\tinput := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(input, &n, &k)\n\tans := 12345678\n\tfor i := 0; i < n; i++ {\n\t\tvar val int\n\t\tfmt.Fscan(input, &val)\n\t\t// fmt.Scanf(\"%d\", &val)\n\t\tif k%val == 0 {\n\t\t\tif ans > k/val {\n\t\t\t\tans = k / val\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "bfae473b9f5ead21a60102cea155d3d4", "src_uid": "80520be9916045aca3a7de7bc925af1f", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport(\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nfunc main(){\n\treader := bufio.NewReader(os.Stdin);\n\tfor{\n\t\ttext,_ := reader.ReadString('\\n');\n\t\ttext = strings.Replace(text, \"\\n\", \"\", -1);\n\t\tsplitted := strings.Split(text, \" \");\n\t\ta,_ := strconv.ParseInt(splitted[0], 10, 32);\n\t\tb,_ := strconv.ParseInt(splitted[1], 10, 32);\n\t\tvar cnt int = 0;\n\t\tfor a<=b{\n\t\t\tcnt++;\n\t\t\ta*=3;\n\t\t\tb*=2;\n\t\t}\n\t\tbreak;\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a7f2cd493491362ceed04696b39b91c4", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "difficulty": 800.0} {"lang": "Go", "source_code": "\nimport \"fmt\"\n\nfunc main() {\n\tvar n int32\n\tfmt.Scanf(\"%d\",&n)\n\tvar i int32\n\ti = n\n\tvar ans int32\n\ti ++\n\tans += 2\n\tfor true{\n\t\tif(i == 10){\n\t\t\tbreak\n\t\t}\n\t\tif i % 10 == 0 {\n\t\t\tfor i % 10 == 0{\n\t\t\t\ti /= 10\n\t\t\t}\n\t\t}\n\t\ti ++\n\t\tans ++\n\t}\n\tfmt.Println(ans)\n\n\n\n\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "fb037a06f202ae880fcd23f6b42cdb91", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d\\n%d\", &n, &m)\n\n\tvar exp int = 1\n\tfor i := 0; i < n; i++ {\n\t\texp = (exp * 2) % 10000000000\n\n\t}\n\n\tfmt.Println(m % exp)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "36afc0e1da7b9152c3acbd69035984cf", "src_uid": "c649052b549126e600691931b512022f", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\nimport \"sort\"\n\ntype pair struct {\n index int\n num int\n}\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n nums := make([]pair, n)\n for i:=0; i < n; i++ {\n var tmp int\n fmt.Scan(&tmp)\n nums[i].index, nums[i].num = i+1, tmp\n }\n sort.Slice(nums, func(i, j pair) bool {\n return i.num < j.num\n })\n \n f, b := 0, len(nums)-1\n for f < b {\n fmt.Printf(\"%d %d\\n\", nums[f].index, nums[b].index)\n f++\n b--\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "b245d4091b702836304a2daccca808a1", "src_uid": "6e5011801ceff9d76e33e0908b695132", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\nimport \"sort\"\n\ntype Pair struct {\n index int\n num int\n}\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n nums := make([]pair, n)\n for i:=0; i < n; i++ {\n var tmp int\n fmt.Scan(&tmp)\n nums[i].index, nums[i].num = i+1, tmp\n }\n sort.Slice(nums, func(i, j int) bool {\n return nums[i].num < nums[j].num\n })\n \n f, b := 0, len(nums)-1\n for f < b {\n fmt.Printf(\"%d %d\\n\", nums[f].index, nums[b].index)\n f++\n b--\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "83df80de7c51b94c590b44931279dc3f", "src_uid": "6e5011801ceff9d76e33e0908b695132", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt()\n\ta := []rune(readString())\n\n\tcnt1 := 0\n\tcnt2 := 0\n\tfor i := 0; i < n-1; i++ {\n\t\tswitch a[i] {\n\t\tcase 'F':\n\t\t\tif a[i+1] == 'S' {\n\t\t\t\tcnt1++\n\t\t\t}\n\t\tcase 'S':\n\t\t\tif a[i+1] == 'F' {\n\t\t\t\tcnt2++\n\t\t\t}\n\t\t}\n\t}\n\tif cnt2 > cnt1 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "701f0601a4e876023bd017af2e9addca", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s str\n fmt.Scan(&s)\n min, cur := 0, 0\n for _, c := range s {\n if c == \"A\" || c == \"E\" || c == \"I\" || c == \"O\" || c == \"U\" || c == \"Y\" {\n if min < cur+1 {\n min = cur+1\n }\n cur = 0\n } else {\n cur++\n }\n }\n if min < cur+1 {\n min = cur+1\n }\n fmt.Print(min)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a904ffc3c1d30c0a4acece91576924c1", "src_uid": "1fc7e939cdeb015fe31f3cf1c0982fee", "difficulty": 1000.0} {"lang": "Go", "source_code": "import(\r\n\t\"fmt\"\r\n)\r\n\r\nfunc main() {\r\n\tvar t int\r\n\t_, err := fmt.Scan(&t)\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\r\n\tfor i := 0; t > i; i++ {\r\n\t\tvar a []int\r\n\t\tfor j := 0; 2 > j ; j++ {\r\n\t\t\tvar v1 int\r\n\t\t\tvar v2 int\r\n\t\t\t_, err := fmt.Scanf(\"%d %d\", &v1, &v2)\r\n\t\t\tif err != nil {\r\n\t\t\t\tpanic(err)\r\n\t\t\t}\r\n\t\t\ta = append(a, v1, v2)\r\n\t\t}\r\n\r\n\t\tif a[0] + a[1] + a[2] + a[3] == 4 {\r\n\t\t\tfmt.Printf(\"2\")\r\n\t\t} else if a[0] + a[1] + a[2] + a[3] == 0 {\r\n\t\t\tfmt.Printf(\"0\")\r\n\t\t} else {\r\n\t\t\tfmt.Printf(\"1\")\r\n\t\t}\r\n\t}\r\n\r\n}\r\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "daa022a3712bfc4a9ec5b5bfa73a92cc", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tx := calcNum(reader)\n\ty := calcNum(reader)\n\tif x < y {\n\t\tprint(\"<\")\n\t} else if x > y {\n\t\tprint(\">\")\n\t} else {\n\t\tprint(\"=\")\n\t}\n}\n\nfunc calcNum(reader *bufio.Reader) int64 {\n\tl1, err := reader.ReadString('\\n')\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tl2, err := reader.ReadString('\\n')\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tb, err := strconv.ParseInt(strings.Fields(l1)[1], 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdigits := strings.Fields(l2)\n\tn := int64(0)\n\tfor _, d := range digits {\n\t\tdig, err := strconv.ParseInt(d, 10, 64)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tn = n*b + dig\n\t}\n\treturn n\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "4288ccf8930152f68407a558ceec2a40", "src_uid": "d6ab5f75a7bee28f0af2bf168a0b2e67", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\n\n\nfunc main() {\n\tvar n,k int\n\tfmt.Scanf(\"%d%d\",&n,&k)\n\tremain := 240 - k\n\tsum := 0\n\tans := 0\n\tfor i := 1;i<=n&&sum<=remain;i++{\n\t\tsum += 5*i\n\t\tif sum<=remain\n\t\t\tans = i\n\t}\n\tfmt.Println(ans)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a06613b5bc04854b16a00b085bc526cb", "src_uid": "41e554bc323857be7b8483ee358a35e2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\n\n\nfunc main() {\n\tvar n,k int\n\tfmt.Scanf(\"%d%d\",&n,&k)\n\tremain := 240 - k\n\tsum := 0\n\tvar i int = 0\n\tfor var i int = 1;i<=n&&sum<=remain;i++{\n\t\tsum += 5*i\n\t\tif sum<=remain{\n\t\t\tans = i\n\t\t}\n\t}\n\tfmt.Println(ans)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "c1227a3abc35f974372d610cb221dd57", "src_uid": "41e554bc323857be7b8483ee358a35e2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n, s, ans int\n fmt.Scan(&n &s)\n \n for i=n; i > 0 && ; i-- {\n ans+=s/i\n s %= i\n }\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "eb3947c77a16c32b0c1229dd5aec0333", "src_uid": "04c067326ec897091c3dbcf4d134df96", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"io\"\r\n\t\"math\"\r\n\t\"os\"\r\n)\r\n\r\nfunc MIN(x, y int64) int64 {\r\n\tif x > y {\r\n\t\treturn y\r\n\t} else {\r\n\t\treturn x\r\n\t}\r\n}\r\n\r\nfunc MKO(x, y int64) int64 {\r\n\tif x < y {\r\n\t\treturn 0\r\n\t} else {\r\n\t\treturn x - y + 1\r\n\t}\r\n}\r\n\r\nfunc MAX(x, y int64) int64 {\r\n\tif x > y {\r\n\t\treturn x\r\n\t} else {\r\n\t\treturn y\r\n\t}\r\n}\r\n\r\nfunc LCM(x, y int) int {\r\n\tif x >= y {\r\n\t\tinitial := x\r\n\t\tfor i := 1; i < y+2; i++ {\r\n\t\t\tif initial%y == 0 {\r\n\t\t\t\tbreak\r\n\t\t\t} else {\r\n\t\t\t\tinitial = initial + x\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn initial\r\n\t} else {\r\n\t\tinitial := y\r\n\t\tfor i := 1; i < x+2; i++ {\r\n\t\t\tif initial%x == 0 {\r\n\t\t\t\tbreak\r\n\t\t\t} else {\r\n\t\t\t\tinitial = initial + y\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn initial\r\n\t}\r\n}\r\n\r\nfunc GCD(x, y int64) int64 {\r\n\tvar l, q int64\r\n\tl = MAX(x, y)\r\n\tq = MIN(x, y)\r\n\tvar m int64\r\n\tfor l*q > 0 {\r\n\t\ta := l % q\r\n\t\tb := l - a\r\n\t\tcc := int64(b / q)\r\n\t\tremain := l - cc*q\r\n\t\tl = MAX(remain, q)\r\n\t\tq = MIN(remain, q)\r\n\t\tif l*q == 0 {\r\n\t\t\tm = l + q\r\n\t\t\tbreak\r\n\t\t}\r\n\r\n\t}\r\n\treturn m\r\n}\r\n\r\nfunc IsItPrime(x int) bool {\r\n\tif x < 10 {\r\n\t\tif x == 2 || x == 3 || x == 5 || x == 7 {\r\n\t\t\treturn true\r\n\t\t} else {\r\n\t\t\treturn false\r\n\t\t}\r\n\t} else {\r\n\t\tj := 0\r\n\t\tk := math.Sqrt(float64(x))\r\n\t\tfor m := 3; m <= int(k); {\r\n\t\t\tif x%m == 0 {\r\n\t\t\t\tj = 1\r\n\t\t\t\tbreak\r\n\t\t\t}\r\n\t\t\tm = m + 2\r\n\t\t}\r\n\t\tif j == 1 {\r\n\t\t\treturn false\r\n\t\t} else {\r\n\t\t\treturn true\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunc PrimeFactorization(n int) (pfs map[int]int) {\r\n\tpfs = make(map[int]int)\r\n\r\n\t// Get the number of 2s that divide n\r\n\tfor n%2 == 0 {\r\n\t\tif _, ok := pfs[2]; ok {\r\n\t\t\tpfs[2] += 1\r\n\t\t} else {\r\n\t\t\tpfs[2] = 1\r\n\t\t}\r\n\t\tn = n / 2\r\n\t}\r\n\r\n\t\r\n\tfor i := 3; i*i <= n; i = i + 2 {\r\n\t\t// while i divides n, append i and divide n\r\n\t\tfor n % i == 0 {\r\n\t\t\tif _, ok := pfs[i]; ok {\r\n\t\t\t\tpfs[i] += 1\r\n\t\t\t} else {\r\n\t\t\t\tpfs[i] = 1\r\n\t\t\t}\r\n\t\t\tn = n / i\r\n\t\t}\r\n\t}\r\n\r\n\t\r\n\tif n > 2 {\r\n\t\tpfs[n] = 1\r\n\t}\r\n\r\n\treturn\r\n}\r\n\r\nfunc NumberOfDivisors(n int) int {\r\n\tpfs := PrimeFactorization(n)\r\n\r\n\tnum := 1\r\n\tfor _, exponents := range pfs {\r\n\t\tnum *= (exponents + 1)\r\n\t}\r\n\r\n\treturn num\r\n}\r\n\r\nfunc KthPrime(x int) (y int) {\r\n\tif x == 1 {\r\n\t\ty = 2\r\n\t}\r\n\tif x == 2 {\r\n\t\ty = 3\r\n\t}\r\n\tif x > 2 {\r\n\t\tvar sum int = 2\r\n\t\tbegin := 5\r\n\t\tfor sum < x+1 {\r\n\t\t\tif IsItPrime(begin) == true {\r\n\t\t\t\tsum++\r\n\t\t\t}\r\n\t\t\tif sum == x {\r\n\t\t\t\ty = begin\r\n\t\t\t\tbreak\r\n\t\t\t} else {\r\n\t\t\t\tif begin%6 == 1 {\r\n\t\t\t\t\tbegin = begin + 4\r\n\t\t\t\t} else {\r\n\t\t\t\t\tbegin = begin + 2\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn\r\n}\r\n\r\nfunc MODULE(x, y int) int {\r\n\tif x > y {\r\n\t\treturn x - y\r\n\t} else {\r\n\t\treturn y - x\r\n\t}\r\n}\r\n\r\nvar t int\r\n\r\nfunc main() {\r\n\tvar input io.Reader = bufio.NewReader(os.Stdin)\r\n\tfmt.Fscan(input, &t)\r\n\r\n\tfor o := 0; o < t; o++ {\r\n\t\tvar n, m, k, c int64\r\n\r\n\t\tfmt.(input, &n)\r\n\t\tfmt.Fscan(input, &m)\r\n\t\tfmt.Fscan(input, &t)\r\n\r\n\t\tif n%2 == 0 {\r\n\t\t\tif m%2 == 0 {\r\n\t\t\t\tif k%2 == 0 {\r\n\t\t\t\t\tc = 1\r\n\t\t\t\t} else {\r\n\t\t\t\t\tc = 0\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif k%2 == 0 {\r\n\t\t\t\t\tif ((m-1)*n)/2 >= k {\r\n\t\t\t\t\t\tc = 1\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tc = 0\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tc = 0\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif 2*k >= m {\r\n\t\t\t\tif (k-m/2)%2 == 0 {\r\n\t\t\t\t\tc = 1\r\n\t\t\t\t} else {\r\n\t\t\t\t\tc = 0\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tc = 0\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif c == 1 {\r\n\t\t\tfmt.Println(\"Yes\")\r\n\t\t} else {\r\n\t\t\tfmt.Println(\"No\")\r\n\t\t}\r\n\r\n\t}\r\n}\r\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "7c9776f4f3f0cb4d5f4a7a2bfa4bf81e", "src_uid": "4d0c0cc8faca62eb6384f8135b30feb8", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tif n%2 == 1 {\n\t\tfmt.Println(0)\n\t} else {\n\t fmt.Println(1 << (n / 2)) \n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "683d00e57edb5d923821acd9938df210", "src_uid": "4b7ff467ed5907e32fd529fb39b708db", "difficulty": 1000.0} {"lang": "Go", "source_code": "// _Channels_ are the pipes that connect concurrent\n// goroutines. You can send values into channels from one\n// goroutine and receive those values into another\n// goroutine.\n\npackage main\n\nimport \"fmt\"\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"unsafe\"\n)\n\n// var (\n// mess make(chan string, 2)\n// )\n\nfunc main() {\n\n\t// var test [3]int32\n\t// var p_test *[3]int32\n\n\t// fmt.Println(unsafe.Sizeof(test), unsafe.Sizeof(p_test))\n\n\tvar str_a string\n\tvar str_b int64\n\tinput := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(input, &str_a)\n\tfmt.Fscan(input, &str_b)\n\tvar cnt [2560000]int\n\tfor i := 0; i < len(str_a); i++ {\n\t\tcnt[str_a[i]-'0']++\n\t}\n\tvar ans int64\n\t// fmt.Println(len(str_a))\n\tfor i := 0; i < len(str_a); i++ {\n\t\tfor j := 9; j >= 0; j-- {\n\t\t\tif cnt[j] == 0 {\n\t\t\t\t// fmt.Println(j, cnt[j])\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tflag := false\n\t\t\tt := ans\n\t\t\tt = t * 10\n\t\t\tt += int64(j)\n\t\t\tcnt[j]--\n\n\t\t\tif check(t, cnt, str_b) {\n\t\t\t\tans = t\n\t\t\t\tflag = true\n\t\t\t} else {\n\t\t\t\tcnt[j]++\n\t\t\t}\n\t\t\tif flag {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n\n}\n\nfunc check(t int64, cnt [2560000]int, str_b int64) bool {\n\tfor i := 0; i < 10; i++ {\n\t\tfor cnt[i] > 0 {\n\t\t\tt = t * 10\n\t\t\tt += int64(i)\n\t\t\tcnt[i]--\n\t\t}\n\t}\n\treturn t <= str_b\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "e15a14c442f0eb067f2bc78ca30010a6", "src_uid": "bc31a1d4a02a0011eb9f5c754501cd44", "difficulty": 1700.0} {"lang": "Go", "source_code": " b = max[i][j-1] + 1\n }\n if i < n - 1 && board[i+1][j] == 'P' {\n c = max[i+1][j] + 1\n }\n if j < m - 1 && board[i][j+1] == 'P' {\n d = max[i][j+1] + 1\n }\n var s = []int {a, b, c, d}\n sort.Sort(sort.Reverse(sort.IntSlice(s)))\n max[i][j] = s[0]\n }\n }\n }\n r := 0;\n for i := 0; i < n; i++ {\n for j := 0; j < m; j++ {\n r += max[i][j]\n }\n }\n return r\n}\n\nfunc main() {\n fmt.Scan(&n, &m)\n board = make([][]byte, n)\n max = make([][]int, n)\n for i := 0; i < n; i++ {\n board[i] = make([]byte, m)\n max[i] = make([]int, m)\n var s string\n fmt.Scan(&s)\n for j := 0; j < m; j++ {\n board[i][j] = s[j]\n }\n }\n fmt.Println(findMax())\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "4a50f91e28f07b9c680b0e88ba408762", "src_uid": "969b24ed98d916184821b2b2f8fd3aac", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var pos [2]int\n Loop:\n for j := 1; j <= 5; j++ {\n var l string\n fmt.Scanf(\"%d\", &l)\n ss := strings.Split(l, \" \")\n for i, s := range ss {\n if s == \"1\" {\n pos[0] = i+1\n pos[1] = j\n beak Loop\n }\n }\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "6f5652ca97a05e05e03e81f8b31d02a9", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n n, k := getI(), getI()\n\n notPrime := make([]bool, n+1)\n primes := []int{}\n p := 2\n for p <= n {\n primes = append(primes, p)\n for i := 2*p; i <= n; i += p {\n notPrime[i] = true\n }\n for p++; p <= n && notPrime[p]; p++ {\n }\n }\n\n count := 0\n for i := 1; i < len(primes); i++ {\n s := primes[i-1] + primes[i] + 1\n if s <= n && !notPrime[s] {\n count++\n if count == k {\n writer.WriteString(\"YES\\n\")\n return\n }\n }\n if s > n {\n writer.WriteString(\"NO\\n\")\n return\n }\n }\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "732bf7bff4ebe45b99ccf795e4e2f609", "src_uid": "afd2b818ed3e2a931da9d682f6ad660d", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\n\nvar in *bufio.Scanner\nvar out *bufio.Writer\n\nfunc min(x int64, y int64) int64 {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc dp(n int, x int64, y int64) int64 {\n\tf := make([]int64, n+1)\n\n\tf[0] = 0\n\tfor i := 1; i <= n; i++ {\n\t\tif i%2 == 0 {\n\t\t\tf[i] = min(f[i-1]+x, f[i/2]+y)\n\t\t} else {\n\t\t\tf[i] = min(f[i-1]+x, f[(i+1)/2]+y+x)\n\t\t}\n\t}\n\n\treturn f[n]\n}\n\nfunc main() {\n\tin = bufio.NewScanner(os.Stdin)\n\tout = bufio.NewWriter(os.Stdout)\n\n\tin.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\n\tin.Scan()\n\tn, _ := strconv.Atoi(in.Text())\n\n\tin.Scan()\n\tx, _ := strconv.Atoi(in.Text())\n\n\tin.Scan()\n\ty, _ := strconv.Atoi(in.Text())\n\n\tres := dp(n, int64(x), int64(y))\n\n\tout.WriteString(strconv.FormatInt(res, 10))\n\tout.WriteByte('\\n')\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "331142f356815672643e6f03c6397f76", "src_uid": "0f270af00be2a523515d5e7bd66800f6", "difficulty": 2000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"math/big\"\n)\n\nfunc exgcd(a, b int64) (gcd, x, y int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\tgcd, y, x = exgcd(b, a%b)\n\ty -= a / b * x\n\treturn\n}\n\n// github.com/EndlessCheng/codeforces-go\nfunc Sol1244C(reader io.Reader, writer io.Writer) {\n\tin := bufio.NewReader(reader)\n\tout := bufio.NewWriter(writer)\n\tdefer out.Flush()\n\n\tvar n, p64, a, b int64\n\tFscan(in, &n, &p64, &a, &b)\n\tgcd, x64, y64 := exgcd(a, b)\n\tif p64%gcd != 0 {\n\t\tFprint(out, -1)\n\t\treturn\n\t}\n\n\tni := big.NewInt\n\tx, y := ni(x64), ni(y64)\n\tx.Mul(x, ni(p64/gcd))\n\ty.Mul(y, ni(p64/gcd))\n\n\ta0, b0 := ni(a/gcd), ni(b/gcd)\n\tnewY := (&big.Int{}).Set(y)\n\tnewY.Mod(newY, a0).Add(newY, a0).Mod(newY, a0)\n\ttmpY := (&big.Int{}).Set(newY)\n\tx.Sub(x, tmpY.Sub(tmpY, y).Div(tmpY, a0).Mul(tmpY, b0))\n\n\tif !x.IsInt64() || !newY.IsInt64() {\n\t\tFprint(out, -1)\n\t\treturn\n\t}\n\tx64, y64 = x.Int64(), newY.Int64()\n\tif x64 < 0 {\n\t\tFprint(out, -1)\n\t\treturn\n\t}\n\tif x64+y64 > n {\n\t\tFprint(out, -1)\n\t\treturn\n\t}\n\tFprint(out, x64, y64, n-x64-y64)\n}\n\n//func main() {\n//\tSol1244C(os.Stdin, os.Stdout)\n//}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "485c9ae2ab42983d3956799b44d75ed2", "src_uid": "503116e144d19eb953954d99c5526a7d", "difficulty": 2000.0} {"lang": "Go", "source_code": "package main\n\nimport(\n\t\"fmt\"\n)\n\nfunc main() {\n\ts1 := uint64(0)\n\ts2 := uint64(0)\n\ts3 := uint64(0)\n\ts4 := uint64(0)\n\tfmt.Scanf(\"%d %d %d %d\", s1, s2, s3, s4)\n\n\tcnt := 0\n\n\tif s1 != s2 {\n\t\tcnt += 1\n\t}\n\n\tif s1 != s3 {\n\t\tcnt += 1\n\t}\n\n\tif s1 != s4 {\n\t\tcnt += 1\n\t}\n\n\tfmt.println(3-cnt)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "e6e61e375e9da84dbb43f089a85e3f92", "src_uid": "38c4864937e57b35d3cce272f655e20f", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(x,y,z,a,b,c) {\n if a >= x {\n return 0\n }\n if a+b >= x+y {\n return 0\n }\n if a+b+c >= x+y+z {\n return 0\n }\n return 1\n}\n\nfunc main() {\n\tvar x, y, z, a, b, c int\n\tfmt.Scan(&x, &y, &z, &a, &b, &c)\n\tif solve(x,y,z,a,b,c) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "7dbd97df00268586fbaba15157a4d642", "src_uid": "d54201591f7284da5e9ce18984439f4e", "difficulty": 800.0} {"lang": "Go", "source_code": "// test.go\n/*package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc changemap(mp map[int]string) {\n\t(mp)[1] = \"did hello\"\n\n}\n\nfunc main() {\n\n\tb := 6\n\tfmt.Println(strconv.Itoa(b)) // translate int to 'int'\n\t//\ta := \"abcd\"\n\tmp := map[int]string{1: \"hello\", 2: \"world\"}\n\t//mp[1] = \"hello\"\n\t//mp[2] = \"world\"\n\n\tfmt.Println(mp)\n\tchangemap(mp)\n\tfmt.Println(mp)\n\n\t/*list := []byte(a)\n\tfmt.Println(list)\n\tlist[0] = 34\n\tfmt.Println(list)\n\tfmt.Println(a)\n\n\tfmt.Printf(\"%d %c %d\\n\", a[0], a[1], a[2])\n\tfmt.Println(byte(10), byte('a'), string(byte('0')))\n}\n*/\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc main() {\n\tvar n, a int\n\tfmt.Scanf(\"%d\", &n)\n\tvar cnt [200]int\n\tans := 1\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &a)\n\t\tcnt", "lang_cluster": "Go", "compilation_error": true, "code_uid": "c626c7083351024f1bf7814e7bc91045", "src_uid": "f30329023e84b4c50b1b118dc98ae73c", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\n/*\nB. \u041f\u0435\u0440\u0435\u0434 \u044d\u043a\u0437\u0430\u043c\u0435\u043d\u043e\u043c\n\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u0442\u0435\u0441\u0442 0.5 second\n\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u0442\u0435\u0441\u0442 64 megabytes\n\u0432\u0432\u043e\u0434 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432\u0432\u043e\u0434\n\u0432\u044b\u0432\u043e\u0434 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434\n\n\u0417\u0430\u0432\u0442\u0440\u0430 \u0443 \u041f\u0435\u0442\u0438 \u044d\u043a\u0437\u0430\u043c\u0435\u043d \u043f\u043e \u0431\u0438\u043e\u043b\u043e\u0433\u0438\u0438. \u041e\u043d \u043e\u0447\u0435\u043d\u044c \u043d\u0435 \u043b\u044e\u0431\u0438\u0442 \u044d\u0442\u043e\u0442 \u043f\u0440\u0435\u0434\u043c\u0435\u0442, \u043d\u043e d \u0434\u043d\u0435\u0439 \u043d\u0430\u0437\u0430\u0434 \u0443\u0437\u043d\u0430\u043b, \u0447\u0442\u043e \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0435\u0433\u043e \u0441\u0434\u0430\u0432\u0430\u0442\u044c.\n\u0421\u0442\u0440\u043e\u0433\u0438\u0435 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0438 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043d\u0430\u043a\u0430\u0437\u0430\u043b\u0438 \u041f\u0435\u0442\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u043e\u0439, \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0447\u0435\u043c minTimei \u0438 \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c maxTimei \u0447\u0430\u0441\u043e\u0432 \u0432 i-\u044b\u0439 \u0434\u0435\u043d\u044c.\n\u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043e\u043d\u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u043b\u0438 \u041f\u0435\u0442\u044e, \u0447\u0442\u043e \u0437\u0430 \u0434\u0435\u043d\u044c \u0434\u043e \u044d\u043a\u0437\u0430\u043c\u0435\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442, \u043a\u0430\u043a \u043e\u043d \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b \u0438\u0445 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044e.\n\n\u0418 \u0432\u043e\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0438 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043e\u0442 \u041f\u0435\u0442\u0438 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0435\u0433\u043e \u0437\u0430\u043d\u044f\u0442\u0438\u0439.\n\u041e\u0434\u043d\u0430\u043a\u043e \u043c\u0430\u043b\u044c\u0447\u0438\u043a \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u043b \u043b\u0438\u0448\u044c \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0447\u0430\u0441\u043e\u0432 sumTime, \u0437\u0430\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u043e\u0435 \u0438\u043c \u043d\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0443.\n\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u043d \u0445\u043e\u0447\u0435\u0442 \u0443\u0437\u043d\u0430\u0442\u044c, \u0443\u0434\u0430\u0441\u0442\u0441\u044f \u043b\u0438 \u0435\u043c\u0443 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f\u043c \u0441\u043f\u0438\u0441\u043e\u043a s\u0441hedule \u0438\u0437 d \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b,\n\u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043a\u0430\u0436\u0434\u043e\u0435 \u0447\u0438\u0441\u043b\u043e s\u0441hedulei \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u0432 \u0447\u0430\u0441\u0430\u0445, \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0435 \u041f\u0435\u0442\u0435\u0439 \u0432 i-\u044b\u0439 \u0434\u0435\u043d\u044c \u0437\u0430 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u0431\u0438\u043e\u043b\u043e\u0433\u0438\u0438.\n\u0427\u0438\u0441\u043b\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u0439, \u0430 \u0441\u0443\u043c\u043c\u0430 \u0432\u0441\u0435\u0445 schedulei \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0432 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0432\u043d\u0430 sumTime.\n\n\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\n\u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u043d\u044b \u0434\u0432\u0430 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u043b\u0430 d,\u2009sumTime (1\u2009\u2264\u2009d\u2009\u2264\u200930,\u20090\u2009\u2264\u2009sumTime\u2009\u2264\u2009240) \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043d\u0435\u0439, \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0441\u044f \u041f\u0435\u0442\u044f \u0438 \u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0447\u0430\u0441\u043e\u0432, \u0437\u0430\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0443.\n\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 d \u0441\u0442\u0440\u043e\u043a\u0430\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043f\u043e \u0434\u0432\u0430 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u043b\u0430 minTimei,\u2009maxTimei (0\u2009\u2264\u2009minTimei\u2009\u2264\u2009maxTimei\u2009\u2264\u20098), \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0431\u0435\u043b \u2014 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0447\u0430\u0441\u043e\u0432,\n\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u041f\u0435\u0442\u044f \u043c\u043e\u0433 \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c \u0432 i-\u044b\u0439 \u0434\u0435\u043d\u044c.\n\n\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\n\u0412\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 YES, \u0430 \u0432\u043e \u0432\u0442\u043e\u0440\u0443\u044e d \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0431\u0435\u043b\u044b, \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u2014 \u0447\u0438\u0441\u043b\u043e \u0447\u0430\u0441\u043e\u0432, \u043f\u043e\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u044b\u0445 \u041f\u0435\u0442\u0435\u0439 \u043d\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0443 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0434\u0435\u043d\u044c.\n\u0415\u0441\u043b\u0438 \u0438\u0441\u043a\u043e\u043c\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0442\u043e \u0432\u044b\u0432\u0435\u0434\u0438\u0442\u0435 NO \u0432 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e, \u0432\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u043b\u044e\u0431\u043e\u0435.\n\n\u041f\u0440\u0438\u043c\u0435\u0440\u044b\n\u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\n1 48\n5 7\n\u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\nNO\n\n\u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\n2 5\n0 1\n3 5\n\u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\nYES\n1 4\n*/\n\ntype dayRange struct {\n\tidx, minTime, maxTime int\n}\n\nfunc change(r []int, days []dayRange, dayIdx, dayMax, target int) bool {\n\tday := &days[dayIdx]\n\tif dayIdx == dayMax {\n\t\tif target >= day.minTime && target <= day.maxTime {\n\t\t\tr[day.idx] = target\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\tfor i := day.maxTime; i >= day.minTime; i-- {\n\t\tif (target - i < 0) {\n\t\t\tcontinue\n\t\t}\n\t\tif change(r, days, dayIdx + 1, dayMax, target - i) {\n\t\t\tr[day.idx] = i\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc insertionSort(schedules []dayRange) {\n\tl := len(schedules)\n\tfor i := 1; i < l; i++ {\n\t\tfor j := i; j > 0 && (schedules[j].minTime) > (schedules[j - 1].minTime); j-- {\n\t\t\tschedules[j - 1], schedules[j] = schedules[j], schedules[j - 1]\n\t\t}\n\t}\n}\n\nfunc main() {\n\tvar d, sumTime int\n\tfmt.Scanf(\"%d %d\\n\", &d, &sumTime)\n\n\tschedules := make([]dayRange, d)\n\tfor i := 0; i < d; i++ {\n\t\tschedules[i].idx = i;\n\t\tfmt.Scanf(\"%d %d\\n\", &schedules[i].minTime, &schedules[i].maxTime)\n\t}\n\n\tinsertionSort(schedules)\n\n\tvar result []int = make([]int, d)\n\tif change(result, schedules, 0, d - 1, sumTime) {\n\t\tfmt.Printf(\"YES\\n\")\n\t\tfor i := 0; i < d; i++ {\n\t\t\tif i != 0 {\n\t\t\t\tfmt.Printf(\" \")\n\t\t\t}\n\t\t\tfmt.Printf(\"%d\", result[i])\n\t\t}\n\t\tfmt.Printf(\"\\n\")\n\t} else {\n\t\tfmt.Printf(\"NO\\n\")\n\t}\n}\n\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "b61b6d009a32e55d972ceb2911e3f8e5", "src_uid": "f48ff06e65b70f49eee3d7cba5a6aed0", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"strconv\"\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\ta := sc.NextInt()\n\tb := sc.NextIntArray()\n\n\tif a == b || a == b + 1 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r:rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf) + 1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf) + 1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "fddaf8f4e1cf8f6e739974d94894ae4f", "src_uid": "ec5e3b3f5ee6a13eaf01b9a9a66ff037", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc solve(t, s, x int) bool {\n\tif x <= t {\n\t\treturn t == x\n\t}\n\n\tdelta := x - t\n\t//return (delta%s) == 0 || (delta/s >= 1 && delta%s == 1)\n\treturn true\n}\n\nfunc main() {\n\tvar t, s, x int\n\tfmt.Scan(&t, &s, &x)\n\tif solve(t, s, x) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "700c8c03cd0ea59bb25dfce7a19d7dab", "src_uid": "3baf9d841ff7208c66f6de1b47b0f952", "difficulty": 900.0} {"lang": "Go", "source_code": "package main \n\nimport \"fmt\"\n\nfunc min(a, b uint64) uint64 {\n if a < b {\n return a\n }\n return b\n}\n\nfunc main() {\n var a, b uint64\n fmt.Scan(&a, &b)\n \n m := min(a, b)\n var res uint64 = 1\n for i:=1; i<=m; i++ {\n res *= i\n }\n fmt.Print(res)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "0c0c93a44f5f9c4e40c73b67e7b0daee", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\nimport (\n \"fmt\"\n)\n\nfunc main(){\n var x,y,z,t1,t2,t3 int\n fmt.Scan(&x,&y,&z,&t1,&t2,&t3)\n \n if math.Abs(x-y)*t1 - math.Abs(x-z)*t2 - math.Abs(x-y)*t2 < 2*t3 {\n fmt.Println(\"NO\") \n }else{\n fmt.Println(\"YES\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "38942b5959bb7909364d44bfb2920d8f", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\nimport(\n \"os\"\n \"fmt\"\n \"math\"\n )\n \nfunc main(){\n var x,y,z,t1,t2,t3 int\n x,y,z,t1,t2,t3 = os.Args[1],os.Args[2],os.Args[3],os.Args[4],os.Args[5],os.Args[6]\n \n if math.Abs(x-y)*t1 - math.Abs(x-z)*t2 - math.Abs(x-y)*t2 < 2*t3 {\n fmt.Println(\"NO\") \n }else{\n fmt.Println(\"YES\")\n }\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "85c030e48e3e2903e607a7d04ca737ce", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "difficulty": 800.0} {"lang": "Go", "source_code": " } else {\n fmt.Println(\"NO\")\n }\n }\n}\n\nfunc mainAmar() {\n/*********************** utility ***********************/\n\nvar out chan string\nvar in *bufio.Scanner\nvar outWg *sync.WaitGroup\n\nfunc init() {\n //set input\n in = bufio.NewScanner(os.Stdin)\n in.Buffer(make([]byte, 1024), int(2e+5))\n in.Split(bufio.ScanWords)\n\n // set output\n out = make(chan string, 16)\n outWg = &sync.WaitGroup{}\n outWg.Add(1)\n\n writer := bufio.NewWriterSize(os.Stdout, int(2e+5))\n go func(writer *bufio.Writer) {\n defer outWg.Done()\n defer writer.Flush()\n\n for line := range out {\n writer.WriteString(line + \"\\n\")\n }\n }(writer)\n}\n\nfunc ReadString() string {\n in.Scan()\n return in.Text()\n}\n\nfunc ReadStringSlice(n int) []string {\n s := make([]string, n)\n for i := 0; i < n; i++ {\n s[i] = ReadString()\n }\n return s\n}\n\nfunc ReadInt() int {\n intStr := ReadString()\n i, _ := strconv.Atoi(intStr)\n return i\n}\n\nfunc ReadIntSlice(n int) []int {\n arr := make([]int, n)\n for i := 0; i < n; i++ {\n arr[i] = ReadInt()\n }\n return arr\n}\n\nfunc max(a, b int) int {\n if a > b {\n return a\n }\n return b\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a24da7aae001c69170d91157d8a56a7c", "src_uid": "098ade88ed90664da279fe8a5a54b5ba", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ta, _ := strconv.Atoi(sc.Text())\n\treturn a\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ta, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn a\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e)\n\t\tif i != len(a)-1 {\n\t\t\tfmt.Fprint(wr, \" \")\n\t\t}\n\t}\n\tfmt.Fprintln(wr)\n\twr.Flush()\n}\n\n\n\nvar (\n\tx int64\n\tfac []int64\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tx = scanInt64()\n\tans := x\n\tret := [...]int64 {1, x}\n\tfor i := int64(2); i * i <= x; i++ {\n\t\tif x % i == 0 {\n\t\t\tmul := int64(1)\n\t\t\tfor x % i == 0 {\n\t\t\t\tx /= i\n\t\t\t\tmul *= i\n\t\t\t}\n\t\t\tfac = append(fac, mul)\n\t\t}\n\t}\n\tif x != 1 {\n\t\tfac = append(fac, x)\n\t}\n\tfacLen := len(fac)\n\tfor mask := 0; mask < (1 << facLen); mask++ {\n\t\tmul := [...]int64 {1, 1}\n\t\tfor i := 0; i < facLen; i++ {\n\t\t\tmul[mask >> i & 1] *= fac[i]\n\t\t}\n\t\tif mul[0] > mul[1] {\n\t\t\tmul[0], mul[1] = mul[1], mul[0]\n\t\t}\n\t\tmaxMul := mul[0]\n\t\tif mul[1] > maxMul {\n\t\t\tmaxMul = mul[1]\n\t\t}\n\t\tif maxMul < ans {\n\t\t\tans = maxMul\n\t\t\tret[0], ret[1] = mul[0], mul[1]\n\t\t}\n\t}\n\tfmt.Printf(\"%d %d\\n\", ret[0], ret[1])\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "14e57b388ba16b241ae2e64d1976512a", "src_uid": "e504a04cefef3da093573f9df711bcea", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n)\n\nfunc main() {\n var n, k int\n fmt.Scanf(\"%d%d\", &n, &k)\n a := make([]int, n)\n for i := 0; i < n; i++ {\n fmt.Scanf(\"%d\", &a[i])\n }\n b := make([]int, k)\n for i := 0; i < k; i++ {\n fmt.Scanf(\"%d\", &b[i])\n }\n sort.Slice(b, func(i, j int) bool {\n return b[i] < b[j]\n })\n for i := 0; i < n; i++ {\n if a[i] == 0 {\n a[i] = b[k - 1]\n k--\n }\n }\n for i := 1; i < n; i++ {\n if a[i - 1] > a[i] {\n fmt.Printf(\"Yes\\n\")\n return\n }\n }\n fmt.Printf(\"No\\n\")\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "86be1dc916341a4d0195b6ce9f579109", "src_uid": "40264e84c041fcfb4f8c0af784df102a", "difficulty": 900.0} {"lang": "Go", "source_code": "package main;\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n,d int\n\tfmt.Scan(&n, &d)\n\tt := make([]int, n)\n\ttime := 0\n\tfor i := range n {\n\t\tfmt.Scan(&t[i])\n\t\ttime += t[i]\n\t\tif i!= 0 {\n\t\t\ttime += 10\n\t\t}\n\t}\n\tif time >= d {\n\t\tfmt.Println(-1)\n\t}\n\telse{\n\t\tfmt.Println((d-time)/5)\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "08196ed2d2a45a99825c0be6e55d1f27", "src_uid": "b16f5f5c4eeed2a3700506003e8ea8ea", "difficulty": 900.0} {"lang": "Go", "source_code": "package \"main\"\n\nimport \"fmt\"\n\nfunc is_perfect_like_mikey(i int) bool{\n s := 0\n for i > 0 {\n s+=(i%10)\n i/10\n }\n return(s==10)\n}\nfunc main() {\n mike_is_my_daddy := 0\n fmt.Scan(&mike_is_my_daddy)\n cnt := 0\n for i := 0; ; i++ {\n if(is_perfect_like_mikey(i)) {\n cnt++\n }\n if cnt == k {\n fmt.Println(i)\n break\n }\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "73aa7e514493b10920c9e5f9ca54e184", "src_uid": "0a98a6a15e553ce11cb468d3330fc86a", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport \"os\"\nimport \"fmt\"\n\nfunc main() {\n\tw1, h1, w2, h2 := os.Args[0], os.Args[1], os.Args[2], os.Args[3]\n\tfmt.Println(1 + w2 + 1 + h2 + h2 + h1 + h1 + w1 - w2 + 1 + w1 + 1)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "dc61d4305f5e9fd0bdd080f0c400d207", "src_uid": "b5d44e0041053c996938aadd1b3865f6", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar (\n ax int64\n ay int64\n bx int64\n by int64\n cx int64\n cy int64\n)\n\nfunc main() {\n fmt.Scanf(\"%d %d %d %d %d %d\\n\", &ax, &ay, &bx, &by, &cx, &cy)\n if ((ax-bx)*(ax-bx)+(ay-by)*(ay-by)) == ((bx-cx)*(bx-cx)+(by-cy)*(by-cy)) && (bx-ax)*(cy-ay) != (by-ay)*(cx-bx) {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }", "lang_cluster": "Go", "compilation_error": true, "code_uid": "d5abc5e607b0f54073da5b03b987ed71", "src_uid": "05ec6ec3e9ffcc0e856dc0d461e6eeab", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc Employee(number int) int {\n\tvar array []int\n\tfor i:=1;i<=number/2;i++ {\n\t\tif number % i == 0 {\n\t\t\tarray = append(array,i)\n\t\t}\n\t}\n\tfmt.Println(array)\n\treturn len(array)\n}\n\nfunc main() {\n\tvar number int\n\tvar err error\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _ := reader.ReadString('\\n')\n\ttext = strings.TrimRight(text,\"\\r\\n\")\n\tnumber,err = strconv.Atoi(text)\n\tfmt.Println(Employee(number))\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "240d60271c65aabae41a16af6725b24e", "src_uid": "89f6c1659e5addbf909eddedb785d894", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport \"fmt\"\n \nfunc main(){\n\tvar n\n var res\n\tfmt.Scan(&n)\n\tfor i := 2; i <= n; i++ {\n\t\tif n % i == 0 {\n\t\t res +=1\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "bb5714a0cd4c99c6585c6a5957fd58a1", "src_uid": "89f6c1659e5addbf909eddedb785d894", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar h int, n int64\n\tfmt.Scanf(\"%d %d\", &h, &n)\n\tn -= 1\n\ttn := int64(1)\n\tr := int64(0)\n\tfor i := 0; i < h; i++ {\n\t\ttn *= 2\n\t}\n\tisLeft := true\n\tfor i := 0; i < h; i++ {\n\t\ttn /= 2\n\t\tr += 1\n\t\tif tn&n > 0 {\n\t\t\tif isLeft {\n\t\t\t\tr += 2*tn - 1\n\t\t\t}\n\t\t\tisLeft = true\n\t\t} else {\n\t\t\tif !isLeft {\n\t\t\t\tr += 2*tn - 1\n\t\t\t}\n\t\t\tisLeft = false\n\t\t}\n\t}\n\tfmt.Println(r)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "bb3181958db8b6bc5a43d72632023d18", "src_uid": "3dc25ccb394e2d5ceddc6b3a26cb5781", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc solve(a []int) (int, int) {\n\tseen := map[int]bool{}\n\n\tsort.Ints(a)\n\n\tx, y := a[len(a)-1], 1\n\n\tyDivisors := []int{}\n\n\tfor i := len(a) - 1; i >= 0; i-- {\n\t\tn := a[i]\n\t\tif seen[n] || x%n > 0 {\n\t\t\tyDivisors = append(yDivisors, n)\n\t\t}\n\t\tseen[n] = true\n\t}\n\n\tif len(yDivisors) > 0 {\n\t\ty = yDivisors[0]\n\t}\n\n\treturn x, y\n}\n\nfunc toInt(buf []byte) (n int) {\n\tfor _, v := range buf {\n\t\tn = n*10 + int(v-'0')\n\t}\n\treturn\n}\n\nfunc main() {\n\tn := 0\n\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tfor i := range a {\n\t\tscanner.Scan()\n\t\ta[i] = toInt(scanner.Bytes())\n\t}\n\n\tfmt.Println(solve(a))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "334bcee1e181b94ad57c6308be982efb", "src_uid": "868407df0a93085057d06367aecaf9be", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc abs(a int) int{\n\tif a < 0{\n\t\treturn -a\n\t} else{\n\t\treturn a\n\t}\n}\n\nfunc min(a, b int) int{\n\tif a < b{\n\t\treturn a\n\t} else{\n\t\treturn b\n\t}\n}\n\nvar tag[10005] int\n\nfunc main(){\n\tvar n int\n\tfmt.Scanln(&n)\n\ttarget := make([]int, 0, n)\n\tvar max, sameMax int\n\tfor i := 0;i < n ;i++ {\n\t\tvar x int\n\t\tfmt.Scan(&x)\n\t\tif x > max{\n\t\t\tmax = x\n\t\t}\n\t\ttarget = append(target, x)\n\t\tif tag[x] ==1 && x > sameMax{\n\t\t\tsameMax = x\n\t\t}\n\t\ttag[x] = 1\n\t}\n\tfmt.Print(max)\n\tfor i:=0;i max{\n\t\t\tmax = target[i]\n\t\t}\n\t}\n\tif max > 0 {\n\t\tfmt.Printf(\" %d\\n\", max)\n\t} else {\n\t\tfmt.Printf(\" %d\\n\", sameMax)\n\t}\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "d9015ecac94bd6d36796b707d44ca4af", "src_uid": "868407df0a93085057d06367aecaf9be", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar n int32\nvar a int32\nvar b int32\n\nfunc ReadData() {\n fmt.Scanf(\"%d\", &n);\n fmt.Scanf(\"%d\", &a);\n fmt.Scanf(\"%d\", &b);\n}\n\nfunc Solve(na int32, nb int32, current int32, dbg bool) int {\n if na == 0 && nb == 0 {\n return 0;\n }\n\n var r0 int = 10000;\n var r1 int = 10000;\n var r2 int = 10000;\n var mode int = 4;\n\n if 0 < na && a <= current {\n r0 = Solve(na - 1, nb, current - a, false);\n }\n if 0 < nb && b <= current {\n r1 = Solve(na, nb - 1, current - b, false);\n }\n if current != n {\n r2 = 1 + Solve(na, nb, n, false);\n }\n\n result := r0\n mode = 0\n if r1 < result {\n result = r1\n mode = 1\n }\n if r2 < result {\n result = r2\n mode = 2\n }\n\n if dbg {\n if mode == 0 {\n Solve(na - 1, nb, current - a, true);\n } else if mode == 1 {\n Solve(na, nb - 1, current - b, true);\n } else if mode == 2 {\n r2 = 1 + Solve(na, nb, n, true);\n }\n fmt.Println(\"na: \", na, \" nb: \", nb, \" current: \", current, \" result: \", result, \" mode: \", mode)\n }\n return result\n}\n\nfunc main() {\n ReadData();\n fmt.Println(Solve(4, 2, 0, false));\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "76ab81381bdfa2c975cec9c60352fc7c", "src_uid": "1a50fe39e18f86adac790093e195979a", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var x,y int\n fmt.Scan(&x,&y)\n if x < 0 {\n if y < 0 {\n fmt.Println(x+y,0,0,x+y)\n } else {\n fmt.Println(x-y,0,0,-(x-y))\n }\n } else {\n if y < 0 {\n fmt.Println(0,-(x-y),x-y,0)\n } else {\n fmt.Println(0,x+y,x+y,0)\n }\n }\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "29b98a734dd62a14caaf6a58f766ab34", "src_uid": "e2f15a9d9593eec2e19be3140a847712", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc S(x int64) int64 {\n\tvar res int64 = 0\n\tfor x != 0 {\n\t\tres += x % 10\n\t\tx /= 10\n\t}\n\treturn res\n}\n\nfunc Pow(x, a int64) int64 {\n\tvar res int64 = 1\n\tfor i := 0; int64(i) < a; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tvar a, b, c int64\n\tfmt.Fscan(reader, &a, &b, &c)\n\tvar num_res = 0\n\tvar res []int64 = make([]int64, 40)\n\tfor i := 1; i < 40; i++ {\n\t\tvar x int64 = b*Pow(int64(i), a) + c\n\t\tif x < 1000000000 && S(x) == int64(i) {\n\t\t\tres[num_res] = x\n\t\t\tnum_res++\n\t\t}\n\t}\n\tfmt.Fprintln(writer, num_res)\n\tfor i := 0; i < num_res; i++ {\n\t\tfmt.Fprintf(writer, \"%d \", res[i])\n\t}\n\tfmt.Fprintln(writer)\n\twriter.Flush()\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "2295592b00a3a0d9bb5d82cf66cc3444", "src_uid": "e477185b94f93006d7ae84c8f0817009", "difficulty": 1500.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc abs(num int) int {\n\treturn max(num, -num)\n}\n\nfunc main() {\n\tvar r1, c1, r2, c2 int\n\tfmt.Scan(&r1, &c1, &r2, &c2)\n\tvar rook, bishop, king int\n\tif r1 == r2 || c1 == c2 {\n\t\trook = 1\n\t} else {\n\t\trook = 2\n\t}\n\tif (r1+c1)%2 != (r2+c2)%2 {\n\t\tbishop = 0\n\t} else if r1+c1 == r2+c2 || r1-c1 == r2-c2 {\n\t\tbishop = 1\n\t} else {\n\t\tbishop = 2\n\t}\n\tking = max(abs(r1-r2), abs(c1-c2))\n\tfmt.Println(rook, bishop, king)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "c96a8cf81a1679a56ec42d11d38babef", "src_uid": "7dbf58806db185f0fe70c00b60973f4b", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar numCases int\n\tfmt.Scanf(\"%d\", &numCases)\n\n\tfor i := 0; i < numCases; i++ {\n\t\tvar n, k, d int\n\t\tfmt.Scanf(\"%d %d %d\", &n, &k, &d)\n\t\t_ = k // unused\n\n\t\tschedule := make([]int, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tfmt.Scanf(\"%d\", &schedule[j])\n\t\t}\n\n\t\tfmt.Println(solveCase(schedule, d))\n\t}\n}\n\n// solveCase solves single task case for:\n// * schedule -- index - day, value - show id\n// * days -- target number of days for subscription\nfunc solveCase(schedule []int, days int) (numShows int) {\n\tshows := make(map[int]int)\n\n\tfor i := 0; i < days; i++ {\n\t\tshows[schedule[i]]++\n\t}\n\n\tnumShows = len(shows)\n\n\tfor i := days; i < len(schedule); i++ {\n\t\tcnt := shows[schedule[i-days]]\n\t\tif cnt == 1 {\n\t\t\tdelete(shows, schedule[i-days])\n\t\t} else {\n\t\t\tshows[schedule[i-days]]--\n\t\t}\n\n\t\tshows[schedule[i]]++\n\n\t\tif len(shows) < numShows {\n\t\t\tnumShows = len(shows)\n\t\t}\n\t}\n\n\treturn numShows\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "ccbf833e0edd6ac2cc96ca1d365b5790", "src_uid": "56da4ec7cd849c4330d188d8c9bd6094", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar numCases int\n\tfmt.Scanf(\"%d\", &numCases)\n\n\tanswers := make([]int, numCases)\n\n\tfor i := 0; i < numCases; i++ {\n\t\tvar n, k, d int\n\t\tfmt.Scanf(\"%d %d %d\", &n, &k, &d)\n\t\t_ = k // unused\n\n\t\tschedule := make([]int, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tfmt.Scanf(\"%d\", &schedule[j])\n\t\t}\n\n\t\tanswers[i] = solveCase(schedule, d)\n\t}\n\n\tfor _, a := range answers {\n\t\tfmt.Println(a)\n\t}\n}\n\n// solveCase solves single task case for:\n// * schedule -- index - day, value - show id\n// * days -- target number of days for subscription\nfunc solveCase(schedule []int, days int) (numShows int) {\n\tshows := make(map[int]int)\n\n\tfor i := 0; i < days; i++ {\n\t\tshows[schedule[i]]++\n\t}\n\n\tnumShows = len(shows)\n\n\tfor i := days; i < len(schedule); i++ {\n\t\tcnt := shows[schedule[i-days]]\n\t\tif cnt == 1 {\n\t\t\tdelete(shows, schedule[i-days])\n\t\t} else {\n\t\t\tshows[schedule[i-days]]--\n\t\t}\n\n\t\tshows[schedule[i]]++\n\n\t\tif len(shows) < numShows {\n\t\t\tnumShows = len(shows)\n\t\t}\n\t}\n\n\treturn numShows\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "26c10135a90ec9d66c3329f577e2710d", "src_uid": "56da4ec7cd849c4330d188d8c9bd6094", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc work(capacity int, arrOne []int, arrTwo []int) int {\n\tsort.Ints(arrOne)\n\tsort.Ints(arrTwo)\n\tused, cnt, ans := 0, 0, 0\n\tfor i, j := -1, -1; i <= len(arrOne); i++ {\n\t\tfor ; j + 1 < len(arrTwo) && used + arrTwo[j + 1] <= capacity; j++ {\n\t\t\tused += arrTwo[j + 1]\n\t\t\tcnt += 2\n\t\t}\n\t\tfor ; j >= 0 && used > capacity; j-- {\n\t\t\tused -= arrTwo[j]\n\t\t\tcnt -= 2\n\t\t}\n\t\tif used <= capacity && cnt > ans {\n\t\t\tans = cnt\n\t\t}\n\t\tif i + 1 < len(arrOne) {\n\t\t\tused += arrOne[i + 1]\n\t\t\tcnt++\n\t\t}\n\t}\n\t// fmt.Println(\"-=\", ans)\n\treturn ans\n}\n\nfunc main() {\n\tvar n, x int\n\tfmt.Scan(&n)\n\tif n == 1 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tcntOdd, cntEven := (n + 1) / 2, n / 2\n\tvar odd, odd2, even, even2 []int\n\tlast, emptyLen, ans := -1, 0, 0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&x)\n\t\tif x == 0 {\n\t\t\temptyLen++\n\t\t\tcontinue\n\t\t}\n\t\tx %= 2\n\t\tif x == 1 {\n\t\t\tcntOdd--\n\t\t} else {\n\t\t\tcntEven--\n\t\t}\n\t\tif last != -1 && x != last {\n\t\t\tans++\n\t\t}\n\t\tif emptyLen > 0 {\n\t\t\tif last == -1 || last == x {\n\t\t\t\tif last == -1 {\n\t\t\t\t\tans++\n\t\t\t\t\tif x == 0 {\n\t\t\t\t\t\teven = append(even, emptyLen)\n\t\t\t\t\t} else {\n\t\t\t\t\t\todd = append(odd, emptyLen)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tans += 2\n\t\t\t\t\tif x == 0 {\n\t\t\t\t\t\teven2 = append(even2, emptyLen)\n\t\t\t\t\t} else {\n\t\t\t\t\t\todd2 = append(odd2, emptyLen)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\temptyLen = 0\n\t\t}\n\t\tlast = x\n\t}\n\n\tif last == -1 {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\tif emptyLen > 0 {\n\t\tans++\n\t\tif last == 0 {\n\t\t\teven = append(even, emptyLen)\n\t\t} else {\n\t\t\todd = append(odd, emptyLen)\n\t\t}\n\t}\n\t// fmt.Println(\"ans\", ans)\n\tans -= work(cntEven, even, even2)\n\tans -= work(cntOdd, odd, odd2)\n\tfmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "5f72851caf4748916a0ac3764e5fb76d", "src_uid": "90db6b6548512acfc3da162144169dba", "difficulty": 1800.0} {"lang": "Go", "source_code": "\ufeffpackage main\nimport (\n\t\"fmt\"\n)\nfunc main() {\n\tvar x,y,p int\n\tfmt.Scan(&x,&y)\n\tif y>x && x>=-y {\n\t\tp=-2+y*4\n\t}\n\tif y>=x && x<(-y) {\n\t\tp=-1+4*-x\n\t}\n\tif x>y && -x+1>=y {\n\t\tp=-y*4\n\t}\n\tif x>=y && -x+1 0 {\n\t\t\t\tdp[i][j] -= dp[p-1][j-1]\n\t\t\t}\n\t\t}\n\t\tprev[c] = i\n\t}\n\tk--\n\tfor l := n - 1; l >= 0; l-- {\n\t\tcnt := dp[n][l]\n\t\tif cnt > k {\n\t\t\tans += int64(n-l) * k\n\t\t\tk = 0\n\t\t\tbreak\n\t\t}\n\t\tk -= cnt\n\t\tans += int64(n-l) * cnt\n\t}\n\tif k > 0 {\n\t\tans = -1\n\t}\n\tFprint(_w, ans)\n}\n\nfunc main() { CF1183H(os.Stdin, os.Stdout) }\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "319606ff786203abeaa00cca20036438", "src_uid": "ae5d21919ecac431ea7507cb1b6dc72b", "difficulty": 2000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt()\n\tm := readInt()\n\tk := readInt64()\n\tx := readInt()\n\ty := readInt()\n\n\tv := make([][]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tv[i] = make([]int64, m)\n\t}\n\tif n == 1 {\n\t\tsize := m\n\t\tmul := k / int64(size)\n\t\tk = k % int64(size)\n\t\tif mul > 0 {\n\t\t\tfor j := 0; j < m; j++ {\n\t\t\t\tv[0][j] = mul\n\t\t\t}\n\t\t}\n\t} else {\n\t\tsize := (n + n - 2) * m\n\t\tmul := k / int64(size)\n\t\tk = k % int64(size)\n\t\tif mul > 0 {\n\t\t\tfor i := 1; i < n-1; i++ {\n\t\t\t\tfor j := 0; j < m; j++ {\n\t\t\t\t\tv[i][j] = 2 * mul\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor j := 0; j < m; j++ {\n\t\t\t\tv[0][j] = mul\n\t\t\t}\n\t\t\tfor j := 0; j < m; j++ {\n\t\t\t\tv[n-1][j] = mul\n\t\t\t}\n\t\t}\n\t}\n\tfor i := 0; i < n && k > 0; i++ {\n\t\tfor j := 0; j < m && k > 0; j++ {\n\t\t\tv[i][j]++\n\t\t\tk--\n\t\t}\n\t}\n\tfor i := n - 2; i >= 0 && k > 0; i-- {\n\t\tfor j := 0; j < m && k > 0; j++ {\n\t\t\tv[i][j]++\n\t\t\tk--\n\t\t}\n\t}\n\t// for i := 0; i < n; i++ {\n\t// \tfmt.Printf(\"v[i] = %+v\\n\", v[i])\n\t// }\n\tminValue := int64(math.MaxInt64)\n\tmaxValue := int64(math.MinInt64)\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < m; j++ {\n\t\t\tvalue := v[i][j]\n\t\t\tif value < minValue {\n\t\t\t\tminValue = value\n\t\t\t}\n\t\t\tif value > maxValue {\n\t\t\t\tmaxValue = value\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Printf(\"%d %d %d\", maxValue, minValue, v[x-1][y-1])\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "be311e4962938bba1cf2ae88bc19336d", "src_uid": "e61debcad37eaa9a6e21d7a2122b8b21", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t_ \"math\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc scanf(f string, a ...interface{}) {\n\tfmt.Fscanf(reader, f, a...)\n}\nfunc printf(f string, a ...interface{}) {\n\tfmt.Fprintf(writer, f, a...)\n}\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\nfunc print(a ...interface{}) {\n\tfmt.Fprint(writer, a...)\n}\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc main() {\n\t_main()\n\twriter.Flush()\n}\n// head\nvar n int\nvar s string\nvar m int\nvar valid []int\nfunc _main() {\n scan(&n, &s)\n\tm = len(s)\n\n\tvalid = append(valid, 0)\n\tfor i := 1; i < n; i ++ {\n\t\tsuccess := true\n\t\tfor j := 0; j < m; j ++ {\n\t\t\tk := (i + j) % n\n\t\t\tif k < m && s[k] != s[j] {\n\t\t\t\tsuccess = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif success {\n\t\t\tvalid = append(valid, i)\n\t\t}\n\t}\n\n\t//println(\"valid =\", valid)\n\tdp := make([]int64, n)\n\tdp[0] = 1\n\tvar ans int64\n for _, i := range valid {\n \t//println(\"i = \", i)\n\t\tfor _, j := range valid {\n\t\t\tk := (i + j) % n\n\t\t\tif k >= i {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t//println(\"\\tk = \", k)\n\t\t\tdp[i] -= dp[k] << uint(max(0, i - k -m))\n\n\t\t}\n ans += dp[i] * int64(n - i) << (uint)(max(0, n - m - i))\n\t}\n\tprintln(ans)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "515a940d0ab78acc2927435e9e906f25", "src_uid": "0034806908c9794086736a2d07fc654c", "difficulty": 2900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n\nfunc main() {\n\tdefer Flush()\n\n\tl := readi()\n\tr := readi()\n\ta := readi()\n\n\tif a == 0 {\n\t\tprintln(min(l, r) * 2)\n\t} else if max(l, r)-max(l, r) <= a {\n\t\tprintln((l + r + a) &^ 1)\n\t} else {\n\t\tprintln((min(l, r) + a) * 2)\n\t}\n\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "8d1930313d0103b5310da878de4a2cd6", "src_uid": "e8148140e61baffd0878376ac5f3857c", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Init() {\n}\n\nfunc Solve(io *FastIO) {\n\tK := io.NextInt()\n\t\n\tsb := bytes.NewBufferString(\"z\")\n\trem := K\n\tc := 'a'\n\tfor rem > 0 {\n\t\tsz := 0\n\t\tfor sz <= rem {\n\t\t\tsb.WriteRune(c)\n\t\t\trem -= sz\n\t\t\tsz++\n\t\t}\n\t\tc++\n\t}\n\tio.Println(sb.String())\n}\n\ntype FastIO struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\n\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int64(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextInt()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextLong()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\n\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\n\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\n\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\t\tcase 0, '\\n', '\\r':\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tInit()\n\tSolve(&io)\n\tio.FlushOutput()\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "e041b54430e157e1e467a33c2fc72afc", "src_uid": "b991c064562704b6106a6ff2a297e64a", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport . \"fmt\"\n\ntype vec struct {\n\tx, y int64\n}\n\nfunc (a vec) less(b vec) bool { return a.x < b.x || a.x == b.x && a.y < b.y }\nfunc (a vec) sub(b vec) vec { return vec{a.x - b.x, a.y - b.y} }\nfunc (a vec) dot(b vec) int64 { return a.x*b.x + a.y*b.y }\nfunc isOrthogonal(a, b, c vec) bool { return a.sub(b).dot(c.sub(b)) == 0 }\nfunc isRectangle(a, b, c, d vec) bool { return isOrthogonal(a, b, c) && isOrthogonal(b, c, d) && isOrthogonal(c, d, a) }\nfunc isRectangleAnyOrder(a, b, c, d vec) bool { return isRectangle(a, b, c, d) || isRectangle(a, b, d, c) || isRectangle(a, c, b, d) }\n\n// github.com/EndlessCheng/codeforces-go\nfunc main() {\n\tmp := map[vec]int{}\n\tshown := map[vec]int{}\n\tfor i := 0; i < 4; i++ {\n\t\tvar x, y int64\n\t\tScan(&x, &y)\n\t\tp0 := vec{x, y}\n\t\tScan(&x, &y)\n\t\tp1 := vec{x, y}\n\t\tif v := p1.sub(p0); v.x != 0 && v.y != 0 {\n\t\t\tPrint(\"NO\")\n\t\t\treturn\n\t\t}\n\t\tmp[p0]++\n\t\tmp[p1]++\n\t\tif p1.less(p0) {\n\t\t\tp0, p1 = p1, p0\n\t\t}\n\t\tshown[p1.sub(p0)]++\n\t}\n\tfor _, v := range shown {\n\t\tif v != 2 {\n\t\t\tPrint(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\tarr := []vec{}\n\tfor vec, v := range mp {\n\t\tif v != 2 {\n\t\t\tPrint(\"NO\")\n\t\t\treturn\n\t\t}\n\t\tarr = append(arr, vec)\n\t}\n\tif isRectangleAnyOrder(arr[0], arr[1], arr[2], arr[3]) {\n\t\tPrint(\"YES\")\n\t} else {\n\t\tPrint(\"NO\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "dbe77ae108a5802d4d3fee10cead6437", "src_uid": "ad105c08f63e9761fe90f69630628027", "difficulty": 1700.0} {"lang": "Go", "source_code": "// 172B\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x [100005]int\n\tvar a, b, m, r, s int\n\tfmt.Scan(&a, &b, &m, &r)\n\tfor x[r] = 0; r == (r*a+b)%m; {\n\t\tx[r] += s\n\t}\n\tfmt.Print(s - x[r] + 1)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "f4c2bdf7ea441f53f0b643343b74b303", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "difficulty": 1200.0} {"lang": "Go", "source_code": "// 172B\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x [100005]int\n\tvar a, b, m, r, s int\n\tfmt.Scan(&a, &b, &m, &r)\n\tfor ; x[r] == 0; r = (r*a + b) % m {\n\t\tx[r] += s\n\t}\n\tfmt.Print(s - x[r] + 1)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "24af1574bb94e0b9e9bbb7a60d1b85ea", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "difficulty": 1200.0} {"lang": "Go", "source_code": "// Try Codeforces\n// author: Leonardone @ NEETSDKASU\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tnames := []string{\"Danil\", \"Olya\", \"Slava\", \"Ann\", \"Nikita\"}\n\tcnt := 0\n\tfor _, x := range names {\n\t\tif strings.Contains(s, x) {\n\t\t\tcnt++\n\t\t}\n\t}\n\tif cnt == 1 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "e0d6fe6e66e955cc1b5efcaf3fd732f7", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar friends = []string{\"Danil\", \"Olya\", \"Slava\", \"Ann\", \"Nikita\"}\n\tvar (\n\t\tproblems string\n\t\tcount int\n\t)\n\tfmt.Scan(&problems)\n\n\tfor _, friend := range friends {\n\t\tif has := strings.Contains(problems, friend); has {\n\t\t\tcount++\n\t\t}\n\t\tif count > 1 {\n\t\t\tfmt.Print(\"NO\\n\")\n\t\t\treturn\n\t\t}\n\t}\n\tif count == 0 {\n\t\tfmt.Print(\"NO\\n\")\n\t\treturn\n\t}\n\tfmt.Print(\"YES\\n\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "d532c4e915026931be02be4e22a2ddaf", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n )\n \nfunc main() {\n var n,a,b,c int64\n fmt.Scanf(\"%v\\n\", &n)\n fmt.Scanf(\"%v\\n\", &a)\n fmt.Scanf(\"%v\\n\", &b)\n fmt.Scanf(\"%v\\n\", &c)\n \n bTotal := int64(0)\n if a >= b - c {\n for n >= 0 {\n Lb := int64(n/b)\n if Lb == 0 {\n break\n }\n n -= Lb*b\n n += c*Lb\n bTotal += Lb\n //fmt.Printf(\"%v %v\\n\", n, bTotal)\n }\n bTotal += int64(n/a)\n } else {\n bTotal = int64(n/a)\n }\n fmt.Printf(\"%v\", bTotal)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "91244c4c3dff6975936a999e23aa70b4", "src_uid": "0ee9abec69230eab25de51aef0984f8f", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n )\n \nfunc main() {\n var n,a,b,c int64\n fmt.Scanf(\"%v\\n\", &n)\n fmt.Scanf(\"%v\\n\", &a)\n fmt.Scanf(\"%v\\n\", &b)\n fmt.Scanf(\"%v\\n\", &c)\n \n bTotal := int64(0)\n if a > b - c {\n /*for n >= 0 {\n Lb := int64(n/b)\n if Lb == 0 {\n break\n }\n n -= Lb*b\n n += c*Lb\n bTotal += Lb\n //fmt.Printf(\"%v %v\\n\", n, bTotal)\n }*/\n \n bTotal += int64((n-c)/(b-c))\n if bTotal < 0 {\n fmt.Printf(\"0\")\n return\n }\n n -= bTotal*(b-c)\n bTotal += int64(n/a)\n } else {\n bTotal = int64(n/a)\n }\n fmt.Printf(\"%v\", bTotal)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "868e4f565268d1758135f95c7015d760", "src_uid": "0ee9abec69230eab25de51aef0984f8f", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\nfunc main(){\n\tvar(\n\t\tn int\n\t\ts string\n\t)\n\tfmt.Scan(&n,&s)\n\tif strings.Count(s,\"MM\")>0||strings.Count(s,\"CC\")>0||strings.Count(s,\"YY\")>0{\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\tif s[0]=='?'||s[n-1]=='?'||strings.Count(s,\"??\")>0||strings.Count(s,\"M?M\")>0||strings.Count(s,\"C?C\")>0||strings.Count(s,\"Y?Y\")>0{\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "805a230de455d21d91572c0fa6cd5735", "src_uid": "f8adfa0dde7ac1363f269dbdf00212c3", "difficulty": 1300.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n int\n\tvar s string\n\tfmt.Scanf(\"%d\\n\", &n)\n\tfmt.Scanf(\"%s\\n\", &s)\n\tfor i:=1;i Yes\n\t// A?B -> No\n\tfor i := range maj {\n\t\tif maj[i] == '?' {\n\t\t\tif i == 0 || i == len(maj)-1 {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif maj[i-1] == '?' || maj[i+1] == '?' {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif maj[i-1] == maj[i+1] {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tif solve() {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "86b28947c50ac3311a9ae6b11f3ced94", "src_uid": "f8adfa0dde7ac1363f269dbdf00212c3", "difficulty": 1300.0} {"lang": "Go", "source_code": "// A. Another One Bites The Dust\n/*\nLet's call a string good if and only if it consists of only two types of letters \u2014 'a' and 'b' and every two consecutive letters are distinct. For example \"baba\" and \"aba\" are good strings and \"abb\" is a bad string.\n\nYou have \ud835\udc4e strings \"a\", \ud835\udc4f strings \"b\" and \ud835\udc50 strings \"ab\". You want to choose some subset of these strings and concatenate them in any arbitrarily order.\n\nWhat is the length of the longest good string you can obtain this way?\n\nInput\nThe first line contains three positive integers \ud835\udc4e, \ud835\udc4f, \ud835\udc50 (1\u2264\ud835\udc4e,\ud835\udc4f,\ud835\udc50\u2264109) \u2014 the number of strings \"a\", \"b\" and \"ab\" respectively.\n\nOutput\nPrint a single number \u2014 the maximum possible length of the good string you can obtain.\n\nExamples\nInput\n1 1 1\n\nOutput\n4\n\nInput\n2 1 2\n\nOutput\n7\n\nInput\n3 5 2\n\nOutput\n11\n\nInput\n2 2 1\n\nOutput\n6\n\nInput\n1000000000 1000000000 1000000000\n\nOutput\n4000000000\n\nNote\nIn the first example the optimal string is \"baba\".\n\nIn the second example the optimal string is \"abababa\".\n\nIn the third example the optimal string is \"bababababab\".\n\nIn the fourth example the optimal string is \"ababab\".\n*/\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tinput, _ := reader.ReadString('\\n')\n\tarr := strings.Split(strings.TrimSpace(input), \" \")\n\ta, _ := strconv.Atoi(arr[0])\n\tb, _ := strconv.Atoi(arr[1])\n\tc, _ := strconv.Atoi(arr[2])\n\n\ttotal := c * 2\n\tif a > b {\n\t\ttotal += (2 * b) + 1\n\t} else if a < b {\n\t\ttotal += (2 * a) + 1\n\t} else {\n\t\ttotal += 2 * a\n\t}\n\tfmt.Print(total)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "494c47c4cd9304e9887146d13eab1094", "src_uid": "609f131325c13213aedcf8d55fc3ed77", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc fun(x int, y int, z int) int {\n\tans:=z * 2\n\tif x == y {\n\t\tans += x * 2\n\t\treturn ans\n\t} else if x > y {\n\t\tans += y * 2 + 1\n\t\treturn ans\n\t} else {\n\t\tans += x * 2 + 1\n\t\treturn ans\n\t}\n}\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\tfmt.Println(fun(a, b, c))\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "8463a2c652b43a0c59cce412bcaecdc4", "src_uid": "609f131325c13213aedcf8d55fc3ed77", "difficulty": 800.0} {"lang": "Go", "source_code": "// A. Another One Bites The Dust\n/*\nLet's call a string good if and only if it consists of only two types of letters \u2014 'a' and 'b' and every two consecutive letters are distinct. For example \"baba\" and \"aba\" are good strings and \"abb\" is a bad string.\n\nYou have \ud835\udc4e strings \"a\", \ud835\udc4f strings \"b\" and \ud835\udc50 strings \"ab\". You want to choose some subset of these strings and concatenate them in any arbitrarily order.\n\nWhat is the length of the longest good string you can obtain this way?\n\nInput\nThe first line contains three positive integers \ud835\udc4e, \ud835\udc4f, \ud835\udc50 (1\u2264\ud835\udc4e,\ud835\udc4f,\ud835\udc50\u2264109) \u2014 the number of strings \"a\", \"b\" and \"ab\" respectively.\n\nOutput\nPrint a single number \u2014 the maximum possible length of the good string you can obtain.\n\nExamples\nInput\n1 1 1\n\nOutput\n4\n\nInput\n2 1 2\n\nOutput\n7\n\nInput\n3 5 2\n\nOutput\n11\n\nInput\n2 2 1\n\nOutput\n6\n\nInput\n1000000000 1000000000 1000000000\n\nOutput\n4000000000\n\nNote\nIn the first example the optimal string is \"baba\".\n\nIn the second example the optimal string is \"abababa\".\n\nIn the third example the optimal string is \"bababababab\".\n\nIn the fourth example the optimal string is \"ababab\".\n*/\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tinput, _ := reader.ReadString('\\n')\n\tarr := strings.Split(strings.TrimSpace(input), \" \")\n\ta, _ := strconv.ParseInt(arr[0], 10, 64)\n\tb, _ := strconv.ParseInt(arr[1], 10, 64)\n\tc, _ := strconv.ParseInt(arr[2], 10, 64)\n\n\ttotal := c * 2\n\tif a > b {\n\t\ttotal += (2 * b) + 1\n\t} else if a < b {\n\t\ttotal += (2 * a) + 1\n\t} else {\n\t\ttotal += 2 * a\n\t}\n\tfmt.Print(total)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "e42f9da920253bf9bbfdd97032567c06", "src_uid": "609f131325c13213aedcf8d55fc3ed77", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, h, m int\n\tfmt.Scanf(\"%d\\n\", &x)\n\tfmt.Scanf(\"%d %d\\n\", &h, &m)\n\n\ty := 0\n\tfor m%10 != 7 && m != 7 && h != 7 && h !=17 {\n\t\tif m < x {\n\t\t\tm += 60\n\t\t\th--\n\t\t}\n\t\tif h<0 {\n\t\t\th += 24\n\t\t}\n\t\tm -= x\n\t\ty++\n\t}\n\tfmt.Println(y)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "874bed7156b43e8f2a76ce99a987b932", "src_uid": "5ecd569e02e0164a5da9ff549fca3ceb", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n)\n\nfunc main() {\n\tvar x, h, m int\n\tn, err := fmt.Scanf(\"%d\", &x)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif n != 1 {\n\t\tpanic(n)\n\t}\n\tn, err = fmt.Scanf(\"%d%d\", &h, &m)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif n != 2 {\n\t\tpanic(n)\n\t}\n\tt := time.Date(2000, time.November, 10, h, m, 0, 0, time.UTC)\n\ti := 0\n\tfor true {\n\t\thour := t.Hour()\n\t\tif hour%10 == 7 {\n\t\t\tbreak\n\t\t}\n\t\tminute := t.Minute()\n\t\tif minute%10 == 7 {\n\t\t\tbreak\n\t\t}\n\t\tt = t.Add(-time.Duration(x) * time.Minute)\n\t\ti++\n\t}\n\tfmt.Print(i)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "3043c39f56faeab718d7f68aab2db291", "src_uid": "5ecd569e02e0164a5da9ff549fca3ceb", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\tvar n, a, b, p1, p2 int\n\n\tarr := [22]int{}\n\tscanf(\"%d %d %d\\n\", &n, &a, &b)\n\tfor i := 0; i < n; i = i + 1 {\n\t\tscanf(\"%d\", &arr[i])\n\t}\n\tp2 = n - 1\n\tans := 0\n\tfor p1 <= p2 {\n\n\t\tif p1 == p2 {\n\t\t\tif arr[p1] == 2 {\n\t\t\t\tans += min(a, b)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\n\t\tif arr[p1] == arr[p2] && arr[p1] == 2 {\n\t\t\tans = ans + 2*min(a, b)\n\t\t}\n\t\tif arr[p1]^arr[p2] == 1 {\n\t\t\tans = -1\n\t\t\tbreak\n\t\t}\n\t\tif arr[p1] == 2 && arr[p2] == 1 {\n\t\t\tans = ans + b\n\t\t}\n\t\tif arr[p2] == 2 && arr[p1] == 1 {\n\t\t\tans = ans + b\n\t\t}\n\t\tif arr[p1] == 2 && arr[p2] == 0 {\n\t\t\tans = ans + a\n\t\t}\n\t\tif arr[p2] == 2 && arr[p1] == 0 {\n\t\t\tans = ans + a\n\t\t}\n\t\tp1++\n\t\tp2--\n\t}\n\tprintf(\"%d\", ans)\n\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "e93c2532e324c07ba269f1b80a011265", "src_uid": "af07223819aeb5bd6ded4340c472b2b6", "difficulty": 1000.0} {"lang": "Go", "source_code": "\ufeffpackage main\n\nimport (\n\t\"fmt\"\n\t//\"sort\"\n\t//\"math\"\n)\n\nfunc main() {\n\tvar m,x,y int\n\tvar a [100]int\n\ts,t:=0,0\n\tflag:=false\n \tfmt.Scan(&m)\n\tfor i:=0;i=x && s<=y && t-s>=x && t-s<=y {\n\t\t\tfmt.Println(i+2)\n\t\t\tflag=true\n\t\t\tbreak\n\t\t}\n\t}\n\tif flag==false {\n\t\tfmt.Println(\"0\")\n\t}\n}\n\n\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "3f53fabf526c095153dff6015be32879", "src_uid": "e595a1d0c0e4bbcc99454d3148b4557b", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc Sol552C(reader io.Reader, writer io.Writer) {\n\tin := bufio.NewReader(reader)\n\tout := bufio.NewWriter(writer)\n\tdefer out.Flush()\n\n\tvar w, m int\n\tFscan(in, &w, &m)\n\tif w <= 3 {\n\t\tFprint(out, \"YES\")\n\t\treturn\n\t}\n\tcoef := []int{}\n\tfor ; m > 0; m /= w {\n\t\tc := m % w\n\t\tif c > 1 {\n\t\t\tif c < w-1 {\n\t\t\t\tFprint(out, \"NO\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tc = -1\n\t\t}\n\t\tcoef = append(coef, c)\n\t}\n\tfor i, c := range coef {\n\t\tif c == -1 {\n\t\t\tfor j := i + 1; j < len(coef)-1; j++ {\n\t\t\t\tcoef[j]++\n\t\t\t\tif coef[j] != 0 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t} else if c > 1 {\n\t\t\tFprint(out, \"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\tFprint(out, \"YES\")\n}\n\nfunc main() {\n\tSol552C(os.Stdin, os.Stdout)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "cdd3523d96fa3bbb80e9ae090e8dc603", "src_uid": "a74adcf0314692f8ac95f54d165d9582", "difficulty": 1900.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n ans := false\n for i := 1; i <= n; i++ {\n t := (i*(i+1))/2\n if t == n {\n ans = true\n break\n } else if t > n {\n break\n }\n }\n if ans { fmt.Println(\"YES\") } else { fmt.Println(\"NO\") }\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "b4a9abbab50bd27df3a9bb04c01f39ef", "src_uid": "587d4775dbd6a41fc9e4b81f71da7301", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tm := map[int]struct{}{}\n\tfor i := 1; ; i++ {\n\t\ttripN := (i * (i + 1)) / 2\n\t\tif tripN > 500 {\n\t\t\tbreak\n\t\t}\n\t\tm[tripN] = struct{}{}\n\t}\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tif _, ok := m[n]; !ok {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tfmt.Println(\"YES\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "811e2d30dd54f15b336a28dc6aa4a0a0", "src_uid": "587d4775dbd6a41fc9e4b81f71da7301", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tM, B := sc.NextInt(), sc.NextInt()\n\n\tx := M * B / 2\n\ty := -((x - B*M) / M)\n\t\n\tif (x-B*M)%M != 0 {\n\t\tx += 1\n\t}\n\n\tn := y + 1\n\n\tsum := 0\n\t//println(x, y, n)\n\tfor i := x; i >= 0; i-- {\n\t\tsum += n*(n-1)/2 + n*i\n\t\tprintln(sum)\n\t}\n\tfmt.Println(sum)\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "1ef36cf33cfbf63e7f89366910fe0748", "src_uid": "9300f1c07dd36e0cf7e6cb7911df4cf2", "difficulty": 1300.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\nconst M int64 = 998244353\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) {\n fmt.Fprintf(writer, f, a...)\n}\n\nfunc scanf(f string, a ...interface{}) {\n fmt.Fscanf(reader, f, a...)\n}\n\nfunc sp(x, y int64) int64 {\n var mul, res int64 = x, 1\n for y != 0 {\n if y % 2 != 0 {\n res = (res * mul) % M\n }\n mul = (mul * mul) % M\n y /= 2\n }\n return res\n}\n\nfunc main() {\n defer writer.Flush()\n var n, m, k int\n scanf(\"%d%d%d\", &n, &m, &k)\n fac := make([]int64, n+1)\n fac[0] = 1\n for i := 1; i <= n; i += 1 {\n fac[i] = (fac[i-1] * int64(i)) % M\n }\n\n sol := fac[n-1]\n sol = (sol * sp(fac[n-1-k], M-2)) % M\n sol = (sol * sp(fac[k], M-2)) % M\n sol = (sol * sp(int64(m-1), int64(k))) % M\n sol = (sol * int64(m)) % M\n printf(\"%d\\n\", sol)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "45b641999f6a9aa685815cee8ae75d50", "src_uid": "b2b9bee53e425fab1aa4d5468b9e578b", "difficulty": 1500.0} {"lang": "Go", "source_code": "\ufeffpackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar no,mo int\n\tco,to := 0,0\n\ta:=make([]int,200)\n\tfmt.Scan(&no,&mo)\n\tfor i:=0;imo {\n\t co++\n\t i--\n\t to = 0\n\t break\n\t } else {\n\t to += a[i];\n\t }\n\t }\n\t }\n\t}\n\tif to!=0 {\n\t co++\n\t}\n\tfmt.Println(co)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "19aa1a93ef09ec9138fa29abab8ad044", "src_uid": "5c73d6e3770dff034d210cdd572ccf0f", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n,m,a int\n fmt.Scan(&n,&m)\n ans, bus := 1, 0\n for i := 0; i < n; i++ {\n fmt.Scan(&a)\n if (bus+a) <= m {\n bus += a\n } else {\n ans++\n bus = a\n }\n }\n fmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "25ce293eb8d4385045c2958649c78944", "src_uid": "5c73d6e3770dff034d210cdd572ccf0f", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i interface{}, delim string) error {\n\t_, err := fmt.Fscanf(r, \"%v\"+delim, i)\n\treturn err\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.txt\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tvar n int\n\tfor I(&n, \" \") == nil {\n\t\tsolve(n)\n\t}\n}\n\nfunc solve(n int) {\n\tvar m int\n\tI(&m, \"\\n\")\n\to := 0\n\tans := 1\n\tfor i := 0; i < n; i++ {\n\t\tvar t int\n\t\ts := \" \"\n\t\tif i == n-1 {\n\t\t\ts = \"\\n\"\n\t\t}\n\t\tI(&t, s)\n\t\tif o+t <= m {\n\t\t\to += t\n\t\t} else {\n\t\t\ti--\n\t\t\tans++\n\t\t\to = 0\n\t\t}\n\t}\n\tO(ans, \"\\n\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "28f6bd41de58856a18c915fa9a5b1f81", "src_uid": "5c73d6e3770dff034d210cdd572ccf0f", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar l, r, x, y, k int64\n\tfmt.Scan(&l, &r, &x, &y, &k)\n\tif x*k < l {\n\t\tx = (l + k - 1) / k\n\t}\n\tif y*k > r {\n\t\ty = r / k\n\t}\n\tif x > y {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "718b093b19538e57a6447687234d7cf9", "src_uid": "1110d3671e9f77fd8d66dca6e74d2048", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n\nfunc main() {\n\tdefer writer.Flush()\n\tvar n, tot int\n\tscanf(\"%d\\n\", &n)\n\tarr := []int{}\n\tans := []int{}\n\tans = append(ans, 1)\n\tfor i := 0; i < n; i++ {\n\t\tvar t int\n\t\tscanf(\"%d\", &t)\n\t\ttot += t\n\t\tarr = append(arr, t)\n\t}\n\tcur := arr[0]\n\tfor i := 1; i < n; i++ {\n\t\tif arr[i]*2 <= arr[0] {\n\t\t\tcur += arr[i]\n\t\t\tans = append(ans, i+1)\n\t\t}\n\t}\n\tif cur > tot-cur {\n\n\t\tprintf(\"%d\\n\", len(ans))\n\t\tfor i := 0; i < len(ans); i++ {\n\t\t\tprintf(\"%d \", ans[i])\n\t\t}\n\t} else {\n\t\tprintf(\"0\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "b4a372c0689e99dee669a865022985bb", "src_uid": "0a71fdaaf08c18396324ad762b7379d7", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\n\nfunc main() {\n var a, b, x int64 \n x = 1\n\n fmt.Scan(&a, &b);\n\n for i := a + 1; i <= b; i++ {\n x = (x * i % 10) % 10 \n } \n\n fmt.Println(x);\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "9a42733fc701b84cf7f3971b29863dd5", "src_uid": "2ed5a7a6176ed9b0bda1de21aad13d60", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n \nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t_ \"math\"\n\t\"os\"\n\t_ \"sort\"\n)\n \nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n \nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n \ntype intPair struct {\n\ta int64\n\tb int64\n}\n \nfunc max(a, b int) int {\n\tif(a > b) {\n\t\treturn a\n\t}\n\treturn b\n}\n \nfunc min(a, b int) int {\n\tif(a= ans {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif live(y.hp + bh, m.atk - (y.def + bd)) > live(m.hp, (y.atk + ba) - m.def) {\n\t\t\t\t\tans = pr\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Fprintln(out, ans)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "58bc5b2206d9300ef0ebc7fd77342274", "src_uid": "bf8a133154745e64a547de6f31ddc884", "difficulty": 1800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc getCategories(x int) string {\n\treturn map[int]string{1: \"A\", 3: \"B\", 2: \"C\", 0: \"D\"}[x%4]\n}\n\nfunc main() {\n\tvar x, a int\n\tfmt.Scan(&x)\n\tif getCategories(x+1) < getCategories(x+a) {\n\t\ta = 1\n\t}\n\tif getCategories(x+2) < getCategories(x+a) {\n\t\ta = 2\n\t}\n\tfmt.Println(a, getCategories(x+a))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "155eddcede7531ba39e19c8c34e0687c", "src_uid": "488e809bd0c55531b0b47f577996627e", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x int\n\tfmt.Scanf(\"%d\", &x)\n\ti := x % 4\n\tswitch i {\n\tcase 1:\n\t\tfmt.Println(\"0 A\")\n\t\tbreak\n\tcase 3:\n\t\tfmt.Println(\"2 A\")\n\t\tbreak\n\tcase 2:\n\t\tfmt.Println(\"1 B\")\n\t\tbreak\n\tcase 0:\n\t\tfmt.Println(\"1 A\")\n\tdefault:\n\t\treturn\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "cd78140d73640195dbb466602df06720", "src_uid": "488e809bd0c55531b0b47f577996627e", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(\"enter text\")\n\tvar input int\n\tfmt.Scanln(&input)\n\tvar remainder = input % 4\n\tif remainder == 0 {\n\t\tfmt.Println(\"1 A\")\n\t} else if remainder == 1 {\n\t\tfmt.Println(\"0 A\")\n\t} else if remainder == 2 {\n\t\tfmt.Println(\"1 B\")\n\t} else if remainder == 3 {\n\t\tfmt.Println(\"2 A\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "a5dd5d23ad83fa9165e3e36f3559c81e", "src_uid": "488e809bd0c55531b0b47f577996627e", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m, z int\n\n\tfmt.Scanf(\"%d\", &n)\n\tfmt.Scanf(\"%d\", &m)\n\tfmt.Scanf(\"%d\", &z)\n\n\t// kill them all\n\tkill_count := 0\n\n\tif n == m {\n\t\tfmt.Println(z)\n\t\treturn\n\t}\n\n\tfor i := 1; i <= z; i++ {\n\t\tif (i)%m == 0 && (i)%n == 0 {\n\t\t\tkill_count += 1\n\t\t}\n\t}\n\n\tfmt.Println(kill_count)\n\n\treturn\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "826f80e7c1f95ad4e8d8ef48784ea283", "src_uid": "e7ad55ce26fc8610639323af1de36c2d", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strings\"\n \"strconv\"\n )\n\nfunc GCD(a, b int) int {\n for b != 0 {\n a, b = b, a%b\n }\n\n return a\n}\n\nfunc getLine(s *bufio.Scanner) (int,int,int) {\n s.Scan()\n ab := strings.Fields(s.Text())\n a, _ := strconv.Atoi(ab[0])\n b, _ := strconv.Atoi(ab[1])\n c, _ := strconv.Atoi(ab[2])\n \n return a,b,c\n}\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n n, m, z:= getLine(scanner)\n a := 0\n if GCD(n,m) == 1 {\n a = n*m\n } else {\n a = m\n }\n fmt.Println(z / a)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "18aa46e99850d396664e40600d7fa19d", "src_uid": "e7ad55ce26fc8610639323af1de36c2d", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tvar n, m, z, cnt int\n\n\tfmt.Fscanln(reader, &n, &m, &z)\n\n\tfor i := 1; i*m <= z; i++ {\n\t\tif (i*m)%n == 0 {\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "13fd35ffedf5501f8f8978934d1423c9", "src_uid": "e7ad55ce26fc8610639323af1de36c2d", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n, p, l int\n\n\tinput := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(input, &n)\n\n\tfor i := 0; i < n; i++ {\n\t\t\tp = l\n\t\tfmt.Fscan(input, &l)\n\t}\n\n\tif n == 1 {\n\t\tif l == 15 {\n\t\t\tfmt.Println(\"DOWN\")\n\t\t} else if l == 0 {\n\n\t\t\tfmt.Println(\"UP\")\n\t\t} else {\n\t\t\tfmt.Println(-1)\n\t\t}\n\t\n\treturn\n}\n\tif p > l {\n\t\tif l == 1 {\n\t\t\tfmt.Println(\"UP\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(\"DOWN\")\n\t} else {\n\t\tif l == 15 {\n\t\t\tfmt.Println(\"DOWN\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(\"UP\")\n\t}\n\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "1b967098b9e3e294511ef11796f45c81", "src_uid": "8330d9fea8d50a79741507b878da0a75", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\nimport \"bufio\"\nimport \"os\"\n\nvar bufin *bufio.Reader\nvar bufout *bufio.Writer\n\nfunc main() {\n\tbufin = bufio.NewReader(os.Stdin)\n\tbufout = bufio.NewWriter(os.Stdout)\n\tdefer bufout.Flush()\n\n\tvar n int\n\tfmt.Fscanf(bufin, \"%d\\n\", &n)\n\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(bufin, \"%d\\n\", &a[i])\n\t}\n\n\tif a[n-1] == 0 {\n\t\tfmt.Fprintf(bufout, \"UP\\n\")\n\t} else if a[n-1] == 15 {\n\t\tfmt.Fprintf(bufout, \"DOWN\\n\")\n\t} else if n == 1 {\n\t\tfmt.Fprintf(bufout, \"-1\\n\")\n\t} else if a[n-2] < a[n-1] {\n\t\tfmt.Fprintf(bufout, \"UP\\n\")\n\t} else {\n\t\tfmt.Fprintf(bufout, \"DOWN\\n\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "82e7add6657d2837a51b73af3457d5a0", "src_uid": "8330d9fea8d50a79741507b878da0a75", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar k_cf702d, a_cf702d, b_cf702d, t_cf702d int\n\nfunc startCar(d int64) float64 {\n\tif d <= int64(k_cf702d) {\n\t\treturn float64(int64(a_cf702d)*d)\n\t}\n\treturn float64(a_cf702d*k_cf702d) + math.Min(float64(float64(t_cf702d) + startCar(d-int64(k_cf702d))), float64(int64(b_cf702d)*(d-int64(k_cf702d))))\n}\n\nfunc main() {\n\n\t//fmt.Printf(\"%f\\n\", math.MaxFloat64)\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tscanner.Buffer([]byte{}, int(math.Pow(10,8)))\n\n\tscanner.Scan()\n\tdkabtStr := scanner.Text()\n\tdkabtStrArr := strings.Split(dkabtStr, \" \")\n\td, _ := strconv.ParseInt(dkabtStrArr[0], 10, 64)\n\tk_cf702d, _ = strconv.Atoi(dkabtStrArr[1])\n\ta_cf702d, _ = strconv.Atoi(dkabtStrArr[2])\n\tb_cf702d, _ = strconv.Atoi(dkabtStrArr[3])\n\tt_cf702d, _ = strconv.Atoi(dkabtStrArr[4])\n\n\tvar resp float64\n\tif d <= int64(k_cf702d) {\n\t\tresp = float64(int64(a_cf702d) * d)\n\t} else {\n\t\tresp = float64(a_cf702d*k_cf702d)\n\t\tcarAvg := (float64(t_cf702d)/float64(k_cf702d)) + float64(a_cf702d)\n\t\tif carAvg <= float64(b_cf702d) {\n\t\t\tresp += float64(d - int64(k_cf702d)) * carAvg\n\t\t} else {\n\t\t\tresp += float64((d - int64(k_cf702d)) * int64(b_cf702d))\n\t\t}\n\t}\n\n\t//resp := math.Min(float64(int64(b_cf702d)*d), startCar(d))\n\n\tfmt.Printf(\"%f\\n\", math.Ceil(resp))\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "69526725350b71621c3472727d600b61", "src_uid": "359ddf1f1aed9b3256836e5856fe3466", "difficulty": 1900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc solve(n int, is []int) {\n\tsum := 0\n\tfor _, v := range is {\n\t\tsum += v\n\t}\n\tn = n % sum\n\n\tfor i, v := range is {\n\t\tif n-v <= 0 {\n\t\t\tfmt.Println(i + 1)\n\t\t\treturn\n\t\t}\n\t\tn -= v\n\t}\n\n}\n\nfunc main() {\n\tvar n, tmp int\n\n\t_, err := fmt.Scan(&n)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tis := make([]int, 0, 7)\n\tfor i := 0; i < 7; i++ {\n\t\tfmt.Scan(&tmp)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tis = append(is, tmp)\n\t}\n\tsolve(n, is)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "86274c34e75e65d542671672afd5f93c", "src_uid": "007a779d966e2e9219789d6d9da7002c", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\nfunc readLine()(string,error) \t\t\t{ return reader.ReadString('\\n') }\n\nfunc main() {\n\tdefer writer.Flush()\n\tvar n, v int\n\tscanf(\"%d %d\", &n, &v)\n\tvar c int;\n\tif (n < v) {\n\t\tc = n - 1\n\t} else {\n\t\tc = v\n\t\tfor i := 2; i <= n-v; i++ {\n\t\t\tc += i\n\t\t}\n\t}\n\tprintf(\"%d\\n\" ,c)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "796c5b3d4844abb91fd66df86681941b", "src_uid": "f8eb96deeb82d9f011f13d7dac1e1ab7", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar i, tmp int\n\tvar arr1, arr2 []int\n\tvar arr3 [4]int\n\tvar flag bool\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tline, _ := reader.ReadString('\\n')\n\tarrS := strings.Split(strings.TrimSpace(line), \" \")\n\tfor i := range arrS {\n\t\ttmp, _ = strconv.Atoi(arrS[i])\n\t\tarr3[i] = tmp\n\t}\n\tline, _ = reader.ReadString('\\n')\n\tarrS = strings.Split(strings.TrimSpace(line), \" \")\n\tfor i := range arrS {\n\t\ttmp, _ = strconv.Atoi(arrS[i])\n\t\tarr3[i+2] = tmp\n\t}\n\ti = 0\n\tfor i != 6000 {\n\t\tarr1 = append(arr1, arr3[1]+(i*arr3[0]))\n\t\tarr2 = append(arr2, arr3[3]+(i*arr3[2]))\n\t\ti++\n\t}\n\ti = 0\n\tfor j := range arr1 {\n\t\tx := arr1[j]\n\t\ti := sort.Search(len(arr2), func(i int) bool { return arr2[i] >= x })\n\t\tif i < len(arr2) && arr2[i] == x {\n\t\t\twriter.WriteString(strconv.Itoa(x))\n\t\t\tflag = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !flag {\n\t\twriter.WriteString(\"-1\")\n\t}\n\twriter.Flush()\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "31edc947114455029315ef2327d3607d", "src_uid": "158cb12d45f4ee3368b94b2b622693e7", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n s := getS()\n chars := []byte{ s[0] }\n for i := 1; i < len(s); i++ {\n if s[i] != '/' || s[i-1] != '/' {\n chars = append(chars, s[i])\n }\n }\n if len(chars) > 1 && chars[len(chars)-1] == '/' {\n chars = chars[:len(chars)-1]\n }\n writer.WriteString(fmt.Sprintf(\"%s\\n\", string(chars)))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "72fa53e43ebb2b281752577a29ef9ff9", "src_uid": "6c2e658ac3c3d6b0569dd373806fa031", "difficulty": 1700.0} {"lang": "Go", "source_code": "// 402A-mic_rizal\npackage main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var k, a, b, v, hasil int\n fmt.Scan(&k, &a, &b, &v)\n for a > 0 {\n if b >= k-1 {\n b -= (k - 1)\n a -= v * k\n hasil++\n } else if b != 0 {\n a -= v * (b + 1)\n hasil++\n b = 0\n } else {\n a -= v\n hasil++\n }\n }\n fmt.Println(hasil)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "82a3760821fc275cf34ceb94e3cea133", "src_uid": "7cff20b1c63a694baca69bdf4bdb2652", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n\nvar n, m, mod int64\nvar matrix [][]int\n\nfunc multiply(one, two [][]int) [][]int {\n\tres := make([][]int, m)\n\tfor i := 0; i < int(m); i++ {\n\t\tres[i] = make([]int, m)\n\t}\n\tfor i := 0; i < int(m); i++ {\n\t\tfor j := 0; j < int(m); j++ {\n\t\t\tfor k := 0; k < int(m); k++ {\n\t\t\t\tres[i][j] += int(int64(one[i][k]) * int64(two[k][j]) % mod)\n\t\t\t\tres[i][j] %= int(mod)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\nfunc power(exp int64, base [][]int) [][]int {\n\n\tif exp == 1 {\n\t\treturn base\n\t}\n\n\tres := power(exp/2, base)\n\tres = multiply(res, res)\n\tif exp&1 == 1 {\n\t\tres = multiply(res, base)\n\t}\n\treturn res\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\tmod = 1000000007\n\tscanf(\"%d %d\\n\", &n, &m)\n\tif n < m {\n\t\tprintf(\"1\")\n\t\treturn\n\t}\n\tif n == m {\n\t\tprintf(\"2\")\n\t\treturn\n\t}\n\tmatrix = make([][]int, m)\n\tfor i := 0; i < int(m); i++ {\n\t\tmatrix[i] = make([]int, m)\n\t}\n\tmatrix[0][0] = 1\n\tmatrix[0][m-1] = 1\n\tfor i := 1; i < int(m); i++ {\n\t\tmatrix[i][i-1] = 1\n\t}\n\n\tfmt.Println(power(n, matrix)[0][0])\n\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "33a943d3f8989f9aed9984ed3395b777", "src_uid": "e7b9eec21d950f5d963ff50619c6f119", "difficulty": 2100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc isSubsequence(s, t string) bool {\n\tif len(s) < len(t) {\n\t\treturn false\n\t}\n\n\tfor _, c := range t {\n\t\tif !strings.Contains(s, string(c)) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tvar (\n\t\ts, t string\n\t)\n\n\t// file, err := os.Open(\"input.txt\")\n\t// if err != nil {\n\t// \tpanic(err)\n\t// }\n\n\treader := bufio.NewReader(os.Stdin)\n\n\tfmt.Fscanf(reader, \"%s\\n\", &s)\n\tfmt.Fscanf(reader, \"%s\\n\", &t)\n\n\tvar maxLen = -1\n\tfor l := 0; l < len(s); l++ {\n\t\tfor r := l; r < len(s); r++ {\n\t\t\tarr := []string{string(s[:l]), string(s[r+1:])}\n\t\t\tnewS := strings.Join(arr, \"\")\n\n\t\t\tif isSubsequence(newS, t) {\n\t\t\t\tmaxLen = max(r-l+1, maxLen)\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(maxLen)\n\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "86399e7c3b3e7d2d3bd182d0fd6d910a", "src_uid": "0fd33e1bdfd6c91feb3bf00a2461603f", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc scanInt(scanner *bufio.Scanner) int {\n\tscanner.Scan()\n\tx, _ := strconv.Atoi(scanner.Text())\n\treturn x\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\tk := scanInt(scanner)\n\tscanner.Scan()\n\ts := scanner.Text()\n\tn := len(s)\n\tpal := make([]uint8, n)\n\tfor i, ch := range s {\n\t\tpal[i] = uint8(ch)\n\t}\n\tfor i := (n-1)/2; i >= 0; i-- {\n\t\tj := n-1-i\n\t\tif pal[i] == pal[j] {\n\t\t\tcontinue\n\t\t}\n\t\tif pal[i] == '?' {\n\t\t\tpal[i] = pal[j]\n\t\t} else if pal[j] == '?' {\n\t\t\tpal[j] = pal[i]\n\t\t} else {\n\t\t\twriter.WriteString(\"IMPOSSIBLE\\n\")\n\t\t\treturn\n\t\t}\n\t}\n\tseen := map[uint8]bool{}\n\tfor i := 0; i < k; i++ {\n\t\tseen['a'+uint8(i)] = false\n\t}\n\tfor _, ch := range pal {\n\t\tif ch != '?' {\n\t\t\tseen[ch] = true\n\t\t}\n\t}\n\tneed := []uint8{}\n\tfor ch, ok := range seen {\n\t\tif !ok {\n\t\t\tneed = append(need, ch)\n\t\t}\n\t}\n\t/*\n\tfor _, ch := range pal {\n\t\twriter.WriteString(fmt.Sprintf(\"%c\", ch))\n\t}\n\twriter.WriteString(fmt.Sprintf(\" (k = %d)\\n\", k))\n\twriter.WriteString(fmt.Sprintf(\"need %d:\", len(need)))\n\tfor _, ch := range need {\n\t\twriter.WriteString(fmt.Sprintf(\" %c\", ch))\n\t}\n\twriter.WriteString(\"\\n\")\n\t*/\n\tnix := len(need)-1\n\tfor i := (n-1)/2; i >= 0; i-- {\n\t\tif pal[i] != '?' {\n\t\t\tcontinue\n\t\t}\n\t\tj := n-1-i\n\t\tif nix == -1 {\n\t\t\tpal[i] = 'a'\n\t\t\tpal[j] = 'a'\n\t\t} else {\n\t\t\tpal[i] = need[nix]\n\t\t\tpal[j] = need[nix]\n\t\t\tnix--\n\t\t}\n\t}\n\tif nix != -1 {\n\t\twriter.WriteString(\"IMPOSSIBLE\\n\")\n\t\treturn\n\t}\n\tfor _, ch := range pal {\n\t\twriter.WriteString(fmt.Sprintf(\"%c\", ch))\n\t}\n\twriter.WriteString(\"\\n\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "41e6b0e75cfc6060da3714e47b3b9a10", "src_uid": "9d1dd9d722e5fe46823224334b3b208a", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n\nfunc main() {\n defer writer.Flush()\n var a, b, c int\n scanf(\"%d %d %d\\n\", &a, &b, &c)\n solve(a, b, c)\n}\n\n// a b c a c b a\nfunc solve(a, b, c int) {\n min := a / 3\n if b/2 < min {\n min = b / 2\n }\n if c/2 < min {\n min = c / 2\n }\n a -= min * 3\n b -= min * 2\n c -= min * 2\n max := 0\n food := []int{0, 1, 2, 0, 2, 1, 0}\n for start := range food {\n temp := 0\n cur := start\n store := []int{a, b, c}\n for true {\n cur %= 7\n store[food[cur]]--\n if store[food[cur]] < 0 {\n break\n } else {\n temp++\n }\n cur++\n }\n if temp > max {\n max = temp\n }\n }\n printf(\"%d\\n\", max+7*min)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "3b51a5e96ef3e0e82113663766db9736", "src_uid": "e17df52cc0615585e4f8f2d31d2daafb", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\n\tvar k, n, s, p int\n\tfmt.Fscanf(reader, \"%d %d %d %d\", &k, &n, &s, &p)\n\n\t// number of paper sheets each person needs\n\tsheetEach := n / s\n\tif n % s > 0 {\n\t\tsheetEach += 1\n\t}\n\ttotalSheet := sheetEach * k\n\t\n\t// number of packs to buy\n\tpacks := totalSheet / p\n\tif totalSheet % p > 0 {\n\t\tpacks += 1\n\t}\n\n\tfmt.Println(packs)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "b415b0b5030660a0ac35ef5fbfe74bbf", "src_uid": "73f0c7cfc06a9b04e4766d6aa61fc780", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n\nfunc main() {\n\tdefer Flush()\n\n\tk := readll()\n\tn := readll()\n\ts := readll()\n\tp := readll()\n\n\ts2 := n / s\n\tif n%s != 0 {\n\t\ts2++\n\t}\n\tans := k * s2 / p\n\tif s2%p != 0 {\n\t\tans++\n\t}\n\tprintln(ans)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "a63653b70237ce22c0c66ef812e74aba", "src_uid": "73f0c7cfc06a9b04e4766d6aa61fc780", "difficulty": 800.0} {"lang": "Go", "source_code": "// 146A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar x string\n\tfmt.Scan(&n)\n\tfmt.Scan(&x)\n\tout := true\n\tfirstSum, secondSum := 0, 0\n\tfor k := 0; k < n; k++ {\n\t\tif out {\n\t\t\tif x[k] != 4 && x[k] != 7 {\n\t\t\t\tout = false\n\t\t\t}\n\t\t\tif k < (n / 2) {\n\t\t\t\tfirstSum += int(x[k] - '0')\n\t\t\t} else {\n\t\t\t\tsecondSum += int(x[k] - '0')\n\t\t\t}\n\t\t}\n\t}\n\tif firstSum != secondSum {\n\t\tout = false\n\t}\n\tif out {\n\t\tfmt.Print(\"YES\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\n\tfmt.Println(out)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "a0229150c7bd9d7a57c82098c6c95144", "src_uid": "435b6d48f99d90caab828049a2c9e2a7", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nvar x, k, A, B, res int64\n\nfunc main() {\n\tfmt.Scanf(\"%d\\n%d\\n%d\\n%d\", &x, &k, &A, &B)\n\tfor x > 1 {\n\t\tif (k == 1) || (x % k != 0) {\n\t\t\tx--\n\t\t\tres += A\n\t\t} else {\n\t\t\td := x / k;\n\t\t\tif B > (x - d) * A {\n\t\t\t\tx--\n\t\t\t\tres += A\n\t\t\t} else {\n\t\t\t\tx /= k\n\t\t\t\tres += B\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "b87bdb26e35f5ac0f30821613fe5e235", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\r\n\r\nimport (\r\n\t. \"fmt\"\r\n\t\"io\"\r\n\t\"os\"\r\n\t\"regexp\"\r\n\t\"strconv\"\r\n)\r\n\r\n// github.com/EndlessCheng/codeforces-go\r\nfunc CF1618F(in io.Reader, out io.Writer) {\r\n\tvar x, y uint64\r\n\tFscan(in, &x, &y)\r\n\tif x == y {\r\n\t\tFprintln(out, \"YES\")\r\n\t\treturn\r\n\t}\r\n\ts := strconv.FormatUint(x, 2)\r\n\tt := strconv.FormatUint(y, 2)\r\n\tf := func() bool {\r\n\t\tr := regexp.MustCompile(\"^1*\" + s + \"1*$\")\r\n\t\treturn r.MatchString(t)\r\n\t}\r\n\tif f() {\r\n\t\tFprintln(out, \"YES\")\r\n\t\treturn\r\n\t}\r\n\tfor s[len(s)-1] == '0' {\r\n\t\ts = s[:len(s)-1]\r\n\t}\r\n\tif f() {\r\n\t\tFprintln(out, \"YES\")\r\n\t} else {\r\n\t\tFprintln(out, \"NO\")\r\n\t}\r\n}\r\n\r\nfunc main() { CF1618F(os.Stdin, os.Stdout) }\r\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "43f8c63d1e100bca3ccee2a383eb7903", "src_uid": "9f39a3c160087beb0efab2e3cb510e89", "difficulty": 2000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c, d int\n\tfmt.Scanf(\"%d %d %d %d\", &a, &b, &c, &d)\n\tif b - a == c - b && c - b == d - c {\n\t\tfmt.Printf(\"%d\", a + (b - a) * 4)\n\t} else if a != 0 && b != 0 && c != 0 && d != 0 && b * b == a * c && c * c == b * d && a != b {\n\t\tif d * d % c == 0 {\n\t\t\tfmt.Printf(\"%d\", d * d / c)\n\t\t} else {\n\t\t\tfmt.Printf(\"42\")\n\t\t}\n\t} else {\n\t\tfmt.Printf(\"42\")\n\t}\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "a868601020533c6f68c272acb5c4a937", "src_uid": "68a9508d49fec672f9c61766d6051047", "difficulty": 1800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanln(&a)\n\tb = 0\n\tfor a != 0 {\n\t\tif a%8 == 1 {\n\t\t\tb++\n\t\t}\n\t\ta /= 8\n\t}\n\tfmt.Println(b)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "6f6ad287e9569caeaddf738e7a78aba8", "src_uid": "ec539775f2b3358a92a99a644e2480ce", "difficulty": 2100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t// \"time\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\n//Wrong\nfunc main() {\n\t// defer func(start time.Time) {\n\t// \tfmt.Println(time.Since(start))\n\t// }(time.Now())\n\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tn, p, k := nextInt(), nextInt(), nextInt()\n\n\tif p-k>1 {\n\t\tfmt.Fprint(writer, \"<< \")\n\t}\n\n\tfor i:=0; i= 1 {\n\t\t\tfmt.Fprint(writer, p-k+i, \" \")\n\t\t}\n\t}\n\n\tfmt.Fprint(writer, \"(\", p, \") \")\n\n\tfor i:=1; i<=k; i++ {\n\t\tif p+i <= n {\n\t\t\tfmt.Fprint(writer, p+i, \" \")\n\t\t}\n\t}\n\n\tif p+k>\")\n\t}\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tn, err := strconv.Atoi(next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "3b90ecacfadae79558499ed678f1fa36", "src_uid": "526e2cce272e42a3220e33149b1c9c84", "difficulty": null} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"math\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n)\n\nfunc main() {\n\tb, _ := ioutil.ReadAll(os.Stdin)\n\tif len(b) == 0 {\n\t\ttest()\n\t} else {\n\t\tsolve(bytes.NewReader(b), os.Stdout)\n\t}\n}\n\nfunc solve(r io.Reader, w io.Writer) {\n\tvar n uint64\n\tfmt.Fscanln(r, &n)\n\tfmt.Fprintln(w, int(math.Ceil(math.Log2(float64(n)))))\n}\n\nfunc test() {\n\ttests := []struct {\n\t\tin string\n\t\twant string\n\t}{\n\t\t{in: `2`, want: `1`},\n\t\t{in: `3`, want: `2`},\n\t\t{in: `4`, want: `2`},\n\t\t{in: `5`, want: `3`},\n\t\t{in: `6`, want: `3`},\n\t\t{in: `7`, want: `3`},\n\t\t{in: `8`, want: `3`},\n\t\t{in: `9`, want: `4`},\n\t\t{in: `10`, want: `4`},\n\t\t{in: `16`, want: `4`},\n\t\t{in: `17`, want: `5`},\n\t}\n\tfor i, tt := range tests {\n\t\tfmt.Printf(\"=== TEST %d\\n\", i)\n\t\tbuf := new(bytes.Buffer)\n\t\tsolve(strings.NewReader(chomp(tt.in)), buf)\n\t\tif got, want := chomp(buf.String()), chomp(tt.want); got != want {\n\t\t\tfmt.Printf(\"%d: got %v, want %v\\n\", i, got, want)\n\t\t}\n\t}\n}\n\nfunc chomp(s string) string {\n\treturn strings.Trim(s, \"\\n\")\n}\n\nfunc assert(b bool) {\n\tif !b {\n\t\t_, file, line, ok := runtime.Caller(1)\n\t\tif ok {\n\t\t\tf, _ := os.Open(file)\n\t\t\tdefer f.Close()\n\t\t\ts := bufio.NewScanner(f)\n\t\t\tlnum := 0\n\t\t\tfor s.Scan() {\n\t\t\t\tlnum++\n\t\t\t\tif lnum == line {\n\t\t\t\t\twd, _ := os.Getwd()\n\t\t\t\t\tfname, _ := filepath.Rel(wd, file)\n\t\t\t\t\tfmt.Printf(\"assertion fails: %s:%d: %v\\n\", fname, line, s.Text())\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc pow(a, b int) int {\n\tr := 1\n\tfor i := 0; i < b; i++ {\n\t\tr *= a\n\t}\n\treturn r\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "e129569b135cb78cf48e9ca74a48c64a", "src_uid": "3d3432b4f7c6a3b901161fa24b415b14", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\ntype Vec [4]int\n\nfunc (v Vec) max() int {\n\tmax := -999\n\tfor i := 0;i < len(v);i ++ {\n\t\tif v[i] > max {\n\t\t\tmax = v[i]\n\t\t}\n\t}\n\treturn max\n}\n\nfunc (v Vec) min() int {\n\tmin := 999\n\tfor i := 0;i < len(v);i ++ {\n\t\tif v[i] < min {\n\t\t\tmin = v[i]\n\t\t}\n\t}\n\treturn min\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t} else {\n\t\treturn x\n\t}\n}\nfunc main() {\n\tbs, _ := ioutil.ReadAll(os.Stdin)\n\treader := bytes.NewBuffer(bs)\n\t\n\tvar ax, ay, bx, by Vec\n\tfmt.Fscanf(reader, \"%d %d %d %d %d %d %d %d\\n\", &ax[0], &ay[0], &ax[1], &ay[1], &ax[2], &ay[2], &ax[3], &ay[3])\n\tfmt.Fscanf(reader, \"%d %d %d %d %d %d %d %d\\n\", &bx[0], &by[0], &bx[1], &by[1], &bx[2], &by[2], &bx[3], &by[3])\n\t\n\taxMax, axMin, ayMax, ayMin := ax.max(), ax.min(), ay.max(), ay.min()\n\tbxMax, bxMin, byMax, byMin := bx.max(), bx.min(), by.max(), by.min()\n\tbxAvg, byAvg := (bxMax + bxMin) / 2, (byMax + byMin) / 2\n\tdist := bxMax - bxAvg\n\n\n\n\tfor x := -100; x <= 100; x ++ {\n\t\tfor y := -100; y <= 100; y ++ {\n\t\t\tif (axMin <= x && x <= axMax && ayMin <= y && y <= ayMax) {\n\t\t\t\tif (abs(x - bxAvg) + abs(y - byAvg) <= dist) {\n\t\t\t\t\tfmt.Printf(\"YES\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Printf(\"NO\")\n\treturn\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "2a15e4596d8d4b47ce11e34e946faa13", "src_uid": "f6a3dd8b3bab58ff66055c61ddfdf06a", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main \n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n)\n\nfunc ReadInt32(scanner *bufio.Scanner) int {\n scanner.Scan()\n ans, _ := strconv.Atoi(scanner.Text())\n return ans\n}\n\nfunc ReadString(scanner *bufio.Scanner) string {\n scanner.Scan()\n ans := scanner.Text()\n return ans\n}\n\nfunc PrintInt(writer *bufio.Writer, value int) {\n writer.WriteString(strconv.Itoa(value))\n writer.WriteByte(' ')\n}\n\nfunc PrintInts(writer *bufio.Writer, ints ...int) {\n for _, value := range ints {\n writer.WriteString(strconv.Itoa(value))\n writer.WriteByte(' ')\n }\n writer.WriteByte('\\n')\n}\n\nfunc main() {\n var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n var writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n scanner.Split(bufio.ScanWords)\n\n n, k := ReadInt32(scanner), ReadInt32(scanner)\n hn := n / 2\n total := n * (n - 1) / 2\n\n if k >= hn {\n k = hn\n PrintInt(writer, total)\n return \n }\n PrintInts(writer, n, k, hn)\n\n total -= (n - k) * (n - k - 1) / 2\n total += k * (n - 2 * k)\n total += k * (k - 1) / 2\n\n PrintInt(writer, total)\n writer.WriteByte('\\n')\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "99f3480c8ed042649d299bd0f3800e32", "src_uid": "ea36ca0a3c336424d5b7e1b4c56947b0", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc Max(x, y int) int {\n\tif x < y {\n\t\treturn y\n\t}\n\treturn x\n}\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tuserInput, _ := in.ReadString('\\n')\n\tuserInputArray := strings.Split(userInput, \" \")\n\n\tvar n, _ = strconv.Atoi(userInputArray[0])\n\tvar t, _ = strconv.Atoi(userInputArray[1])\n\tvar k, _ = strconv.Atoi(userInputArray[2])\n\tvar d, _ = strconv.Atoi(strings.TrimRight(userInputArray[3], \"\\n\"))\n\tnumberOfTrials := (n + k - 1) / k;\n\tovenOneStart := 0\n\tovenTwoStart := d;\n\tfor i := 0; i < numberOfTrials; i++ {\n\t\tif ovenOneStart <= ovenTwoStart {\n\t\t\tovenOneStart += t\n\t\t} else {\n\t\t\tovenTwoStart += t\n\t\t}\n\t}\n\n\tif Max(ovenOneStart, ovenTwoStart) < (numberOfTrials * t) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "814635fad3b8e77e5c0810c1cec91f30", "src_uid": "32c866d3d394e269724b4930df5e4407", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst modVal = 1e9 + 7\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tvar n int64\n\tfmt.Fscan(in, &n)\n\tvar fact = int64(1)\n\tvar pow = int64(1)\n\n\tfor i := int64(1); i < n; i++ {\n\t\tfact *= i\n\t\tpow *= 2\n\n\t\tfact %= modVal\n\t\tpow %= modVal\n\t}\n\tfact *= n\n\n\tv := fact - pow\n\tv %= modVal\n\tfmt.Println(v)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "167e4c56e5c94cd5dce91a7409ec6357", "src_uid": "3dc1ee09016a25421ae371fa8005fce1", "difficulty": 1500.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc main() {\n\tio := NewFastIO(os.Stdin, os.Stdout)\n\tdefer io.Flush()\n\n\tconst mod = int64(1e9 + 7)\n\n\tn := int64(io.NextInt())\n\tp, f := (mod+1)/2, int64(1)\n\tfor i := int64(1); i <= n; i++ {\n\t\tf = f * i % mod\n\t\tp = p * 2 % mod\n\t}\n\tans := (f - p + mod) % mod\n\tio.Println(ans)\n}\n\ntype FastIO struct {\n\t*bufio.Reader\n\t*bufio.Writer\n\tc [1]byte\n}\n\nfunc NewFastIO(r io.Reader, w io.Writer) *FastIO {\n\treturn &FastIO{Reader: bufio.NewReader(r), Writer: bufio.NewWriter(w)}\n}\n\nfunc (f *FastIO) readC() byte {\n\tf.Read(f.c[:])\n\treturn f.c[0]\n}\n\nfunc (f *FastIO) NextInt() int {\n\tc := f.readC()\n\tfor ; c <= ' '; c = f.readC() {\n\t}\n\tneg := false\n\tif c == '-' {\n\t\tneg = true\n\t\tc = f.readC()\n\t}\n\tn := 0\n\tfor ; '0' <= c && c <= '9'; c = f.readC() {\n\t\tn = n*10 + int(c) - '0'\n\t}\n\tif neg {\n\t\treturn -n\n\t}\n\treturn n\n}\n\nfunc (f *FastIO) NextInts(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = f.NextInt()\n\t}\n\treturn a\n}\n\nfunc (f *FastIO) Next() string {\n\tc := f.readC()\n\tfor ; c <= ' '; c = f.readC() {\n\t}\n\tvar s []byte\n\tfor ; c > ' '; c = f.readC() {\n\t\ts = append(s, f.c[0])\n\t}\n\treturn string(s)\n}\n\nfunc (f *FastIO) Println(a ...interface{}) {\n\tfmt.Fprintln(f.Writer, a...)\n}\n\nfunc (f *FastIO) Print(a ...interface{}) {\n\tfmt.Fprint(f.Writer, a...)\n}\n\nfunc (f *FastIO) PrintInts(a ...int) {\n\tif len(a) > 0 {\n\t\tf.Print(a[0])\n\t\tfor _, x := range a[1:] {\n\t\t\tf.Print(\" \", x)\n\t\t}\n\t}\n}\n\nfunc (f *FastIO) PrintlnInts(a ...int) {\n\tf.PrintInts(a...)\n\tf.Println()\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "a4fc78295c0ef4e7737fd231542c0972", "src_uid": "3dc1ee09016a25421ae371fa8005fce1", "difficulty": 1500.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar bufin *bufio.Reader\nvar bufout *bufio.Writer\n\nfunc main() {\n\tbufin = bufio.NewReader(os.Stdin)\n\tbufout = bufio.NewWriter(os.Stdout)\n\tdefer bufout.Flush()\n\tvar n, m, k int\n\tfmt.Fscanf(bufin, \"%d %d %d\\n\", &n, &m, &k)\n\tp := 2 * m\n\tlane := (k + p - 1) / p\n\tk -= p * (lane - 1)\n\tdesk := (k + 1) / 2\n\tpos := 'L'\n\tif k%2 == 0 {\n\t\tpos = 'R'\n\t}\n\tfmt.Fprintf(bufout, \"%d %d %c\\n\", lane, desk, pos)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "48618147b1e147c5ebc99be9c213d1f4", "src_uid": "d6929926b44c2d5b1a8e6b7f965ca1bb", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"strings\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc main() {\n\tvar x string\n\tScan(&x)\n\tn := len(x)\n\tif n == 1 {\n\t\tPrint(x)\n\t\treturn\n\t}\n\tdata := []byte(x)\n\tsum := 0\n\tfor _, c := range x {\n\t\tsum += int(c - '0')\n\t}\n\tif x[1] == '9' {\n\t\tdata[1] = '8'\n\t\tx9 := strings.Repeat(\"9\", n-2)\n\t\tif newSum := int(data[0]-'0') + 8 + 9*(n-2); newSum <= sum {\n\t\t\tPrint(x)\n\t\t\treturn\n\t\t}\n\t\tPrint(string(data[0]) + \"8\" + x9)\n\t\treturn\n\t}\n\tdata[0]--\n\tx9 := strings.Repeat(\"9\", n-1)\n\tif newSum := int(data[0]-'0') + 9*(n-1); newSum <= sum {\n\t\tPrint(x)\n\t\treturn\n\t}\n\tif data[0] == '0' {\n\t\tPrint(x9)\n\t} else {\n\t\tPrint(string(data[0]) + x9)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "aca31aea5aa46a1c9cd7c6c6967a2e4e", "src_uid": "e55b0debbf33c266091e6634494356b8", "difficulty": 1300.0} {"lang": "Go", "source_code": "package main \n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n // \"fmt\"\n \"strings\"\n)\n\nfunc ReadInt32(scanner *bufio.Scanner) int {\n scanner.Scan()\n ans, _ := strconv.Atoi(scanner.Text())\n return ans\n}\n\nfunc ReadString(scanner *bufio.Scanner) string {\n scanner.Scan()\n ans := scanner.Text()\n return ans\n}\n\nfunc PrintInt(writer *bufio.Writer, value int) {\n writer.WriteString(strconv.Itoa(value))\n writer.WriteByte(' ')\n}\n\nfunc PrintInts(writer *bufio.Writer, ints ...int) {\n for _, value := range ints {\n writer.WriteString(strconv.Itoa(value))\n writer.WriteByte(' ')\n }\n writer.WriteByte('\\n')\n}\n\nfunc ReadPazzle(scanner *bufio.Scanner) string {\n r1 := ReadString(scanner)\n r2 := ReadString(scanner)\n \n return r1 + r2[1:] + r2[0:1]\n}\n\nfunc Compare(p1, p2 string) bool {\n if p1 == p2 {\n return true\n }\n p1 = p1 + p1 + p1 + p1\n return strings.Contains(p1, p2)\n}\n\nfunc Shift(p string) string {\n l := len(p)\n\n p = p[l-2:l-1] + p[0:l-1]\n return p\n}\n\nfunc main() {\n var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n var writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n scanner.Split(bufio.ScanWords)\n\n pz1 := ReadPazzle(scanner)\n pz2 := ReadPazzle(scanner)\n\n pz1 = strings.Replace(pz1, \"X\", \"\", 1)\n pz2 = strings.Replace(pz2, \"X\", \"\", 1)\n\n if Compare(pz1, pz2) {\n writer.WriteString(\"YES\")\n } else {\n writer.WriteString(\"NO\")\n }\n writer.WriteByte('\\n')\n // writer.WriteByte('\\n')\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "2fe8201f2fbd29b8c46c3b04f8e7ee48", "src_uid": "46f051f58d626587a5ec449c27407771", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n\tvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords) // \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 scanner \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u043e\u043a\u0435\u043d\u0430\u043c\u0438 \u0441\u043b\u043e\u0432\u0430, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c\u0438\n\n\tscanner.Scan()\n\ts1 := scanner.Text()\n\tscanner.Scan()\n\ts11 := scanner.Text()\n\tscanner.Scan()\n\ts2 := scanner.Text()\n\tscanner.Scan()\n\ts22 := scanner.Text()\n\n\tse := make([]byte, 0, 3)\n\tsb := make([]byte, 0, 3)\n\tfor i := 0; i < 2; i++ {\n\t\tif s1[i] != 'X' {\n\t\t\tse = append(se, s1[i])\n\t\t}\n\t\tif s2[i] != 'X' {\n\t\t\tsb = append(sb, s2[i])\n\t\t}\n\t}\n\tfor i := 1; i >= 0; i-- {\n\t\tif s11[i] != 'X' {\n\t\t\tse = append(se, s11[i])\n\t\t}\n\t\tif s22[i] != 'X' {\n\t\t\tsb = append(sb, s22[i])\n\t\t}\n\t}\n\tec := 0\n\teb := 0\n\tgse := string(se)\n\tgsb := string(sb)\n\n\tif gse == \"ABC\" || gse == \"CAB\" || gse == \"BCA\" {\n\t\tec = 1\n\t}\n\tif gsb == \"ABC\" || gsb == \"CAB\" || gsb == \"BCA\" {\n\t\teb = 1\n\t}\n\tif ec == eb {\n\t\twriter.WriteString(\"YES\")\n\t} else {\n\t\twriter.WriteString(\"NO\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "b42b270bfbaf3c6f7df0917c0904d87c", "src_uid": "46f051f58d626587a5ec449c27407771", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tn := 0\n\tfmt.Fscanf(in, \"%d\\n\", &n)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(in, \"%d\\n\", &a[i])\n\t}\n\tb := make([]int, n)\n\tfind := false\n\tfor i := 0; i < 1< b/y {\n\t\tfmt.Println(b / y)\n\t\treturn\n\t}\n\n\tfmt.Println(a / x)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "f2e3ce2b97e1fa81f08af6117dc3bc38", "src_uid": "907ac56260e84dbb6d98a271bcb2d62d", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar n, c int\n\tfmt.Scanf(\"%d%d\", &n, &c)\n\tvar prev, max int = -1000, -1000\n\tfor i := 0; i < n; i++ {\n\t\tvar x int\n\t\tfmt.Scanf(\"%d\", &x)\n\t\tif prev-x > max {\n\t\t\tmax = prev - x\n\t\t}\n\t\tprev = x\n\t}\n\tif max > c {\n\t\tmax = max - c\n\t} else {\n\t\tmax = 0\n\t}\n\tfmt.Println(max)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "f328524b9c319d1671d849877a50d74e", "src_uid": "411539a86f2e94eb6386bb65c9eb9557", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, c int\n\n\tfmt.Scan(&n, &c)\n\n\txi := make([]int, n)\n\n\tfor i := range xi {\n\t\tfmt.Scan(&xi[i])\n\t}\n\n\tmax, dif := 0, 0\n\n\tfor i:=0; i max {\n\t\t\tmax = dif\n\t\t}\n\t}\n\t\n\tif max == 0 || max <= c {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(max - c)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "f7b2402fd8915b9df57ae55c70fa818e", "src_uid": "411539a86f2e94eb6386bb65c9eb9557", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\ts := make([]string, 4)\n\tfor i := range s {\n\t\tfmt.Scanln(&s[i])\n\t}\n\tfor i := 0; i < 3; i++ {\n\t\tfor j := 0; j < 3; j++ {\n\t\t\tcnt := 0\n\t\t\tif s[i][j] == '.' {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t\tif s[i+1][j] == '.' {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t\tif s[i][j+1] == '.' {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t\tif s[i+1][j+1] == '.' {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t\tif cnt != 2 {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "9737f05f71b655051631c84d6ae84e90", "src_uid": "01b145e798bbdf0ca2ecc383676d79f3", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc check(x [4]string, a int, b int) bool {\n cnt := 0\n for i := a; i < (a+2); i++ {\n for j := b; j < (b+2); j++ {\n if x[i][j] != x[a][b] { cnt++ }\n }\n }\n if cnt <= 1 { return true } else { return false }\n}\n\nfunc main() {\n var x [4]string\n for i := 0; i < 4; i++ {\n fmt.Scan(&x[i])\n }\n ans := false\n for i := 0; i < 3; i++ {\n for j := 0; j < 3; j++ {\n if check(x,i,j) {\n ans = true\n break\n }\n }\n }\n if ans { fmt.Println(\"YES\") } else { fmt.Println(\"NO\") }\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "0db27bd0eb1d72507417c0f580decaf3", "src_uid": "01b145e798bbdf0ca2ecc383676d79f3", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i interface{}, delim string) error {\n\t_, err := fmt.Fscanf(r, \"%v\"+delim, i)\n\treturn err\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.txt\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tvar n int\n\tfor I(&n, \" \") == nil {\n\t\tsolve(n)\n\t}\n}\n\nfunc solve(n int) {\n\tvar m int\n\tI(&m, \"\\n\")\n\tmm := map[int]int{\n\t\t1: 31,\n\t\t2: 28,\n\t\t3: 31,\n\t\t4: 30,\n\t\t5: 31,\n\t\t6: 30,\n\t\t7: 31,\n\t\t8: 31,\n\t\t9: 30,\n\t\t10: 31,\n\t\t11: 30,\n\t\t12: 31,\n\t}\n\tans := (mm[n] + m - 1) / 7\n\tif (mm[n]+m-1)%7 != 0 {\n\t\tans++\n\t}\n\tO(ans, \"\\n\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "6e0190993506aba48527a80e3509d382", "src_uid": "5b969b6f564df6f71e23d4adfb2ded74", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n m := make(map[rune]int)\n m['>'], m['<'], m['+'], m['-'], m['.'], m[','], m['['], m[']'] = 8, 9, 10, 11, 12, 13, 14, 15\n var p string\n fmt.Scan(&p)\n ans := 0\n for _, v := range p {\n ans = (ans*16)%1000003\n ans = (ans+m[v])%1000003\n }\n fmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "0e1dfcb788b5d446ef25b044afbf1a22", "src_uid": "04fc8dfb856056f35d296402ad1b2da1", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nvar sharp = \"#\"[0]\n\n// Start from the top-left point, the only point that we can not paint is [1, 1]\nvar penDirs = [8][2]int{\n\t[2]int{0, 0},\n\t[2]int{0, 1},\n\t[2]int{0, 2},\n\t[2]int{1, 0},\n\t[2]int{1, 2},\n\t[2]int{2, 0},\n\t[2]int{2, 1},\n\t[2]int{2, 2},\n}\n\nfunc main() {\n\tr, c := 0, 0\n\tfmt.Scan(&r, &c)\n\tp := make([][]int, r)\n\tfor i := 0; i < r; i++ {\n\t\tl := \"\"\n\t\tfmt.Scan(&l)\n\t\tp[i] = make([]int, c)\n\t\tfor j := 0; j < len(l); j++ {\n\t\t\tif l[j] == sharp {\n\t\t\t\tp[i][j] = 1\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < (r - 2); i++ {\n\t\tfor j := 0; j < (c - 2); j++ {\n\t\t\tusePen := true\n\t\t\tfor _, v := range penDirs {\n\t\t\t\tif p[i+v[0]][j+v[1]] == 0 {\n\t\t\t\t\tusePen = false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !usePen {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor _, v := range penDirs {\n\t\t\t\tp[i+v[0]][j+v[1]] = 2\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < r; i++ {\n\t\tfor j := 0; j < c; j++ {\n\t\t\tif p[i][j] == 1 {\n\t\t\t\tfmt.Println(\"NO\")\n\t\t\t\tos.Exit(0)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"YES\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "bc51b25565a22010429f309f885e3930", "src_uid": "49e5eabe8d69b3d27a251cccc001ab25", "difficulty": 1300.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc check(px, py, x, y, a, b, n, m int) int {\n var anw = 100000000\n var tx = px - x; if(tx < 0) { tx = -tx;}\n var ty = py - y; if(ty < 0) { ty = -ty;}\n if(tx == 0 && ty == 0) {\n return 0;\n }\n if(x+a > n && x-a < 1) {\n return anw;\n }\n if(y+b > m && y-b < 1) {\n return anw;\n }\n if(tx%a != 0 || ty%b != 0) {\n return anw;\n }\n if(tx/a%2 == ty/b%2) {\n //fmt.Println(px, py, x, y, a, b, tx/a, ty/b);\n if(tx/a < ty/b) {\n return ty/b;\n }\n return tx/a;\n } else {\n return anw;\n }\n return anw;\n}\n\nfunc main() {\n var n, m, x, y, a, b int\n fmt.Scanf(\"%d %d %d %d %d %d\", &n, &m, &x, &y, &a, &b);\n var tmp int\n var anw = -1;\n tmp = check(n, 1, x, y, a, b, n, m);\n //fmt.Println(tmp);\n if anw == -1 || tmp < anw {\n anw = tmp;\n }\n tmp = check(1, m, x, y, a, b, n, m);\n //fmt.Println(tmp);\n if anw == -1 || tmp < anw {\n anw = tmp;\n }\n tmp = check(n, m, x, y, a, b, n, m);\n //fmt.Println(tmp);\n if anw == -1 || tmp < anw {\n anw = tmp;\n }\n tmp = check(1, 1, x, y, a, b, n, m);\n //fmt.Println(tmp);\n if anw == -1 || tmp < anw {\n anw = tmp;\n }\n if anw != -1 && anw != 100000000{\n fmt.Println(anw)\n } else {\n fmt.Println(\"Poor Inna and pony!\")\n }\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "717c4bf1dbcaa499a34d5964f9a533e4", "src_uid": "51155e9bfa90e0ff29d049cedc3e1862", "difficulty": 2000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner *bufio.Scanner\nvar t [1e6 + 1]bool\n\nfunc init_scanner() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024 * 20\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tscanner.Scan()\n\tval, _ := strconv.Atoi(scanner.Text())\n\treturn val\n}\n\nfunc is_prime(x int) bool {\n\tfor i := 2; i*i <= x; i++ {\n\t\tif x%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc divides(x int, s []int) bool {\n\tfor _, i := range s {\n\t\tif x%i == 0 {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tinit_scanner()\n\tp, y := readInt(), readInt()\n\n\tvar s []int\n\tfor i := 2; i <= int(math.Min(float64(p), math.Floor(math.Sqrt(float64(y))))); i++ {\n\t\tif is_prime(i) {\n\t\t\ts = append(s, i)\n\t\t}\n\t}\n\n\tans := -1\n\tfor i := y; i > int(math.Max(float64(p), float64(y-100000))); i-- {\n\t\tif !divides(i, s) {\n\t\t\tans = i\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "37c89af3998377900f85a7c0ce4991e7", "src_uid": "b533203f488fa4caf105f3f46dd5844d", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar num int\n\nfunc main() {\n fmt.Scan(&num)\n cvs := make([]int, num)\n var tmp int\n count := 0\n for i := 0; i < num; i++ {\n fmt.Scan(&tmp)\n cvs[i] = tmp\n if tmp == 1 {\n count++\n }\n }\n ans := count\n zeros := 0\n for _, val := range cvs {\n if val == 0 {\n zeros++\n } else {\n count--\n }\n res := count + zeros\n if res > ans {\n ans = res\n }\n }\n fmt.Println(ans)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "332d9d4435a592f9a56a5120c0a0b335", "src_uid": "c7b1f0b40e310f99936d1c33e4816b95", "difficulty": 1500.0} {"lang": "Go", "source_code": "\npackage main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\nvar stdin *bufio.Reader\nvar stdout *bufio.Writer\n\nfunc init() {\n\tstdin = bufio.NewReader(os.Stdin)\n stdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc check(grid [][]int, row1, row2, col1, col2 int) int {\n\tcount := 0\n\tfor i := row1; i <= row2; i++ {\n\t\tfor j := col1; j <= col2; j++ {\n\t\t\tcount += grid[i][j]\n\t\t}\n\t}\n\treturn count\n}\n\nfunc main() {\n\n\tr, c, n, k := 0, 0, 0, 0\n\tfmt.Fscanf(stdin, \"%d%d%d%d\\n\", &r, &c, &n, &k)\n\t\n\tgrid := make([][]int, r)\n\tfor i := 0; i < r; i++ {\n\t\tgrid[i] = make([]int, c)\n\t}\n\t\n\tfor i := 0; i < n; i++ {\n\t\tx, y := 0, 0\n\t\tfmt.Fscanf(stdin, \"%d%d\\n\", &x, &y)\n\t\tgrid[x - 1][y - 1] = 1;\n\t}\n\t\n\tcount := 0\n\t\n\tfor r1 := 0; r1 < r; r1++ {\n\t\tfor r2 := r1; r2 < r; r2++ {\n\t\t\tfor c1 := 0; c1 < c; c1++ {\n\t\t\t\tfor c2 := c1; c2 < c; c2++ {\n\t\t\t\t\tif check(grid, r1, r2, c1, c2) >= k {\n\t\t\t\t\t\tcount++\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t}\n\t\n\n\tfmt.Fprintf(stdout, \"%d\\n\", count)\n\n stdout.Flush()\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "6b86628ff811f4c1d751a78c5d5097ce", "src_uid": "9c766881f6415e2f53fb43b61f8f40b4", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tscanInt := func() int {\n\t\tscanner.Scan()\n\t\tnum, err := strconv.Atoi(scanner.Text())\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\treturn num\n\t}\n\n\tn, index := scanInt(), scanInt()-1\n\tc := make([]bool, n)\n\tfor i := 0; i < n; i++ {\n\t\tc[i] = scanInt() == 1\n\t}\n\n\ttotal := 0\n\tif c[index] {\n\t\ttotal = 1\n\t}\n\tfor i := 1; i < 100; i++ {\n\t\tl, r := index-i, index+i\n\t\tif (l < 0) && (r >= n) {\n\t\t\tbreak\n\t\t}\n\t\tif (l >= 0) && (r < n) && c[l] && c[r] {\n\t\t\ttotal += 2\n\t\t}\n\t\tif (l >= 0) && (r >= n) && c[l] {\n\t\t\ttotal++\n\t\t}\n\t\tif (l < 0) && (r < n) && c[r] {\n\t\t\ttotal++\n\t\t}\n\t}\n\tfmt.Println(total)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "1c76bd5e0ce518b4d3e40bb18c660ffa", "src_uid": "4840d571d4ce6e1096bb678b6c100ae5", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tN, K := sc.NextInt(), sc.NextInt()\n\n\tDiv2 := 0\n\tDiv5 := 0\n\ttmp := N\n\tfor tmp%2 == 0 {\n\t\ttmp /= 2\n\t\tDiv2++\n\t}\n\n\tfor tmp%5 == 0 {\n\t\ttmp /= 5\n\t\tDiv5++\n\t}\n\tfor i := 0; i < K-Div2; i++ {\n\t\tN *= 2\n\t}\n\tfor i := 0; i < K-Div5; i++ {\n\t\tN *= 5\n\n\t}\n\n\tfmt.Println(N)\n\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "5d8680666a34c43fa68cc9ca73f6dba8", "src_uid": "73566d4d9f20f7bbf71bc06bc9a4e9f3", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n int\n\tif _, err := fmt.Scanf(\"%d\\n\", &n); err != nil {\n\t\treturn\n\t}\n\n\ta := make([]int, n)\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tfor i := 0; i < n && scanner.Scan(); i++ {\n\t\t_a, err := strconv.Atoi(scanner.Text())\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\ta[i] = _a\n\t}\n\n\tbubble_sort(a, n)\n\n\tlength := int64(a[0])\n\tfor i := 1; i < n; i++ {\n\t\tif a[i] <= 0 {\n\t\t\tbreak\n\t\t}\n\t\tif a[i] >= a[i-1] {\n\t\t\ta[i] = a[i-1] - 1\n\t\t}\n\t\tlength += int64(a[i])\n\t}\n\tfmt.Println(length)\n}\n\nfunc swap(a, b int, array []int) {\n\tarray[a], array[b] = array[b], array[a]\n}\n\nfunc bubble_sort(array []int, length int) {\n\tfor i := 0; i < length; i++ {\n\t\tfor j := 0; j < length; j++ {\n\t\t\tif array[i] > array[j] {\n\t\t\t\tswap(i, j, array)\n\t\t\t}\n\t\t}\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "6edfc2521dca5c67dee73f1e3408f9b8", "src_uid": "3c4b2d1c9440515bc3002eddd2b89f6f", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar b, res int64\n\tfmt.Scan(&b)\n\tfor i := int64(1); i <= b; i++ {\n\t\tif b%i == 0 {\n\n\t\t\tres++\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "af49b6288bce4caf2424eb96f41889a8", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar reader SReader\nvar helper SHelper\n\nfunc main() {\n\treader.Init()\n\tn := reader.ReadInt()\n\ta := reader.ReadInt()\n\tb := reader.ReadInt()\n\n\ta2 := helper.Max(a, b)\n\tb2 := helper.Min(a, b)\n\n\tfor x := Int(0); x <= n / a2; x++ {\n\t\ty := (n - x * a2) / b2\n\t\tif (x * a2 + y * b2) == n {\n\t\t\tfmt.Println(\"YES\")\n\t\t\tif a > b {\n\t\t\t\tfmt.Println(x, y)\n\t\t\t} else {\n\t\t\t\tfmt.Println(y, x)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"NO\")\n}\n\n// type\ntype Int int32\ntype Uint uint32\n\n// reader\ntype SReader struct {\n\tfile *os.File\n\tscanner *bufio.Scanner\n}\n\nfunc (this *SReader) Init() {\n\tthis.file = os.Stdin\n\tthis.scanner = bufio.NewScanner(this.file)\n\tthis.scanner.Split(bufio.ScanWords)\n}\n\nfunc (this *SReader) ReadInt() Int {\n\tthis.scanner.Scan()\n\tn, err:= strconv.ParseInt(this.scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn Int(n)\n}\n\n// min/max\ntype SHelper struct {}\n\nfunc (*SHelper) Max(a, b Int) Int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc (*SHelper) Min(a, b Int) Int {\n\tif a < b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "f4e632090edb11c9d7a303ee94153b55", "src_uid": "b031daf3b980e03218167f40f39e7b01", "difficulty": 1100.0} {"lang": "Go", "source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/735/D\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tn int64\n)\n\nfunc main() {\n\tn = ReadInt64()\n\n\tif IsPrime(n) {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\n\tif n%2 == 0 {\n\t\tfmt.Println(2)\n\t\treturn\n\t}\n\n\tif IsPrime(n - 2) {\n\t\tfmt.Println(2)\n\t\treturn\n\t}\n\n\tfmt.Println(3)\n}\n\n// func main() {\n// \tn = readInt64()\n\n// \t// ans := 0\n// \tA := []int64{}\n// \tfor {\n// \t\t// ans++\n// \t\tif IsPrime(n) {\n// \t\t\tA = append(A, n)\n// \t\t\tbreak\n// \t\t}\n\n// \t\tp := sub(n - 2)\n// \t\tn -= p\n// \t\tA = append(A, p)\n// \t}\n// \t// fmt.Println(ans)\n// \tfmt.Println(len(A))\n// }\n\n// n\u4ee5\u4e0b\u306e\u6700\u5927\u306e\u7d20\u6570\u3092\u8fd4\u3059\nfunc sub(n int64) int64 {\n\tfor i := n; i >= 2; i-- {\n\t\tif IsPrime(i) {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn 1\n}\n\n// IsPrime judges whether an argument integer is a prime number or not.\nfunc IsPrime(n int64) bool {\n\tvar i int64\n\n\tif n == 1 {\n\t\treturn false\n\t}\n\n\tfor i = 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "7bae5170c7e0ac02ac608fceee4fd93c", "src_uid": "684ce84149d6a5f4776ecd1ea6cb455b", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nvar n, m, a, b int\n\nfunc min(a, b int) int {\n if a < b {\n return a\n } else {\n return b\n }\n}\n\nfunc main() {\n fmt.Scan(&n, &m, &a, &b)\n if n % m == 0 {\n fmt.Println(\"0\")\n } else {\n c := n / m\n ans := min((c * m + m - n) * a, (n - c * m) * b)\n fmt.Println(ans)\n }\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "078e9829c70b2049a1429706702c1d99", "src_uid": "c05d753b35545176ad468b99ff13aa39", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"math/bits\"\n\t\"os\"\n)\n\nfunc solve(n, x uint64) uint64 {\n\tif x > n {\n\t\treturn 0\n\t}\n\n\tres := uint64(1)\n\tif x % 2 == 0 {\n\t\tres += solve(n, x + 1)\n\t}\n\n\txlen := uint(bits.Len64(x))\n\tnlen := uint(bits.Len64(n))\n\n\tnx := x << (nlen - xlen)\n\n\tif nlen > xlen {\n\t\tres += (uint64(1) << (nlen - xlen)) - 2\n\t}\n\n\tif nx <= n && nlen > xlen {\n\t\tif n >> (nlen - xlen) == x {\n\t\t\tres += n - nx + 1\n\t\t} else {\n\t\t\tres += uint64(1) << (nlen - xlen)\n\t\t}\n\t}\n\n\treturn res\n}\n\nfunc solveStupid(n, x uint64) uint64 {\n\tif x > n {\n\t\treturn 0\n\t}\n\n\tres := uint64(1)\n\tif x % 2 == 0 {\n\t\tres += solveStupid(n, x + 1)\n\t}\n\tres += solveStupid(n, x * 2)\n\n\treturn res\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\n\tn, k := uint64(NextInt64()), uint64(NextInt64())\n\n\tx := uint64(1)\n\tl := uint(0)\n\tfor ; solve(n, x * 2) >= k; x *= 2 {\n\t\tl++\n\t}\n\n\tfor i := uint(0); i < l; i++ {\n\t\tif solve(n, x + (uint64(1) << (l - i - 1))) >= k {\n\t\t\tx += uint64(1) << (l - i - 1)\n\t\t}\n\t}\n\n\tprintln(x)\n}\n\nvar reader *bufio.Reader\nvar writer *bufio.Writer\n\nvar inputFile = flag.String(\"input\", \"\", \"\")\n\nfunc init() {\n\tflag.Parse()\n\tvar i io.Reader\n\tif *inputFile != \"\" {\n\t\ti, _ = os.Open(*inputFile)\n\t} else {\n\t\ti = os.Stdin\n\t}\n\treader = bufio.NewReaderSize(i, 1<<20)\n\twriter = bufio.NewWriterSize(os.Stdout, 1<<20)\n}\n\nfunc println(a ...interface{}) {\n\t_, _ = fmt.Fprintln(writer, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\t_, _ = fmt.Fprintf(writer, format, a...)\n}\n\nfunc scanf(format string, a ...interface{}) {\n\t_, _ = fmt.Fscanf(reader, format, a...)\n}\n\nfunc scan(a interface{}) {\n\t_, _ = fmt.Fscan(reader, a)\n}\n\nfunc NextInt64() int64 {\n\tvar res int64\n\tscan(&res)\n\treturn res\n}\n\nfunc NextInt() int {\n\tvar res int\n\tscan(&res)\n\treturn res\n}\n\nfunc NextIntArray(n int) []int {\n\tres := make([]int, n)\n\tfor i := range res {\n\t\tscan(&res[i])\n\t}\n\treturn res\n}\n\nfunc NextInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tscan(&res[i])\n\t}\n\treturn res\n}\n\nfunc NextString() string {\n\tvar res string\n\tscan(&res)\n\treturn res\n}\n\nfunc NextBigInt() *big.Int {\n\tn := new(big.Int)\n\tn, _ = n.SetString(NextString(), 10)\n\treturn n\n}\n\nfunc AbsInt64(x int64) int64 {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc MinInt64(x, y int64) int64 {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc MaxInt64(x, y int64) int64 {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc MaxInt(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "0bf5918a56fae21d40d48aebde18177e", "src_uid": "783c4b3179c558369f94f4a16ac562d4", "difficulty": 2100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tw := bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\n\tvar n int\n\tfmt.Fscan(r, &n)\n\tfmt.Fprintln(w, 2*n + 1)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "735b942676636c268ad376d8b363b2f0", "src_uid": "d0a8604b78ba19ab769fd1ec90a72e4e", "difficulty": 1500.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\n\n\n\n\nfunc main() {\n\tsdeck := make([]string, 8)\n\tfor i := 0; i < 8; i++{\n\t\tfmt.Scan(&sdeck[i])\n\t}\n\tvar deck [8][8]int\n\tcount := 0\n\tfor i, s := range sdeck{\n\t\tfor j, c := range s{\n\t\t\tif c == 'B'{\n\t\t\t\tdeck[i][j] = 1\n\t\t\t}else{\n\t\t\t\tdeck[i][j] = 0\n\t\t\t}\n\t\t}\n\t}\n\tfor i := 0; i < 8; i++{\n\t\tsum := 0\n\t\tfor j := 0; j < 8; j++ {\n\t\t\tif deck[i][j] == 1{\n\t\t\t\tsum++\n\t\t\t}\n\t\t}\n\t\tif sum == 8 {\n\t\t\tcount++\n\t\t}\n\t}\n\tfor i := 0; i < 8; i++{\n\t\tif count == 8{\n\t\t\tbreak\n\t\t}\n\t\tsum := 0\n\t\tfor j := 0; j < 8; j++ {\n\t\t\tif deck[j][i] == 1{\n\t\t\t\tsum++\n\t\t\t}\n\t\t}\n\t\tif sum == 8 {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Print(count)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "5d9dec4fb7fe20a59b4a2676b7dbb9c1", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nvar mod int64 = 1000000007\n\nfunc main() {\n var n, m, k int64\n fmt.Scan(&n)\n fmt.Scan(&m)\n fmt.Scan(&k)\n if k > n {\n fmt.Println(pow(m, n))\n } else if k == n {\n fmt.Println(pow(m, (n + 1) / 2))\n } else if k == 1 {\n fmt.Println(pow(m, n))\n } else if k % 2 == 0 {\n fmt.Println(m)\n } else if k % 1 == 0 {\n fmt.Println(pow(m, 2))\n }\n return\n}\n\nfunc pow(a, b int64) int64 {\n var ans int64 = 1\n for; b > 0; b-- {\n ans = ans * a % mod\n }\n return ans\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "512fab04808fbb94a460470dfc8696c5", "src_uid": "1f9107e8d1d8aebb1f4a1707a6cdeb6d", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF978G(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\ttype pair struct{ i, d int }\n\n\tvar n, m, s, d int\n\tFscan(in, &n, &m)\n\tpr := make([]int, m)\n\ttodo := make([][]pair, n+1)\n\thas := make([]bool, n+1)\n\tfor i := range pr {\n\t\tFscan(in, &s, &d, &pr[i])\n\t\tfor j := s; j < d; j++ {\n\t\t\ttodo[j] = append(todo[j], pair{i, d})\n\t\t}\n\t\tif has[d] {\n\t\t\tFprint(out, -1)\n\t\t\treturn\n\t\t}\n\t\thas[d] = true\n\t}\n\tvar ans []interface{}\no:\n\tfor i := 1; i <= n; i++ {\n\t\tif has[i] {\n\t\t\tans = append(ans, m+1)\n\t\t\tcontinue\n\t\t}\n\t\tsort.Slice(todo[i], func(j, k int) bool { return todo[i][j].d < todo[i][k].d })\n\t\tfor _, p := range todo[i] {\n\t\t\tif pr[p.i] > 0 {\n\t\t\t\tpr[p.i]--\n\t\t\t\tans = append(ans, p.i+1)\n\t\t\t\tcontinue o\n\t\t\t}\n\t\t}\n\t\tans = append(ans, 0)\n\t}\n\tfor _, left := range pr {\n\t\tif left > 0 {\n\t\t\tFprint(out, -1)\n\t\t\treturn\n\t\t}\n\t}\n\tFprint(out, ans...)\n}\n\nfunc main() { CF978G(os.Stdin, os.Stdout) }\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "4c00a8d60cf4df243cbe7ad7add97a2b", "src_uid": "02d8d403eb60ae77756ff96f71b662d3", "difficulty": 1700.0}