{"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 ans 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}\n\tfmt.Println(ans)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "c385a9ce66c7a7d6ca6c762ad27a9147", "src_uid": "41e554bc323857be7b8483ee358a35e2", "difficulty": 800.0} {"lang": "Go", "source_code": "package \"main\"\n\nimport \"fmt\"\n\nfunc main() {\n var n,k int\n fmt.Scanf(\"%d%d\", &n, &k)\n for i := 1; i <= n; i++ {\n if 5 * i * (i + 1) / 2 + k > 240 {\n fmt.Println(i - 1)\n return\n }\n }\n fmt.Println(n)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "c0468ab1e59f2c309dfd2646fd9e0023", "src_uid": "41e554bc323857be7b8483ee358a35e2", "difficulty": 800.0} {"lang": "Go", "source_code": "package \"main\"\n\nimport \"fmt\"\n\nfunc main() {\n var n,k int\n fmt.Scanf(\"%d%d\", &n, &k)\n for i := 0; i < n; i++ {\n if 5 * i * (i + 1) / 2 + k > 360 {\n fmt.Println(i)\n return\n }\n }\n fmt.Println(n)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "41c1e83ed69fcbc593cdc56fc4eed815", "src_uid": "41e554bc323857be7b8483ee358a35e2", "difficulty": 800.0} {"lang": "Go", "source_code": "package \"main\"\n\nimport \"fmt\"\n\nfunc main() {\n var n,k int\n fmt.Scanf(\"%d%d\", &n, &k)\n for i := 0; i < n; i++ {\n if (5 * i * (i + 1) / 2 + k > 360) {\n fmt.Println(i)\n return\n }\n }\n fmt.Println(n)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "2de5521bbbcfd020ebef0a06818b2003", "src_uid": "41e554bc323857be7b8483ee358a35e2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n)\n\nfunc solve() {\n n, k := readInt(), readInt()\n cur := 4*60-k\n ans := 0\n for i := 1; i <= n; i++ {\n cur -= 5*i\n if cur >= 0 {\n ans++\n }\n }\n fmt.Println(ans)\n}\n\n// Helpers\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n const MaxTokenLength = 1024 * 1024\n scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n scanner.Split(bufio.ScanWords)\n solve()\n}\n\n// Helpers\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// Math\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\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\n// Sort\n\ntype Ints64 []int64\n\nfunc (a Ints64) Len() int { return len(a) }\nfunc (a Ints64) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a Ints64) Less(i, j int) bool { return a[i] < a[j] }\n\n/* Sort tempalte\nfunc (a ) Len() int { return len(a) }\nfunc (a ) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a ) Less(i, j int) bool { return }\n*/", "lang_cluster": "Go", "compilation_error": true, "code_uid": "57b9b4973761fcab547ef11f8680f123", "src_uid": "41e554bc323857be7b8483ee358a35e2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc solve339a() {\n\t// digits can only be {1,2,3}\n\t// input is <= 100 characters\n\t// no spaces\n\t// digit and/or plus sign\n\t// could be a single character(digit)\n\n\t// if we use sorting in stdlib, then parse by \"+\", sort, and join with \"+\"\n\n\t// if we implement sorting, a good constraint is that numbers are {1,2,3}.\n\n\t// count 1, 2 and 3 digits in a map(nah just variables)\n\t// create a string with \"+\" between each counted digit if sum of count > 1\n\t// else just print\n\n\tequation := \"\"\n\tfmt.Scan(&equation)\n\n\tone := 0\n\ttwo := 0\n\tthree := 0\n\n\tfor _, c := range equation {\n\t\tswitch c {\n\t\tcase '1':\n\t\t\tone++\n\t\tcase '2':\n\t\t\ttwo++\n\t\tcase '3':\n\t\t\tthree++\n\t\t}\n\t}\n\n\tif one+two+three <= 1 {\n\t\tfmt.Println(equation)\n\t} else {\n\t\tresult := \"\"\n\t\tresult = appendNumber(result, one, 1)\n\t\tresult = appendNumber(result, two, 2)\n\t\tresult = appendNumber(result, three, 3)\n\t\tresult = result[:len(result)-1]\n\t\tfmt.Println(result)\n\t}\n}\n\nfunc appendNumber(result string, count, num int) string {\n\tfor count > 0 {\n\t\tresult += fmt.Sprintf(\"%d+\", num)\n\t\tcount--\n\t}\n\treturn result\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "8f3ddc63ab1b26b42c8dab6a03643f8a", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"math/rand\"\n\t\"sort\"\n\t\"sync\"\n)\n\nconst MAX = 3\n\nfunc Sort(A []int, N int) []int {\n\tq := len(A) / N\n\tr := len(A) % N\n\tsplits := make([][]int, N)\n\tpos := 0\n\tfor i := 0; i < N; i++ {\n\t\tvar delta int\n\t\tif i < r {\n\t\t\tdelta = q + 1;\n\t\t} else {\n\t\t\tdelta = q;\n\t\t}\n\t\tsplits[i] = A[pos : pos + delta]\n\t\tpos += delta\n\t}\n\twaitGroup := new(sync.WaitGroup)\n\tfor i := 0; i < N; i++ {\n\t\twaitGroup.Add(1)\n\t\tgo func(B []int) {\n\t\t\tsort.Ints(B)\n\t\t\twaitGroup.Done()\n\t\t}(splits[i])\n\t}\n\twaitGroup.Wait()\n\tB := make([]int, 0);\n\tnext := make([]int, N)\n\tfor len(B) < len(A) {\n\t\tidx := -1\n\t\tfor i := 0; i < N; i++ {\n\t\t\tif next[i] < len(splits[i]) && (idx == -1 || splits[i][next[i]] < splits[idx][next[idx]]) {\n\t\t\t\tidx = i\n\t\t\t}\n\t\t}\n\t\tB = append(B, splits[idx][next[idx]])\n\t\tnext[idx]++\n\t}\n\treturn B\n}\n\nfunc main() {\n\tvar input string\n\tfmt.Scanln(&input)\n\tdigits := strings.Split(input, \"+\")\n\tints := make([]int, 0)\n\tfor i := 0; i < len(digits); i++ {\n\t\tints = append(ints, int(digits[i][0]) - '0')\n\t}\n\tN := rand.Intn(len(A)) + 1\n\tints = Sort(ints, N)\n\tfor i := 0; i < len(ints); i++ {\n\t\tif i > 0 {\n\t\t\tfmt.Print(\"+\")\n\t\t}\n\t\tfmt.Print(ints[i])\n\t}\n\tfmt.Println()\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "055e9d9dea93cea69e9c3e62e8f3c409", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int64\n fmt.Scanf(\"%d\", &n)\n r := int64(0)\n for i := 2; i < n/2; i+=2 {\n r += 1 \n }\n fmt.Println(r)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "f37c19980e4d6488456e2543a907a101", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "difficulty": 1000.0} {"lang": "Go", "source_code": "func main() {\n\tvar (\n\t\tn, m, a int\n\t)\n\tfmt.Scanln(&n, &m, &a)\n\tif n % a != 0 {\n\t\tn = ((n / a) + 1)\n\t}\n\tif m % a != 0 {\n\t\tm = ((m / a) + 1)\n\t}\n\tfmt.Println(n*m)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "781e77b0e87cec94106b2614e9617b9c", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var n, m , a, ndiva, mdiva float64\n\n fmt.Scanf(\"%f %f %f\", &n, &m, &a)\n\n/*\n if n % a == 0 {\n ndiva = n / a\n } else {\n ndiva = n / a + 1\n }\n\n if m % a == 0 {\n mdiva = m / a\n } else {\n mdiva = m / a + 1\n }\n*/\n\n fmt.Println(math.Ceil(n / a) * math.Ceil(m / a))\n\n //fmt.Println(ndiva * mdiva)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "653d0c2a5cd016158413a557bc3423b4", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "func main() {\n var a int\n var m int\n var n int\n fmt.Scanf(\"%d %d %d\", &m, &n, &a)\n // fmt.Println(\"m:\",m)\n // fmt.Println(\"n:\",n)\n // fmt.Println(\"a:\",a)\n m = m/a\n n = n/a\n // m = int(float32(m/a) + 0.5)\n // n = int(float32(n/a) + 0.5)\n if m%a!=0 || m==0 {m++}\n if n%a!=0 || n==0 {n++}\n // fmt.Println(m)\n // fmt.Println(n)\n // fmt.Println(m*n)\n // fmt.Println(\"m:\",m)\n // fmt.Println(\"n:\",n)\n fmt.Println(m*n)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "595b7d6ceddf673e90c8c5789f398cc8", "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 float64\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\tsquare_volume := n * m\n\tflagstone_volume := a * a\n\n\tif flagstone_volume >= square_volume {\n\t\ta_in_n_and_m = 1\n\t}\n\n\tfmt.Println(a_in_n_and_m)\n\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "0e754c95c06e03874c0344a0ce45300f", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"fmt\"\n\t\"time\"\n\t\"log\"\n\t\"math\"\n)\n\n////////////////////////////////////////////////////////////////////////////////\n\n// INPUT TEMPLATE START\n\ntype MyInput struct {\n\trdr io.Reader\n\tlineChan chan string\n\tinitialized bool\n}\n\nfunc (mi *MyInput) start(done chan struct{}) {\n\tr := bufio.NewReader(mi.rdr)\n\tdefer func() {\n\t\tclose(mi.lineChan)\n\t}()\n\tfor {\n\t\tline, err := r.ReadString('\\n')\n\t\tif !mi.initialized {\n\t\t\tmi.initialized = true\n\t\t\tdone <- struct{}{}\n\t\t}\n\t\tmi.lineChan <- strings.TrimSpace(line)\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n}\n\nfunc (mi *MyInput) readLine() string {\n\t// if this is the first call, initialize\n\tif !mi.initialized {\n\t\tmi.lineChan = make(chan string)\n\t\tdone := make(chan struct{})\n\t\tgo mi.start(done)\n\t\t<-done\n\t}\n\n\tres, ok := <-mi.lineChan\n\tif !ok {\n\t\tpanic(\"trying to read from a closed channel\")\n\t}\n\treturn res\n}\n\nfunc (mi *MyInput) readInt() int {\n\tline := mi.readLine()\n\ti, err := strconv.Atoi(line)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (mi *MyInput) readInt64() int64 {\n\tline := mi.readLine()\n\ti, err := strconv.ParseInt(line, 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (mi *MyInput) readInts() []int {\n\tline := mi.readLine()\n\tparts := strings.Split(line, \" \")\n\tres := []int{}\n\tfor _, s := range parts {\n\t\ttmp, err := strconv.Atoi(s)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tres = append(res, tmp)\n\t}\n\treturn res\n}\n\nfunc (mi *MyInput) readInt64s() []int64 {\n\tline := mi.readLine()\n\tparts := strings.Split(line, \" \")\n\tres := []int64{}\n\tfor _, s := range parts {\n\t\ttmp, err := strconv.ParseInt(s, 10, 64)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tres = append(res, tmp)\n\t}\n\treturn res\n}\n\nfunc (mi *MyInput) readWords() []string {\n\tline := mi.readLine()\n\treturn strings.Split(line, \" \")\n}\n\n// INPUT TEMPLATE END\n\n////////////////////////////////////////////////////////////////////////////////\n\nfunc main() {\n\t/*tn := time.Now()\n\tsolve([]int64{6, 6, 4})\n\tlog.Println(time.Since(tn))\n\treturn*/\n\tmi := MyInput{rdr: os.Stdin}\n\tsolve(mi.readInt64s())\n\t/*\n\tfor caseNo := 1; caseNo <= t; caseNo++ {\n\t\t//solve(mi.readLine())\n\t\tfmt.Printf(\"Case #%d: %v\\n\", caseNo)\n\t}\n\t*/\n}\n\nfunc solve(args []int64) {\n\tw:=args[0]\n\th:=args[1]\n\tp:=args[2]\n\twc:=math.Ceil(float64(w)/float64(p))\n\thc:=math.Ceil(float64(h)/float64(p))\n\n\tfmt.Println(int(wc*hc))\n\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "58fea6f4f773942207cc5af37a57f020", "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.NextInt(), s.NextInt(), s.NextInt()\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\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": "d1c319a1f7fbde6a3fe1512fff634c8c", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, m, a uint64\n\tfmt.Scan(&n, &m, &a)\n\tfmt.Println(math.Ceil(n/a) * math.Ceil(m/a))\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "0bee19f3313d04cc636fad7d66a85053", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main \nimport \"fmt\"\n\nfunc main (){\n var m,n,a int\n fmt.scanln(&m,&n,&a)\n fmt.print(((m+a-1)/a)*((n+a-1)/a))\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "953ffca3656a34489ee4b456a5726e8c", "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 + int64(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": "bc1565802ab6457bf678766e7e218ee4", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n var n,m,a int \n fmt.Scan(&n,&m,&a)\n var tiles1,tiles2 uint = n/a, m/a\n \n if(n%a!=0) {tiles1++}\n if(m%a!=0) {tiles2++}\n \n var hasil uint = tiles1 * tiles2\n fmt.Println(hasil)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "bca09358ad32e397da63d8722f33d502", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n \nimport (\n \"fmt\"\n)\n \nfunc main(){\n var i, j, k int\n fmt.Scanf(\"%d %d %d\\n\", &i, &j, &k)\n var int n = i/k\n var int m = j/k\n if n%k!=0{\n n++\n }\n if m%k!=0{\n m++\n }\n fmt.Println(n*m)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "36fde5095c42e5db0bc3c920e82e2aba", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main () {\n\tvar a, b, c int32\n\tresult := 1\n\tfmt.Scan(&a);\n\tfmt.Scan(&b);\n\tfmt.Scan(&c);\n\tif (a%c == 0) {\n\t\tresult *= a/c\n\t} else {\n\t\tresult *= (a/c)+1\n\t}\n\tif (b%c == 0) {\n\t\tresult *= b/c\n\t} else {\n\t\tresult *= (b/c)+1\n\t}\n\tfmt.Println(result)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "3f0248b32d52fa0de20e6abd29d3066d", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "// 1a\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b, c int64\n\tfmt.Scan(&a, &b, &c)\n\tfmt.Println ((a-1)/c + 1) * ((b-1)/c + 1)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "99e91dc12cbc7014ab344a4fda41288b", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, m, a float64\n\t_, err := fmt.Scanf(\"%f %f %f\", &n, &m, &a)\n\tfmt.Println(math.Ceil(m/a) * math.Ceil(n/a))\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "39410969cb676ed890e02c5393a19978", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n \nimport (\n \"fmt\"\n)\n \nfunc main(){\n var i, j, k int\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": "a819efd1f386d95aba21ac688278a4b3", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "import (\n\t\"fmt\"\n)\n\n\nfunc main() {\n\tvar n, m, a int\n\tfmt.Scanf(\"%d %d %d\",&n, &m, &a)\n\twidth := n/a+1;\n\theight := m/a+1;\n\tfmt.Println(width*height)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "15664c95009d80603abb4aa0eb346bfe", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m, a, result, x1, x2 int64\n\tfmt.Scan(&n)\n\tfmt.Scan(&m)\n\tfmt.Scan(&a)\n\n\tif n%a != 0 {\n\t\tx1 = (n / a) + 1\n\t} else {\n\t\tx1 = n / a\n\t}\n\tif m%a != 0 {\n\t\tx2 = (m / a) + 1\n\t} else {\n\t\tx2 := m / a\n\t}\n\tresult = x1 * x2\n\tfmt.Println(result)\n\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "ca171f27c9ff3c8c8b5bb9d4c5471d8b", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n var n,m,a int \n fmt.Scan(&n,&m,&a)\n var tiles1,tiles2 int64 = n/a, m/a\n \n if(n%a!=0) {tiles1++}\n if(m%a!=0) {tiles2++}\n \n var hasil int = tiles1 * tiles2\n fmt.Println(hasil)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a887125ea4ea3a8a94055a17b38bffb4", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n\tvar a, b, c int64\n\tfmt.Scan(&a, &b, &c)\n\tfmt.Println ((a-1)/c + 1) * ((b-1)/c + 1)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "53f94c2d37b3031ecaacd0ba0bcd0b97", "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 int = n/a, m/a\n \n if(n%a!=0) {tiles1++}\n if(m%a!=0) {tiles2++}\n \n var hasil int = tiles1 * tiles2\n fmt.Println(hasil)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "04efb2a23415d84ef97e9ac536df3b4c", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m, a uint64\n\tfmt.Scanf(\"%d %d %d\", &n, &m, &a)\n\trem := 0\n\tif n % a != 0 {\n\t\trem = 1\n\t}\n\tcols := (n / a) + rem\n\trem = 0\n\tif m % a != 0 {\n\t\trem = 1\n\t}\n\trows := (m / a) + rem\n\tfmt.Print(cols * rows)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "fb9fc28c8070d5f20509c13e08d9600d", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport(\n \"fmt\"\n)\n\nvar(\n n,m,a int\n)\nfunc main(){\n fmt.Scanln(&n, &m, &a)\n widthNum := m / a\n if(m % a != 0){)\n\twidthNum++\n }\t\n LengthNum := n / a\n if(n % a != 0){\n\tLengthNum++\n }\n fmt.Println(widthNum * LengthNum)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "c9328f9094f6fc49fc7998555c4808e6", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\nimport \"math\"\n\nfunc main() {\n var n, m, a uint64\n fmt.Scanf(\"%d%d%d\", &n, &m, &a)\n fmt.Println((n + a - 1) / a * (n + b - 1) / b)\n} \n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "ee2fe2b6f23c94d13a76687e29e385cd", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m, a int64\n\tfmt.Scanf(\"%d%d%d\", &n, &m, &a)\n\tvar inN, inM int64 = n / a, m / a\n\tvar count int64 = inN * inM\n\tvar add bool = true\n\tif n % a == 0 {\n\t\tcount = n / a\n\t} else {\n\t\tcount = n / a + 1\n\t}\n\tif m % a == 0 {\n\t\tcount *= m / a\n\t} else {\n\t\tcount *= m / a + 1\n\t}\t\n\tfmt.Println(count)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "8a227adf3821091dd951c577b59f16ac", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n \"strconv\"\n \"math\"\n \"math/big\"\n)\n\nfunc main() {\n var w1, w2, w3 string\n fmt.Scanln(&w1, &w2, &w3)\n n := big.NewInt(strconv.ParseFloat(w1, 64))\n m := big.NewInt(strconv.ParseFloat(w2, 64))\n a := big.NewInt(strconv.ParseFloat(w3, 64))\n fmt.Println(math.Ceil(n/a) * math.Ceil(m/a))\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "d6fe6361a5e1b6d9984881b747d6961b", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n,m,a,v,h int\n fmt.Scan(&n,&m)\n fmt.Scan(&a)\n v= (int)n/a\n if v%a!= 0 {\n v=v+1\n }\n h= (int)m/a\n if h%a!=0 {\n h=h+1\n }\n fmt.Println(v*h)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "d8cb2d44de30eff383f4b58bb72127d9", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main \nimport \"fmt\"\n\nfunc main (){\n var m,n,a int\n fmt.scanf(\"%d\",&m,&n,&a)\n fmt.println(((m+a-1)/a)*((n+a-1)/a))\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "60c773c17c9e86532ccbd94f36273bdc", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc round(n float64) int {\n\tif n1-float64(n2) < 0.00000001 {\n\t\treturn int(n)\n\t} else {\n\t\treturn int(n) +1 \n\t}\n}\nfunc main() {\n\tvar n, m, a int\n\tfmt.Scanf(\"%d,%d,%d\", &n, &m, &a)\n\tfmt.Println(round(float64(n)/float64(a)) * round(float64(m)/float64(a)))\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "f4cef9c4625895f40d0d07d71bc51f03", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n \nimport (\n \"fmt\"\n)\n \nfunc main(){\n var i, j, k int\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": "1759d49b3595019012c3184438bfe854", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar m,n,a int64\nfunc main() {\n\tfmt.Scanf(\"%d %d %d\",&m,&n,&a)\n\n\tvar s int\n\ty:=n/a \n\tif float64(n)/float64(a)>float64(y){\n\ty=y+1\n\t} \n\t\n\tx:=m/a\n\tif float64(m)/float64(a)>float64(x){\n\tx=x+1\n\t} \n\t\n\ts=y*x\n\tfmt.Println(s)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "94b633990a1a55f4de48d727bb6988ff", "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 float64 = n/a, m/a\n \n if(n%a!=0) {tiles1++}\n if(m%a!=0) {tiles2++}\n \n var hasil float64 = tiles1 * tiles2\n fmt.Println(hasil)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "c3a4bb413c9f887127c82cee59ffe2fb", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Go", "source_code": "package codeforces\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc convertAndCount(x []string) int {\n\tc := 0\n\tfor _, s := range x {\n\t\tn, _ := strconv.Atoi(s)\n\t\tc += n\n\t}\n\treturn c\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scanln(&n)\n\tvar s1, s2 string\n\tfmt.Scanln(&s1)\n\tfmt.Scanln(&s2)\n\n\tif convertAndCount(strings.Split(s1, \" \")) == convertAndCount(strings.Split(s2, \" \")) {\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": "c596803d9f7ae38be9f4c05f099ae7fc", "src_uid": "e0ddac5c6d3671070860dda10d50c28a", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tn := 0\n\tfmt.Scan(&n)\n\n\tinputPiles := make([]int, n)\n\tpilesOutput := make([]int, n)\n\n\tfor i := range inputPiles {\n\t\tfmt.Scan(&inputPiles[i])\n\t}\n\tfor i := range pilesOutput {\n\t\tfmt.Scan(&pilesOutput[i])\n\t}\n\n\tinputPilesSum := sum(inputPiles)\n\toutputPilesSum := sum(pilesOutput)\n\n\tif inputPilesSum >= outputPilesSum {\n\t\tfmt.println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.println(\"No\")\n}\n\nfunc sum(slice []int) int {\n\tsum := 0\n\tfor _, value := range slice {\n\t\tsum += value\n\t}\n\n\treturn sum\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a9072b4be6673e136aaee978d052f8d0", "src_uid": "e0ddac5c6d3671070860dda10d50c28a", "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\t\"strings\"\n)\n\nfunc problem(n int32, answers []int32) {\n\tvar res int32\n\tfor i := 0; i < int(n)3; i++ {\n\t\tres |= answers[i]\n\t}\n\tif res == 1 {\n\t\tfmt.Println(\"HARD\")\n\t\treturn\n\t}\n\tfmt.Println(\"EASY\")\n}\n\nfunc main() {\n\treader := bufio.NewReaderSize(os.Stdin, 1024*1024)\n\n\tline1 := strings.Split(readLine(reader), \" \")\n\tnTemp, err := strconv.ParseInt(line1[0], 10, 64)\n\tcheckError(err)\n\tn := int32(nTemp)\n\n\tline2 := strings.Split(readLine(reader), \" \")\n\tvar answers []int32\n\tfor _, v := range line2 {\n\t\tvTmp, err := strconv.ParseInt(v, 10, 64)\n\t\tcheckError(err)\n\t\tanswers = append(answers, int32(vTmp))\n\t}\n\n\tproblem(n, answers)\n}\n\nfunc readLine(reader *bufio.Reader) string {\n\tstr, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\n\treturn strings.TrimRight(string(str), \"\\r\\n\")\n}\n\nfunc checkError(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "b6455f62382c31c8d63e787fc2e9b766", "src_uid": "060406cd57739d929f54b4518a7ba83e", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n\t\"fmt\"\n)\n \nfunc main() {\n\tvar n int \n var res int\n\tfmt.Scan(&n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&res)\n\t\tif res == 1{\n\t\t\tfmt.Println(\"HARD\")\n\t\t}\n\t\telse if i == n-1{\n\t\t\tfmt.Println(\"EASY\")\n\t\t}\n\t}\n \n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "81fb61f8fb66a056bb1fd812f908d093", "src_uid": "060406cd57739d929f54b4518a7ba83e", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n \"fmt\"\n)\n \nfunc main() {\n var num int\n var isHard int\n var flag bool = false\n fmt.Scanf(&num)\n for i := 0; i < num; i++ {\n fmt.Scanf(&isHard)\n if isHard == 1 {\n flag = true \n }\n }\n \n if flag {\n fmt.Println(\"HARD\")\n } else {\n fmt.Println(\"EASY\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "834417872e9a1f24ec3a4cd745459e79", "src_uid": "060406cd57739d929f54b4518a7ba83e", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n\t\"fmt\"\n)\n \nfunc main() {\n\tvar n int \n var res int\n\tfmt.Scan(&n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&res)\n\t\tif res == 1\n {\n\t\t\tfmt.Println(\"HARD\")\n\t\t}\n\t\tif i == n-1\n {\n\t\t\tfmt.Println(\"EASY\")\n\t\t}\n\t}\n \n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "7f8bd269293307bf3b684528222853cb", "src_uid": "060406cd57739d929f54b4518a7ba83e", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n \"fmt\"\n)\n \nfunc main() {\n var num int\n var isHard int\n var flag bool = false\n fmt.Scanf(\"%d\", &num)\n for i := 0; i < num; i++ {\n fmt.Scanf(isHard)\n if isHard == 1 {\n flag = true \n }\n }\n \n if flag {\n fmt.Println(\"HARD\")\n } else {\n fmt.Println(\"EASY\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "cbb2f3cc7dbdfaa1f86cce913401a540", "src_uid": "060406cd57739d929f54b4518a7ba83e", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var num int\n var isHard int\n var flag bool = false\n fmt.Scanf(\"%d\", &num)\n for i := 0; i < num; i++ {\n fmt.Scanf(\"%d\", &isHard)\n if isHard == 1 {\n flag = true \n }\n }\n\n if flag {\n fmt.Println(\"HARD\")\n } else {\n fmt.Println(\"EASY\")\n }", "lang_cluster": "Go", "compilation_error": true, "code_uid": "59c28c38cc1ca4ff863a69cf5f3d9593", "src_uid": "060406cd57739d929f54b4518a7ba83e", "difficulty": 800.0} {"lang": "Go", "source_code": "var n = readline().split(\" \").map(function (x) { return parseInt(x); });\nvar res = readline().split(\" \").map(function (x) { return parseInt(x); });\nvar judge = false;\nfor (var i = 1; i <= Number(n); ++ i) {\n var tmp = res[i - 1];\n if (Number(tmp) > 0) {\n judge = true;\n }\n}\nif (judge == true) {\n print(\"HARD\");\n}\nelse {\n print(\"EASY\");\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "9bbb38f6a1d9c85fad148de0f4741850", "src_uid": "060406cd57739d929f54b4518a7ba83e", "difficulty": 800.0} {"lang": "Go", "source_code": "package codeforces\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc p263a(in io.Reader) int {\n\tabs := func(x int) int {\n\t\tif x < 0 {\n\t\t\treturn -x\n\t\t}\n\t\treturn x\n\t}\n\tn := 5\n\ti, j := 0, 0\n\tfor {\n\t\tv := 0\n\t\tfmt.Fscanf(in, \"%d\", &v)\n\t\tif v == 1 {\n\t\t\tbreak\n\t\t}\n\t\ti++\n\t}\n\t// manhatten distance\n\ti, j = i/n, i%n\n\tif j == 0 {\n\t\tj = 5\n\t}\n\tx, y := abs(i-3), abs(j-3)\n\treturn x + y\n}\n\nfunc main() {\n\tp263a(os.Stdin)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "1c13b25d5f18cf10dad58a80cca012cd", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "difficulty": 800.0} {"lang": "Go", "source_code": "import (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc p263a(in io.Reader) int {\n\tabs := func(x int) int {\n\t\tif x < 0 {\n\t\t\treturn -x\n\t\t}\n\t\treturn x\n\t}\n\tn := 5\n\ti, j := 0, 0\n\tfor {\n\t\tv := 0\n\t\tfmt.Fscanf(in, \"%d\", &v)\n\t\tif v == 1 {\n\t\t\tbreak\n\t\t}\n\t\ti++\n\t}\n\t// manhatten distance\n\ti, j = i/n, i%n\n\tif j == 0 {\n\t\tj = 5\n\t}\n\tx, y := abs(i-3), abs(j-3)\n\treturn x + y\n}\n\nfunc main() {\n\tfmt.Println(p263a(os.Stdin))\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "c72d03c50133220072a938a974dd20f8", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"os\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc p263a(in io.Reader) int {\n\tabs := func(x int) int {\n\t\tif x < 0 {\n\t\t\treturn -x\n\t\t}\n\t\treturn x\n\t}\n\tn := 5\n\ti, j := 0, 0\n\tfor {\n\t\tv := 0\n\t\tfmt.Fscanf(in, \"%d\", &v)\n\t\tif v == 1 {\n\t\t\tbreak\n\t\t}\n\t\ti++\n\t}\n\t// manhatten distance\n\ti, j = i/n, i%n\n\tif j == 0 {\n\t\tj = 5\n\t}\n\tx, y := abs(i-3), abs(j-3)\n\treturn x + y\n}\n\nfunc main() {\n\tp263a(os.Stdin)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "d87b9a60f7fc2e9ee37fa435c3e35357", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n)\n\nfunc init() {\n\tlog.SetLevel(log.ErrorLevel)\n\tlog.Println(\"started\")\n}\n\n// Case .\ntype Case struct {\n\ta, b, x, y, z int64\n}\n\nfunc solve(c Case, w io.Writer) {\n\ta := 2*c.x + c.y - c.a\n\tb := c.y + 3*c.z - c.b\n\tif a < 0 {\n\t\ta = 0\n\t}\n\tif b < 0 {\n\t\tb = 0\n\t}\n\tw.Write(([]byte)(fmt.Sprintf(\"%d\\n\", a+b)))\n}\n\nfunc parseInput(lines <-chan string, res chan<- Case) {\n\tfor {\n\t\tab1, ok := <-lines\n\t\tif !ok {\n\t\t\tclose(res)\n\t\t\treturn\n\t\t}\n\t\tab := int64s(words(ab1))\n\t\txyz := int64s(words(<-lines))\n\t\tres <- Case{ab[0], ab[1], xyz[0], xyz[1], xyz[2]}\n\t}\n}\n\nfunc int64s(w []string) []int64 {\n\tres := make([]int64, 0, len(w))\n\tfor _, word := range w {\n\t\ti, err := strconv.ParseInt(word, 10, 64)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tres = append(res, i)\n\t}\n\treturn res\n}\n\nfunc words(s string) []string {\n\tprep := strings.Split(s, \" \")\n\tres := make([]string, 0, len(prep))\n\tfor _, l := range prep {\n\t\tif len(l) > 0 {\n\t\t\tres = append(res, l)\n\t\t}\n\t}\n\treturn res\n}\n\nfunc run() error {\n\texp, err := ioutil.ReadFile(\"expected.txt\")\n\tif err == nil {\n\t\tfmt.Println(\"--------- expected --------- \")\n\t\tfmt.Println((string)(exp))\n\t\tfmt.Println(\"--------- computed --------- \")\n\t}\n\n\tinData, err := ioutil.ReadAll(os.Stdin)\n\t//inData, err := ioutil.ReadFile(\"in.txt\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"read input: %s\", err)\n\t}\n\tlines := make(chan string, 8)\n\tcases := make(chan Case, 8)\n\tgo func() {\n\t\tfor _, line := range strings.Split((string)(inData), \"\\n\") {\n\t\t\ts := strings.TrimSpace(line)\n\t\t\tif len(s) > 0 {\n\t\t\t\tlines <- s\n\t\t\t}\n\t\t}\n\t\tclose(lines)\n\t}()\n\tgo parseInput(lines, cases)\n\tfor c := range cases {\n\t\tsolve(c, os.Stdout)\n\t}\n\treturn nil\n}\n\nfunc main() {\n\tif err := run(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "8e10740d74557674f79f61523fdc4b92", "src_uid": "35202a4601a03d25e18dda1539c5beba", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var yc, bc uint64\n var y,g,b uint64\n var yn, bn uint64\n fmt.Scan(&yc, &bc, &y, &g, &b)\n yn = 2*y + 1*g\n bn = 1*g + 3*b\n var total int\n if yn > yc {\n total += yn - yc\n }\n if bn > bc {\n total += bn - bc\n }\n fmt.Print(total)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "996c2ea7e4caeab511e074ae0aa7b320", "src_uid": "35202a4601a03d25e18dda1539c5beba", "difficulty": 800.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.Println(\"2\")\r\n\t\t} else if a[0] + a[1] + a[2] + a[3] == 0 {\r\n\t\t\tfmt.Println(\"0\")\r\n\t\t} else {\r\n\t\t\tfmt.Println(\"1\")\r\n\t\t}\r\n\t}\r\n\r\n}\r\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a94eecdd0731a4a15b00eb5fd212e7b7", "src_uid": "7336b8becd2438f0439240ee8f9610ec", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\nimport \"os\"\nimport \"bufio\"\n\nvar s string\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in, &s)\n\ti : = 0\n\tzero := 0\n\n\tfor i < len(s) {\n\t\tif s[i] == '1' { break }\n\t}\n\n\tfor i < len(s) {\n\t\tif s[i] == '0' {\n\t\t\tzero++\n\t\t}\n\t}\n}\n\n\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a8859fd2c5b130cb42e735b3c8a087c7", "src_uid": "88364b8d71f2ce2b90bdfaa729eb92ca", "difficulty": 1000.0} {"lang": "Go", "source_code": "a", "lang_cluster": "Go", "compilation_error": true, "code_uid": "97d1741ef59679fe0111cba7422b92da", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar m, n int\n\tfmt.Scan(&m, &n)\n\tfmt.Println(int(math.Floor(m * n / 2)))\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "3017c7e9142573444948a2797f683423", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tc = a/2*b + a%2*b/2\n\tb = b/2*a + b%2*a/2\n\tif c < b {\n\t\tc = b\n\t}\n\tfmt.Print(c)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "7985df2ea0edb7466b595c9479b938a9", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\nimport \"strings\"\n\n\n\nfunc main() {\n\n\tvar a, b int;\n\n\tfmt.Scan(&a, &b);\n\n\tfmt.Println((a * b) / 2)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "0ed31382527cfc66d5bc812a680f45a9", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tfmt.Println(max(a/2*b+a%2*b/2), (b/2*a + b%2*a/2))\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "c38ff8ab5311d7196c8f84adda88de33", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "difficulty": 800.0} {"lang": "Go", "source_code": "package a50\n\nimport \"fmt\"\n\nfunc main() {\n\tm, n := 0, 0\n\n\tfmt.Scanln(&m)\n\tfmt.Scanln(&n)\n\n\tfmt.Println(\" \", m*n/2)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "f1b877e4288b813318e29dff3650b1e5", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "difficulty": 800.0} {"lang": "Go", "source_code": "package main \n\nimport (\"fmt\"\n \"math\"\n)\n\nfunc main (){\n var m float64\n var n float64\n fmt.Scan(&m,&n)\n \n h := int64(math.Floor(n*m/2)\n fmt.Println(h)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "7fc3a3523261cc66f13923790e118600", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"fmt\"\n\t\"sort\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n\tscanner.Scan()\n\tx, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\treturn x\n}\nfunc getI() int {\n\treturn int(getI64())\n}\nfunc getF() float64 {\n\tscanner.Scan()\n\tx, _ := strconv.ParseFloat(scanner.Text(), 64)\n\treturn x\n}\nfunc getS() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc max(a,b int) int { if a > b { return a } else { return b } }\n\nfunc min(a,b int) int { if a < b { return a } else { return b } }\n\nconst alphabets = \"abcdefghijklmnopqrstuvwxyz\"\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\n\tProblem1092B()\n}\n\nfunc Problem1092B() {\n\tn := getI()\n\tarr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = getI()\n\t}\n\tsort.Ints(arr)\n\tmax := 0\n\tfor i := 0; i < n; i+=2 {\n\t\tif arr[i] != arr[i+1] {\n\t\t\tmax += arr[i+1] - arr[i]\n\t\t}\n\t}\n\tprintln(max)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "0ca1f1a7a2ba960d112c613ad0de64e6", "src_uid": "55485fe203a114374f0aae93006278d3", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, result int\n\tif _, err := fmt.Scanln(&n); err != nil {\n\t\tpanic(err)\n\t}\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tif _, err := fmt.Scan(&a[i]); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\tsort.Ints(a)\n\tfor i := 0; i < n; i += 2 {\n\t\tresult += a[i+1] - a[i]\n\t}\n\n\tfmt.Println(result)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "e3852312a97c593f4dd1e33b216d7405", "src_uid": "55485fe203a114374f0aae93006278d3", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n//bg \u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0430 gb\nfunc checking(s string) {\n\tflag := strings.ReplaceAll(s, \"BG\", \"GB\")\n\treturn flag\n}\n \nfunc main() {\n\tvar itog string\n var x, y int\n\tfmt.Scan(&itog)\n fmt.Scan(&x, &y)\n\t\n\tfor i := 0; i++; i < y {\n\t\titog = checking(itog)\n\t}\n\tfmt.Println(itog)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "2c8fdc8320dc6eb367311d16fad0a377", "src_uid": "964ed316c6e6715120039b0219cc653a", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n//bg \u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0430 gb\nfunc checking(s string) {\n\tflag := strings.ReplaceAll(s, \"BG\", \"GB\")\n\treturn flag\n}\n \nfunc main() {\n\tvar itog string\n var x, y int\n\tfmt.Scan(&itog)\n fmt.Scan(&x, &y)\n\t\n\tfor i := 0; i < y; i++ {\n\t\titog = checking(itog)\n\t}\n\tfmt.Println(itog)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "bb096cf30c28038e05ffbdd995a8acf5", "src_uid": "964ed316c6e6715120039b0219cc653a", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar k,w,d int64\n\tfmt.Scan(&k,&d,&w)\n\tn:=(k+(w*k))*w/2\n\tn-=d\n\tif n<0{\n\t\tfmt.Printf('0')\n\t} else {\n\t\tfmt.Printf(n)\n\t}\n\t\n\t\n\t\n\t\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "32d2baa0204968217236b35c35001af1", "src_uid": "e87d9798107734a885fd8263e1431347", "difficulty": 800.0} {"lang": "Go", "source_code": "package p546a\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar k, n, w int\n\tfmt.Scan(&k)\n\tfmt.Scan(&n)\n\tfmt.Scan(&w)\n\n\tfmt.Print(CalcBorrow(k, n, w))\n}\n\nfunc CalcBorrow(k int, n int, w int) int {\n\tcost := (1 + w) * w * k / 2\n\n\tif cost > n {\n\t\treturn cost - n\n\t} else {\n\t\treturn 0\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "12baca800237d17c341a54ff3f2fb48c", "src_uid": "e87d9798107734a885fd8263e1431347", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n //\"bufio\"\n //\"os\"\n)\n\nfunc main() {\n //cin := bufio.NewReader(os.Stdin)\n\t//cout := bufio.NewWriter(os.Stdout)\n\t//defer cout.Flush()\n\n var k,n,w int\n fmt.Scan(&k)\n fmt.Scan(&n)\n fmt.Scan(&w)\n money:=0\n\tfor x := 1; x < w+1; x++ {\n money+= k*x", "lang_cluster": "Go", "compilation_error": true, "code_uid": "66e844e6a72c37f29315b3caf01f858b", "src_uid": "e87d9798107734a885fd8263e1431347", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n)\n\ntype input struct {\n\ta string\n}\n\nfunc (s *input) readIn(scanner *bufio.Scanner) {\n\tfor scanner.Scan() {\n\t\ts.a = scanner.Text()\n\t}\n}\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tvar inp input\n\tinp.readIn(sc)\n\tchr := \"\"\n\tvar v1 int\n\tfor _, b := range inp.a {\n\t\tstr := string(b)\n\t\tif str == chr {\n\t\t\tv1++\n\t\t} else {\n\t\t\tv1 = 1\n\t\t}\n\n\t}\n\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "f2c3bb1793dacf7d1833353020679efd", "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 n int\n\tfmt.Scan(&n)\n\tvar altScore [n]int\n\tvar s string\n\tfmt.Scan(&s)\n\tvar defaultScore [n]uint8\n\td := 1\n\tdefaultScore[0] = 1\n\tfor i := 1; i < n; i++ {\n\t\tif s[i] != s[i+1] {\n\t\t\td++\n\t\t}\n\t\tdefaultScore[i] = d\n\t}\n\tfor i := 0; i < n; i++ {\n\n\t}\n\n\tfmt.Print(d)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "57a094f27338711d04351d06010afbb8", "src_uid": "7830aabb0663e645d54004063746e47f", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc fastGetInt(b []byte) int {\n\tneg := false\n\tif b[0] == '-' {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tn := 0\n\tfor _, v := range b {\n\t\tn = n*10 + int(v-'0')\n\t}\n\tif neg {\n\t\treturn -n\n\t}\n\treturn n\n}\n\nfunc solveFromFile() int {\n\tvar num int\n\tvar numList []int\n\tfile, err := os.Open(os.Args[1])\n\tif err != nil {\n\t\tlog.Fatalf(\"failed opening file: %s\", err)\n\t}\n\tscanner := bufio.NewScanner(file)\n\tscanner.Split(bufio.ScanWords)\n\n\tscanner.Scan()\n\tnum = fastGetInt(scanner.Bytes())\n\tscanner.Scan()\n\tfor scanner.Scan() {\n\t\tnumList = append(numList, fastGetInt(scanner.Bytes()))\n\t}\n\n\tdefer file.Close()\n\n\treturn solution(num, numList)\n}\n\n//========== Implement Algorithm =======================\nfunc solution(num int, numList []int) int {\n\tminNum := 9999999999\n\tsort.Ints(numList)\n\tfor x := 0; x < (len(numList) - (num)); x++ {\n\t\tif (numList[x+num-1] - numList[x]) <= minNum {\n\t\t\tminNum = (numList[x+num-1] - numList[x])\n\t\t}\n\t}\n\treturn minNum\n}\n\nfunc main() {\n\n\t//================== Variables used ====================\n\tvar num, ret int\n\tvar numList []int\n\t//======================================================\n\n\tif len(os.Args) >= 2 {\n\t\t//============== Get return value from File ============\n\t\tret = solveFromFile()\n\n\t} else {\n\t\t//============== Get return value from STDIN ===========\n\t\tscanner := bufio.NewScanner(os.Stdin)\n\t\tscanner.Split(bufio.ScanWords)\n\n\t\tscanner.Scan()\n\t\tnum = fastGetInt(scanner.Bytes())\n\t\tscanner.Scan()\n\n\t\tfor scanner.Scan() {\n\t\t\tnumList = append(numList, fastGetInt(scanner.Bytes()))\n\t\t}\n\n\t\tret = solution(num, numList)\n\t}\n\n\t//================== OUTPUT ============================\n\tfmt.Println(ret)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a8266917099d644bd4c86c97787edbd5", "src_uid": "7830aabb0663e645d54004063746e47f", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var w uint\n \n fmt.Scanf(\"%d\", &w) \n\n if (w == 2) {\n fmt.Println(\"NO\")\n if (w % 2 == 0) {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "44decfe27bb30574d78713846ed48276", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\nfunc main() {\n\tvar w int\n\tfmt.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": "36c5fa5a6b3259277be636689d8c1a27", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "import (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n text, _ := reader.ReadString('\\n')\n text = strings.Replace(text, \"\\n\", \"\", -1)\n\n num, err := strconv.Atoi(text)\n if err != nil {\n fmt.Print(\"NO\")\n return\n }\n\n if num <= 0 || num > 100 || num%2 != 0 {\n fmt.Printf(\"NO\")\n return\n }\n\n fmt.Printf(\"YES\")\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "4433a2c658e5b7b6c69c10c9fbf11c91", "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 if((temp/2)%2 == 0) {\n fmt.Println(\"YES\")\n }\n else {\n fmt.Println(\"NO\")\n }\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "5effe432aba8ded2de5947c200bc525f", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n \"fmt\"\n \"strconv\"\n)\n \nfunc main(){\n var i int\n fmt.Scanf(\"%d\\n\", &i)\n //i, _ := strconv.Atoi(text)\n if (i%2==0 && i>2) {\n fmt.Println(\"YES\")\n return\n }\n fmt.Println(\"NO\")\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a4940c62c75e5cddbf0bf3bae477263c", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package \"main\"\nimport \"fmt\"\nfunc check(weight int) String {\n if weight %2 != 0 {\n fmt.println(\"NO\")\n }else {\n fmt.println(\"YES\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "45d5a2ccf430216af5db51064b88aa51", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nfunc main() {\n\ta := flag.Args()\n\ti, _ := strconv.Atoi(a[0])\n\tfl := float64(i)\n\n\tif math.Mod(fl, 2) == 0{\n\t\tprintln(\"YES\")\n\t} else {\n\t\tprintln(\"NO\")\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "b6ac46d6089e92f0b2740bc3f8abc0e7", "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 && i<101 && i>0) {\n fmt.Println(\"YES\")\n return\n }\n fmt.Println(\"NO\")\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "b2046b443033d5a6bcd37cbf865fb740", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "import \"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": "5bbbf32ca91c9cb26ec173860bb18f98", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "func main() {\n\n var w = 80\n\n for i := 0; i < w; i++ {\n other := w-i\n if other % 2 == 0 && w % 2 == 0 {\n fmt.Print(\"true\")\n return true\n }\n }\n return false\n\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "02821b34a5563a12590adc7d3d0e64d9", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t)\nfunc main() {\n number := 0\n fmt.Scanf(\"%d\\n\", &number)\n if number > 2 && number % 2 == 0 {\n fmt.Println(\"YES\")\n }else{\n fmt.Println(\"NO\")\n }\n \n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "df4a5bd258adff280b0c12ea2d230c32", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar w,a int\n\tfmt.Scan(&w)\n\tif (w%2)==0{\n\t\t\tfmt.Print(\"YES\")\n\t\t\t}\n\t\telse{\n\t\t\tfmt.Print(\"NO\")\n\t\t\t}\n\t}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "d077de8248f042b77b67efcd016a3759", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n \"fmt\"\n \"strconv\"\n)\n \nfunc main(){\n var text string\n fmt.Scanf(\"%v\\n\", &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": "f535e886e7f44b49905b0fb924555749", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\nimport (\n \"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\n\nfunc main(){\n var n int\n fmt.Scafn(&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": "0d5f76e04446f643409d8b29cbbc19a2", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc check(weight int) {\n\tif weight%2 != 0 || weight ==2 {\n\t\tfmt.Println(\"NO\")\n\t}else {\n\t\tfmt.Println(\"YES\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "977a6712cb68974175339179410d20db", "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\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": "9921092be3592fc46fe96053ada612a0", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "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 = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) {\n\tfmt.Fprintf(writer, f, a...)\n}\n\nfunc scanf(f string, a ...interface{}) {\n\tfmt.Fscanf(reader, f, a...)\n}\n\nfunc main() {\n\t// The weight of watermelon\n\tvar w int\n\tscanf(\"%d\\n\", &w)\n\n\tvar b bool = false\n\tif w <= 2 {\n\t\tprintf(\"NO\\n\")\n\t} else if w%2 == 0 {\n\t\tprintf(\"YES\\n\")\n\t} else {\n\t\tprintf(\"NO\\n\")\n\t}\n\n\twriter.Flush()\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "d1e66f744dc32f2fb65103d63244f5db", "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\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": "3eb397a5e8f070f4c52e3e1adf4d3b9f", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "import (\n \"fmt\"\n)\n\n\nfunc main() {\n \n var w int\n fmt.Scanf(\"%d\\n\",&w)\n \n if w % 2 == 0 {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n \n \n \n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "28c0b8348de0d6d10b8b2bbf791c6ab7", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "\nfunc main() {\n\ta := flag.Args()\n\ti, _ := strconv.Atoi(a[0])\n\tfl := float64(i)\n\n\tif math.Mod(fl, 2) == 0{\n\t\tprintln(\"YES\")\n\t} else {\n\t\tprintln(\"NO\")\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "3cb74a99440e4331d304dd935c77a185", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\\n\")\n\tfmt.Printf(\"%s\\n\", n % 2 == 0 ? \"YES\" : \"NO\")\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "f85d2ab0a391fb7ff85af7b9a04c5f83", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "for i := 0; i < w; i++ {\n other := w-i\n if other % 2 == 0 && w % 2 == 0 {\n fmt.Print(\"true\")\n return true\n }\n }\nreturn false", "lang_cluster": "Go", "compilation_error": true, "code_uid": "c9dc782daf0b5119ae2f31b0759a891e", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"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": "bcaa8e9497759b5250792676728e42e3", "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\tn 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": "b622fd5fcf3b06d3b4fd52fd643dd50e", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport fmt\n\nfunc main(){\n var n\n fmt.Scanln(&n)\n if(n%2==0){\n fmt.println(\"Yes\")\n }\n else{\n fmt.println(\"No\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "97a144ffe7479dfceb9b7c4c2cae169c", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\nfunc main()\n{\n var n int\n fmt.Scan(&n)\n if n%2==0{\n fmt.Print(\"Yes\")\n }\n else{\n Print(\"No\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "cf1a0edee9e59c2c028151d983bc6003", "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": "476f2ca72cb9b827bf4a7a4f0d18616b", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport \"fmt\"\n \nfunc main() {\n var w int\n fmt.Scanln(&w)\n if w % 4 == 0\n fmt.Println(\"YES\")\n else\n fmt.Println(\"NO\")\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "c45f462a4bd3fa71ca4bca39ba6ca483", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "import (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar kilo int8\n\t_, _ = fmt.Scan(&kilo)\n\t//reader := bufio.NewReader(os.Stdin)\n\t//text, _ := reader.ReadString('\\n')\n\t//integer, _ := strconv.Atoi(text)\n\n\tif (kilo/2)%2 == 0 {\n\t\tfmt.Print(\"YES\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "6b445d5479444054d729d0423d8ff36d", "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 if((temp/2)%2 == 0) {\n fmt.Println(\"YES\")\n }\n else {\n fmt.Println(\"NO\")\n }\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "0fbab7380182be92317a0d2fb6bdd9af", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n \"os\"\n \"fmt\"\n \"bufio\"\n \"strconv\"\n)\n \nfunc prErr(err error) {\n if err != nil {\n fmt.Println(err)\n } \n}\n \nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n text, err := reader.ReadString('\\n')\n prErr(err)\n text = strings.TrimSuffix(text, \"\\r\\n\")\n \n w, err := strconv.Atoi(text)\n prErr(err)\n \n if w%2 == 0 {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "2ec1086655989115ee601c35d1229480", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\"bufio\"\n\"fmt\"\n\"os\"\n\"strconv\"\n)\n\n// http://codeforces.com/problemset/problem/4/A\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _ := reader.ReadString('\\n')\n\tfmt.Printf(\"%#v\", text)\n\tw, _ := strconv.ParseInt(text, 10, 8)\n\tfmt.Printf()\n\tif ((w-2)%2) == 0 {\n\t\tfmt.Printf(\"YES\")\n\t} else {\n\t\tfmt.Printf(\"NO\")\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "ca0c66c6ae4ea458be9944f8f0665878", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n int\n _, _ = fmt.Scanf(\"%d\\n\", &n)\n if n % 2 == 0 {\n return \"YES\"\n }\n return \"NO\"\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "2610ab175e1a4b6a363fd0c164068d3b", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar w int\n\tfmt.Scanf(\"%d\", &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}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "ce57d58e0aced825799caedbbeb505dc", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var w int\n fmt.Scanf(\"%d\", w)\n if var % 2 == 0 {\n fmt.Println('YES')\n } else {\n fmt.Println('NO')\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "f2643cd9621358b306291b1fd0d07551", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int\n fmt.Scanf(\"%d\\n\", &n)\n if n % 2 != 0 {\n fmt.Printf(\"NO\\n\")\n } if n <= 2 {\n fmt.Printf(\"NO\")\n } else { \n fmt.Printf(\"YES\\n\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "77a848c24eca5688e0ca8da014cf5eab", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t// \"bufio\"\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _, _ := reader.ReadLine()\n\n\tatt1, _ := strconv.ParseInt(text, 10, 0)\n\tif att1%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "0f2ef1dda193f308e75e7a9ba9494e06", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "Copy\npackage main\n\nimport (\n \"bufio\"\n \"strconv\"\n \"fmt\"\n \"os\"\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": "e5260b2e7cadda5f1efd8c80b8f935a9", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() bool {\n var w int\n fmt.Scanln(&w)\n return w % 4 == 0\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "0a36d7aa8e2535f2e753b30e4d56c92e", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar int n\n\tfmt.Scanf(\"%d\", &n)\n\tif n%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": "870040376b2f9430224a07ae082d235c", "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 if((temp/2)%2 == 0) {\n fmt.Println(\"YES\")\n }\n else fmt.Println(\"NO\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "e2e5380c37177fe37d7ef72ab9124f2f", "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\tn 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": "f265b717393ec7670ddd8012695710d3", "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 if((temp/2)%2 == 0) {\n fmt.Println(\"YES\")\n }\n else fmt.Println(\"NO\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "6a398e20338996dec6305fcd70ce0833", "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 || melon == 0: {\n fmt.Println(\"NO\")\n } else {\n fmt.Println(\"YES\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "5f8c4db4fba810f27427675e6217a72f", "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 int32(text)%2==0 {\n fmt.Println(\"YES\")\n return\n }\n fmt.Println(\"NO\")\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "1f0c2d3c7bd23c72d7d74438106bc065", "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 x := i/2\n if (i%2==0 && i<101 && i>0 && i/2 && x%2==0) {\n fmt.Println(\"YES\")\n return\n }\n fmt.Println(\"NO\")\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "88e7b5995726f798749dedb83061d835", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc check(weight int) {\n\tif weight%2 != 0 {\n\t\tfmt.Println(\"NO\")\n\t}else {\n\t\tfmt.Println(\"YES\")\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "27e624564a9bd8375f51824a026f76ee", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"bufio\"\n \"strconv\"\n)\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n for scanner.Scan() {\n i, _ := strconv.Atio(scanner.Text())\n if i % 2 == 0 {\n println(i) \n }\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "df6e1cb80d71dfbf9b54ebf95769a8a0", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "import \"fmt\"\n\nfunc check(weight int) {\n\tif weight%2 != 0 || weight ==2 {\n\t\tfmt.Println(\"NO\")\n\t}else {\n\t\tfmt.Println(\"YES\")\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "006eeae2f398cf3cb2eff15d995bb071", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package cf\n\nfunc Watermelon(n int) bool {\n\treturn n%2 == 0\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "8283b84d51f4f5cf6eaa66241a43a427", "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 } \n else if kilos%2 == 0 {\n fmt.Println(\"YES\")\n }\n else {\n fmt.Println(\"NO\")\n }\n \n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "777129c4db730f22c5020904c2ba14b7", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar inp int\n\tvar flag bool\n\tvar lst [12]int = [12]int{4, 7, 44, 47, 74, 77, 444, 447, 477, 744, 747, 777}\n\tfmt.Scan(&inp)\n\tfor i := 0; i < len(lst); i++ {\n\t\tif inp%lst[i] == 0 {\n\t\t\tflag = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "9bbc2f7b7e31220d0b8e4363e23276e7", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc getInput() string {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tfor sc.Scan() {\n\t\treturn sc.Text()\n\t}\n}\n\nfunc main() {\n\tn := getInput()\n\tnumber, _ := strconv.Atoi(n)\n\tif number%4 == 0 || number%7 == 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": "0412708894792271ae7b92362b2c9ee1", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "difficulty": 1000.0} {"lang": "Go", "source_code": "import (\n \"fmt\"\n)\n\nvar lucky = []int{4, 7, 44, 77, 47, 74, 444, 777, 477, 747, 774, 744, 474, 447}\n\nfunc main() {\n var num int\n fmt.Scanf(\"%d\\n\", &num)\n var a = num\n var fuck = true\n for {\n if a == 0 {\n break\n }\n if a%10 == 4 || a%10 == 7 {\n fuck = true\n a = a / 10\n } else {\n fuck = false\n break\n }\n }\n if !fuck {\n for _, i := range lucky {\n if num%i == 0 {\n fuck = true\n break\n }\n }\n }\n if fuck {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "072ceedb64e4d6f81aea86f5c0e03c19", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\" \n)\n\nfunc main() {\n var n uint16\n fmt.Scan(&n)\n ans := \"NO\"\n arr := [14]int{4,7,44,47,74,77,444,447,474,477,744,747,774,777}\n for _,v := range arr{\n if n%v==0{\n ans = \"YES\"\n break\n }\n }\n fmt.Println(ans)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "ed8bf1fc3c79fa0055a71dbed27a19a5", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\nimport (\n \"fmt\"\n \"sort\"\n )\n\nfunc main(){\n var n int\n var l [12]int\n fmt.Scan(&n)\n for i:=0;i<12;i++{\n fmt.Scan(&l[i])\n }\n sort.Sort(sort.Reverse(sort.IntSlice(l)))\n if n == 0 {\n fmt.Println(0)\n } else {\n k := 0\n m := 0\n for _,i := range l {\n m += i\n if m < n { \n k++\n }\n }\n if m >= n {\n fmt.Println(k+1)\n }else{\n fmt.Println(-1)\n }\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "bf745aa93523da02c79c4d4d549658ac", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc read() int {\n\tvar number int\n\tfmt.Scan(&number)\n\treturn number\n}\n\nfunc main() {\n\tvar growRateForMonth []int = make([]int, 12)\n\n\tgrowMin := readInt()\n\n\tfor i := 0; i < 12; i++ {\n\t\tgrowRateForMonth[i] = readInt()\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(growRateForMonth)))\n\n\ttotalMonths := 0\n\n\tfor _, monthValue := range growRateForMonth {\n\t\tif growMin <= 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tgrowMin -= monthValue\n\t\ttotalMonths++\n\t}\n\n\t// wattt\n\n\tif totalMonths == 12 && growMin > 0 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(totalMonths)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "98bddd02f96b9d66c4464bdbf0faadbc", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\nimport (\n \"fmt\"\n \"sort\"\n )\n\nfunc main(){\n var n int\n var l [12]int\n fmt.Scan(&n)\n for i:=0;i<12;i++{\n fmt.Scan(&l[i])\n }\n sort.Sort(sort.Reverse(sort.IntSlice(l)))\n if n == 0 {\n fmt.Println(0)\n } else {\n k := 0\n m := 0\n for _,i := range l {\n m += i\n if m < n { \n k++\n }\n }\n if m >= n {\n fmt.Println(k+1)\n }else{\n fmt.Println(-1)\n }\n }", "lang_cluster": "Go", "compilation_error": true, "code_uid": "274a660ad65c849d08eec87e4551eb2b", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\nimport \"strconv\"\nfunc main() {\n var f int\n var a,b int\n var s string\n fmt.Scanf(\"%d\", &b)\n a=0\n for _,c := range strconv.Itoa(b) {\n if ( c == '4' || c == '7' ){\n a++\n\t\t}\n\t}\n f = 0\n for _,c := range strconv.Itoa(a) {\n if ( c != '4' && c != '7' ){\n\t\t f=1;\n\t\t break;\n\t\t}\n\t}\n\tif f == 0{\n\t fmt.Println(\"YES\")\n\t} else {\n\t fmt.Println(\"NO\")\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "29be4a5877f350d3ae00ea427a99d371", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "difficulty": 800.0} {"lang": "Go", "source_code": "\ufeffpackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n,x,y int64\n\ta,b,c:=0,0,0\n\tfmt.Scan(&n)\n\tfor i:=0;i0 {\n\t\tfmt.Print(\"1\")\n\t} else {\n\t\tfmt.Print(\"-1\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "58e48ffea117ca1b4aff55522690be7d", "src_uid": "f9bc04aed2b84c7dd288749ac264bb43", "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\tvar n, m uint8\n\tvar c uint16\n\tvar s string\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(in, \"%d %d\\n\", &n, &m)\n\tfor i := uint8(0); i < n; i++ {\n\t\tfor j := uint8(0); j < m; j++ {\n\t\t\tfmt.Fscanf(in, \"%s\", &s)\n\t\t\tif s == \"W\" || s == \"G\" || s == \"B\" {\n\t\t\t\tc++\n\t\t\t}\n\t\t}\n\t}\n\tif c == uint16(n) * uint16(m)) {\n\t\tfmt.Println(\"#Black&White\")\n\t} else {\n\t\tfmt.Println(\"#Color\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "4ae8ad8f7730a0d50f36b0075ea84363", "src_uid": "19c311c02380f9a73cd477e4fde27454", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar in *bufio.Scanner\nvar out *bufio.Writer\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\tm, _ := strconv.Atoi(in.Text())\n\n\tres := \"#Black&White\"\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < m; j++ {\n\t\t\tin.Scan()\n\t\t\tc := in.Text()\n\t\t\tif (c != \"B\") && (c != \"W\") && (c != \"G\") {\n\t\t\t\tres = \"#Color\"\n\t\t\t}\n\t\t}\n\t}\n\n\tout.WriteString(res)\n\tout.WriteByte('\\n')\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "6ba67ba029add8de1e6d93a0efa33600", "src_uid": "19c311c02380f9a73cd477e4fde27454", "difficulty": 800.0} {"lang": "Go", "source_code": "\nimport \"fmt\"\n\nfunc main() {\n var n int\n var s string\n fmt.Scan(&n,&s)\n ans := 0\n for i := 1; i < n; i++ {\n if (s[i] == s[i-1]) { ans++ }\n }\n fmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "fb42c2e41313cca4d52d4bb6c29649c1", "src_uid": "d561436e2ddc9074b98ebbe49b9e27b8", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main10() {\n\t// rrr g bbbbb gg\n\tvar n int\n\tvar cu string\n\tfmt.Scanf(\"%d\", &n)\n\tfmt.Scanln(&cu)\n\tcorAnterior := cu[:1]\n\tpomba := 1\n\tfor i := 1; i < n; i++ {\n\t\tcorAtual := cu[i : i+1] // pegar i\n\t\tif corAtual != corAnterior {\n\t\t\tpomba++\n\t\t\tcorAnterior = corAtual\n\t\t}\n\t}\n\tfmt.Println(n - pomba)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "2450d77df9cf02573f4e648ec6487427", "src_uid": "d561436e2ddc9074b98ebbe49b9e27b8", "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\tintegerWord, _ := reader.ReadString('\\n')\n\tintegerSufx := strings.TrimSuffix(integerWord, \"\\r\\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": "bac33a199b045e80f0b224f206dc3a21", "src_uid": "d561436e2ddc9074b98ebbe49b9e27b8", "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\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\tttl := 0\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\tttl += count\n\t\t}\n\t}\n\tfmt.Print(ttl)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "97a1c9305a2f360b9b210fa96477d219", "src_uid": "d561436e2ddc9074b98ebbe49b9e27b8", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\nimport \"sort\"\nimport \"bufio\"\nimport \"os\"\nimport \"strconv\"\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n nums := make([]int, n)\n \n scanner := bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n \n for i:=0; scanner.Scan(); i++ {\n num, _ := strconv.Atoi(scanner.Text())\n nums[i] = num\n }\n sort.Ints(nums)\n \n var canFormTriangle bool\n for i:=2; i nums[i] {\n canFormTriangle = true\n break\n }\n }\n if canFormTriangle {\n fmt.Print(\"YES\")\n } else {\n fmt.Print(\"NO\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "9b2b747e6cfce5fe0c94eee81079f5ee", "src_uid": "897bd80b79df7b1143b652655b9a6790", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\n\nimport \"fmt\"\n\n\nfunc max(a,b int) \nint { \nif a > b {\n return a \n} else {\n return b \n} \n}\n\n\nfunc main() {\n \nvar n int\n \nvar a [3]int\n \nfmt.Scan(&n,&a[0],&a[1],&a[2])\n \ndp := make([]int,n+1)\n \ndp[0] = 0\n \nfor i := 1; i <= n; i++ {\n \ndp[i] = -999999999\n \nfor k := 0; k < 3; k++ {\n \nif (i-a[k]) >= 0 {\n \ndp[i] = max(dp[i],1+dp[i-a[k]])\n \n}\n \n}\n \n}\n \nfmt.Println(dp[n])\n\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "3ab645b86150987ab949284997e09350", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "difficulty": 1300.0} {"lang": "Go", "source_code": "package main\n\nfunc main() {\n var limak, bob int\n fmt.Scanf(\"%d %d\\n\", &limak, &bob)\n var res int\n for {\n if limak > bob {\n break\n }\n limak *= 3\n bob *= 2\n res++\n }\n fmt.Println(res)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a26ffc1902ea3fff05d0f5fbcbb40ea3", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"math\"\n)\n\nfunc check(e error) {\n\tif e != nil {\n\t\tpanic(e)\n\t}\n}\n\nfunc main() {\n\tprintf(\"%d\", Problem791A())\n}\n\nfunc Problem791A () int {\n\tidx := 0\n\tvar a,b int\n\tscanf(\"%d %d\\n\", &a, &b)\n\t\n\tfor a < b {\n\t\ta = a * 3\n\t\tb = b * 2\n\t\tidx+=1\n\t}\n\t\n\treturn idx\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": "2691fcead2ae92d4b8cb7edf8924e037", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc check(e error) {\n\tif e != nil {\n\t\tpanic(e)\n\t}\n}\n\nfunc main() {\n\tprintf(\"%d\", Problem379A())\n}\n\nfunc Problem791A () int {\n\tidx := 0\n\tvar a,b int\n\tscanf(\"%d %d\\n\", &a, &b)\n\t\n\tfor a < b {\n\t\ta = a * 3\n\t\tb = b * 2\n\t\tidx+=1\n\t}\n\t\n\treturn idx\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": "5ef0404777e07d3c4ffafc9885da83a6", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"math\"\n)\n\nfunc check(e error) {\n\tif e != nil {\n\t\tpanic(e)\n\t}\n}\n\nfunc main() {\n\tprintf(\"%d\", Problem379A())\n}\n\nfunc Problem791A () int {\n\tidx := 0\n\tvar a,b int\n\tscanf(\"%d %d\\n\", &a, &b)\n\t\n\tfor a < b {\n\t\ta = a * 3\n\t\tb = b * 2\n\t\tidx+=1\n\t}\n\t\n\treturn idx\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": "0f50f875073fd5162ca522bd98f4230f", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "difficulty": 800.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\tfmt.print(\"AAAAA\\n\");\n\t\tfmt.Printf(\"%d\\n\", cnt);\n\t\tbreak;\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "93a7bb2d9a3426c110b58ef72754bfd3", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "difficulty": 800.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.TrimSuffix(text, \"\\n\");\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\tfmt.println(b);\n\t\tfmt.Printf(\"%d %d\\n\", a, b);\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\tfmt.Printf(\"%d\\n\", cnt);\n\t\tbreak;\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "dc89ab4a73af05440b51702c136fa9d2", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "difficulty": 800.0} {"lang": "Go", "source_code": "// https://codeforces.com/problemset/problem/888/B\npackage main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"math\"\n)\n\nfunc move(pos []int, move rune) {\n\tswitch move {\n\tcase 'U':\n\t\tpos[1]++\n\tcase 'D':\n\t\tpos[1]--\n\tcase 'L':\n\t\tpos[0]--\n\tcase 'R':\n\t\tpos[0]++\n\t}\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tnumCommands, _ := strconv.ParseInt(scanner.Text(), 10, 32)\n\tpos := []int{0, 0}\n\tscanner.Scan()\n\tcmds := scanner.Text()\n\tfor i, cmd := range cmds {\n\t\tmove(pos, cmd)\n\t\t// fmt.Printf(\"%d - current position - %d, %d\\n\", i+1, pos[0], pos[1])\n\t}\n\tfmt.Printf(\"%d\", numCommands - int64(math.Abs(float64(pos[0]- 0))) - int64(math.Abs(float64(pos[1]-0))))\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "218c680086806db8ddbe72f2f4ff2112", "src_uid": "b9fa2bb8001bd064ede531a5281cfd8a", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"fmt\"\n\t\"math\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n\tscanner.Scan()\n\tx, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\treturn x\n}\nfunc getI() int {\n\treturn int(getI64())\n}\nfunc getF() float64 {\n\tscanner.Scan()\n\tx, _ := strconv.ParseFloat(scanner.Text(), 64)\n\treturn x\n}\nfunc getS() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc max(a,b int) int { if a > b { return a } else { return b } }\n\nfunc min(a,b int) int { if a < b { return a } else { return b } }\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\n\n\twriter.WriteString(fmt.Sprintf(\"%d\", Problem888B()))\n}\n\nfunc Problem888B() int {\n\tn := getI()\n\tx := 0\n\ty := 0\n\tfor i:= 0; i < n ; i++ {\n\t s := getS()\n\t switch(s){\n\t case \"U\":\n\t y+=1\n\t break\n\t case \"D\":\n\t y-=1\n\t break\n\t case \"L\":\n\t x-=1\n\t break\n\t case \"R\":\n\t x+=1\n\t break\n\t default:\n\t break\n\t }\n\t}\n\treturn n - (x-y)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "96e92c81507a57f15ae15aab6affd110", "src_uid": "b9fa2bb8001bd064ede531a5281cfd8a", "difficulty": 1000.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\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "758dd8504a881f52092ba0962f77256d", "src_uid": "699444eb6366ad12bc77e7ac2602d74b", "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 if a+b >= x+y\n return 0\n if a+b+c >= x+y+z\n return 0\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}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "78cbbe48435cf1481303395d1f18909d", "src_uid": "d54201591f7284da5e9ce18984439f4e", "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}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "c5d0109879410b2ea68b4cb2efa354e2", "src_uid": "d54201591f7284da5e9ce18984439f4e", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(x int, y int, z int, a int, b int, c int) int {\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}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "27feba0d42c22a8f266195ab2d5368c3", "src_uid": "d54201591f7284da5e9ce18984439f4e", "difficulty": 800.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 %d\\n\", &n, &m)\n\tvar s int\n\tvar scores []int\n\tfor j := 0; j < n; j++ {\n\t\tfmt.Scanf(\"%d\\n\", &s)\n\t\tscores = append(scores, s)\n\t}\n\tnum := 0\n\tm--\n\tt := scores[m]\n\tfor j =0; j= t {\n\t\t\tnum++\n\t\t}\n \n\t}\n\tfmt.Println(num)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "93eddbf66f939ef336940649d93595ef", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k, s, result int\n\tfmt.Scanf(\"%d %d\", &n, &k)\n\tscores := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\",&scores[i])\n\t}\n\tfor _, v := range scores {\n\t\tif v < scores[k-1] || v < 0 {\n\t\t\tbreak\n\t\t}\n\t\tresult++\n\t}\n\tfmt.Println(result)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "4d65f8ec8bdbc9541b8bba332879e613", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n \"fmt\"\n)\n \nfunc main(){\n var n, m int\n fmt.Scanf(\"%d\\n\", &n)\n var s int\n var scores []int\n for j := 0; jm){num++}\n \n }\n fmt.Println(num)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "0beae82aa56d2ecd0fb06385f23ae125", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tin := bufio.NewScanner(os.Stdin)\n\tin.Split(bufio.ScanWords)\n\tin.Scan()\n\tn, _ := strconv.Atoi(in.Text())\n\tin.Scan()\n\tk, _ := strconv.Atoi(in.Text())\n\tscores := []int{}\n\tpassCount := 0\n\tfor i := 0; i < n; i++ {\n\t\tin.Scan()\n\t\tscr, _ := strconv.Atoi(in.Text())\n\t\tscores = append(scores, scr)\n\t}\n\tpass := scores[n-k]\n\n\tsort.Ints(scores)\n\tfor _, val := range scores {\n\t\tif val > 0 && val >= pass {\n\t\t\tpassCount++\n\t\t}\n\t}\n\tfmt.Println(passCount)\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "821cbf270889f099dc365bdebb962571", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n \"fmt\"\n)\n \nfunc main(){\n var n, m int\n fmt.Scanf(\"%d\\n\", &n)\n var s int\n var scores []int\n for j := 0; jm)\n num++\n }\n fmt.Println(num)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "86706083b11fb8bf289cc8f9ee558dcb", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n, k, border int\n\n fmt.Scanf(\"%d %d\", &n, &k)\n\n ints := make([]interface{}, 50)\n vals := make([]int, len(ints))\n\n for i, _ := range ints {\n ints[i] = interface{}(&vals[i])\n }\n fmt.Scan(ints...)\n\n border := vals[k]\n num := 0\n\n if border == 0 {\n fmt.Println(0)\n } else {\n for i, _ := range vals {\n if vals[i] < border {\n num++\n }\n }\n fmt.Println(num)\n }\n\n //fmt.Println(vals)\n //fmt.Println(n, k)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "276bd40416bb492f30ccbd68221803e9", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nconst (\n maxn = 55\n)\n\nvar arr = [maxn]int{}\n\nfunc main() {\n var n, k int\n fmt.Scan(&n, &k)\n for i := 0; i < n; i++ {\n fmt.Scan(&a[i])\n }\n var ans int\n for i := 0; i < n; i++ {\n if a[i] > 0 && a[i] >= a[k-1] {\n ans++\n }\n }\n fmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "0651e222bd4b723fe9ec7b12de66761a", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tin := bufio.NewSc anner(os.Stdin)\n\tin.Split(bufio.ScanWords)\n\tin.Scan()\n\tn, _ := strconv.Atoi(in.Text())\n\tin.Scan()\n\tk, _ := strconv.Atoi(in.Text())\n\tscores := []int{}\n\tpassCount := 0\n\tfor i := 0; i < n; i++ {\n\t\tin.Scan()\n\t\tscr, _ := strconv.Atoi(in.Text())\n\t\tscores = append(scores, scr)\n\t}\n\tpass := scores[n-k]\n\n\tsort.Ints(scores)\n\tfor _, val := range scores {\n\t\tif val > 0 && val >= pass {\n\t\t\tpassCount++\n\t\t}\n\t}\n\tfmt.Println(passCount)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "1999a0ee0f00c3e32ed9d1637e3a014a", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nconst (\n maxn = 55\n)\n\nvar a [maxn]int\n\nfunc main() {\n var n, k int\n fmt.Scan(&n, &k)\n for i := 0; i < n; i++ {\n fmt.Scan(&a[i])\n }\n var ans int\n for i := 0; i < n; i++ {\n if a[i] > 0 && a[i] >= a[k-1] {\n ans++\n }\n }\n var sc = fmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "1c66f06821d5987e948c0b41e34f1a16", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nconst (\n maxn = 55\n)\n\nvar arr = [maxn]int\n\nfunc main() {\n var n, k int\n fmt.Scan(&n, &k)\n for i := 0; i < n; i++ {\n fmt.Scan(&a[i])\n }\n var ans int\n for i := 0; i < n; i++ {\n if a[i] > 0 && a[i] >= a[k-1] {\n ans++\n }\n }\n fmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "7b0cd6ce8ac199554330a2c3fa436cd5", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n \"fmt\"\n)\n \nfunc main(){\n var n, m int\n fmt.Scanf(\"%d\\n\", &n)\n var s int\n var scores []int\n for j := 0; jm){num++}\n \n }\n fmt.Println(num)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "564fa1ed09b1e2725703266c3d25171d", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n \"fmt\"\n)\n \nfunc main(){\n var n, m int\n fmt.Scanf(\"%d\\n\", &n)\n var s int\n var scores []int\n for j := 0; jm)\n num++\n }\n fmt.Println(num)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "3eaefdf77a9633486feb61a8ac884a9c", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\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 s string\n\tfor I(&s, \"\\n\") == nil {\n\t\tsolve(s)\n\t}\n}\n\nfunc solve(s string) {\n\ta := \"AEIOUY\"\n\tp, m := 0, 0\n\tfor i, c := range s {\n\t\tp++\n\t\tif strings.ContainsRune(a, rune(c)) || i == len(s)-1 {\n\t\t\tif m < p {\n\t\t\t\tm = p\n\t\t\t}\n\t", "lang_cluster": "Go", "compilation_error": true, "code_uid": "1af9e66ca293f9e9e251bce20bfe5b8b", "src_uid": "1fc7e939cdeb015fe31f3cf1c0982fee", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string\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": "a18647783134d309bc2f93983e600f5e", "src_uid": "1fc7e939cdeb015fe31f3cf1c0982fee", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n \nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n \nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tsp := []int{a, b}\n\tsort.Ints(mas)\n\tk := sp[0]\n\tk2 := (sp[1] - sp[0]) / 2\n\tfmt.Println(k, k2)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "26f0f738d061fe5396919485393929e7", "src_uid": "775766790e91e539c1cfaa5030e5b955", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\nimport (\n\t\"fmt\"\n)\n\nfunc shot(dragons []bool, d int) {\n\tfor i := d; i <= len(dragons); i += d {\n\t\tdragons[i-1] = true\n\t}\n}\n\nfunc main() {\n\tvar k, l, m, n, d int\n\tfmt.Scan(&k, &l, &m, &n, &d)\n\tdragons := make([]bool, d)\n\tfor _, v := range []int{k,l,m,n} {\n\t\tshot(dragons, v)\n\t}\n\tcount := 0\n\tfor _, el := range dragons {\n\t\tif el {\n\t\t\tcount++\n\t\t}\n\t}\n\t//fmt.Println(dragons)\n\tfmt.Println(count)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "0f50c31ef450e623afc1647c4b07d64d", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "difficulty": 800.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\treturn delta%s == 0 || (delta/s >= 1 && delta%s == 1)\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": "d1b9b7e59d7313c3f04f927d9afec826", "src_uid": "3baf9d841ff7208c66f6de1b47b0f952", "difficulty": 900.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\treturn (delta%s) == 0 || (delta/s >= 1 && delta%s == 1)\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": "053ec7712c0977966c0adb800ac9610a", "src_uid": "3baf9d841ff7208c66f6de1b47b0f952", "difficulty": 900.0} {"lang": "Go", "source_code": "// You can edit this code!\n// Click here and start typing.\npackage main\n\nimport \"fmt\"\nimport \"strconv\"\nimport \"os\"\nimport \"bufio\"\n\nfunc main() {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\n\ts.Scan()\n\tstart := strconv.Atoi(s.Text())\n\ts.Scan()\n\tevery := strconv.Atoi(s.Text())\n\ts.Scan()\n\teat := strconv.Atoi(s.Text())\n\n\tif eat == start {\n\t\tfmt.Println(\"YES\")\n\t}\n\n\tfor i := start + every; i <= eat; i += every {\n\t\tif eat == i || eat == i+1 {\n\t\t\tfmt.Println(\"YES\")\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\n\tfmt.Println(\"NO\")\n\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "f44f2614dd5f358464393a1c72422d65", "src_uid": "3baf9d841ff7208c66f6de1b47b0f952", "difficulty": 900.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\treadInt()\n\ta := []rune(readString())\n\td := map[rune]int{}\n\tbest := 0\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] >= 'A' && a[i] <= 'Z' {\n\t\t\tif len(d) > 0 {\n\t\t\t\td = map[rune]int{}\n\t\t\t}\n\t\t} else {\n\t\t\td[a[i]]++\n\t\t\tbest = max(best, len(d))\n\t\t}\n\t}\n\tfmt.Println(best)\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, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\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 max(a, 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": "090b7acecdc0cb1003e7b14243d686cc", "src_uid": "567ce65f87d2fb922b0f7e0957fbada3", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var h1, m1, h2, h2 int\n fmt.Scanf(\"%d:%d\\n%d:%d\", &h1, &m1, &h2, &m2)\n \n t1, t2 := h1 * 60 + m1, h2 * 60 + m2\n t3 := t1 + (t2 - t1) / 2\n \n fmt.Printf(\"%d:%d\", t3 / 60, t3 % 60)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "0978de239cae69f814c82a7c5dc9c10c", "src_uid": "f7a32a8325ce97c4c50ce3a5c282ec50", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var h1, m1, h2, m2 int\n fmt.Scanf(\"%d:%d\\n%d:%d\", &h1, &m1, &h2, &m2)\n \n t1, t2 := h1 * 60 + m1, h2 * 60 + m2\n t3 := t1 + (t2 - t1) / 2\n \n h3, m3 := t3 / 60, m3 % 60\n if h3 < 10 {\n fmt.Printf(\"0%d\", h3)\n } else {\n fmt.Printf(\"%d\", h3)\n }\n fmt.Printf(\":\")\n if m3 < 10 {\n fmt.Printf(\"0%d\", m3)\n } else {\n fmt.Printf(\"%d\", m3)\n }\n \n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "6a2f25fbc2cdfc8a7d3abc8338040d99", "src_uid": "f7a32a8325ce97c4c50ce3a5c282ec50", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar reader = bufio.NewReader(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\n\nfunc getLine() string {\n\ts, _ := reader.ReadString('\\n')\n\tif strings.HasSuffix(s, \"\\r\\n\") {\n\t\ts = s[:len(s)-2]\n\t} else if strings.HasSuffix(s, \"\\n\") {\n\t\ts = s[:len(s)-1]\n\t}\n\treturn s\n}\nfunc getLine2Int() (n int) {\n\tscanf(\"%d\\n\", &n)\n\treturn\n}\nfunc getLine2Int2() (a, b int) {\n\tscanf(\"%d %d\\n\", &a, &b)\n\treturn\n}\nfunc getLine2Ints(n int) []int {\n\tans := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tscanf(\"%d \", &ans[i])\n\t}\n\tscanf(\"%d\\n\", &ans[n-1])\n\treturn ans\n}\n\nfunc pcheck(i bool) {\n\tif i {\n\t\tprintf(\"YES\\n\")\n\t} else {\n\t\tprintf(\"NO\\n\")\n\t}\n}\n\nvar debug = true\n\nfunc see(a interface{}) {\n\tif debug {\n\t\tprintf(\"DEBUG:%v\\n\", a)\n\t}\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\n\tvar h1, m1, h2, m2 int\n\tscanf(\"%d:%d\\n%d:%d\\n\", &h1, &m1, &h2, &m2)\n\tm := ((h1+h2)*60 + m1 + m2) / 2\n\tprintf(\"%02d:%02d\\n\", m/60, m%60)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "ca8753598f64a7ddc6ea28b01d221f80", "src_uid": "f7a32a8325ce97c4c50ce3a5c282ec50", "difficulty": 1000.0} {"lang": "Go", "source_code": "import (\n \"fmt\"\n)\n\nfunc main() {\n var h1, m1, h2, h2 int\n fmt.Scanf(\"%d:%d\\n%d:%d\", &h1, &m1, &h2, &m2)\n \n t1, t2 := h1 * 60 + m1, h2 * 60 + m2\n t3 := t1 + (t2 - t1) / 2\n \n fmt.Printf(\"%d:%d\", t3 / 60, t3 % 60)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "c89130a13541ce12cc05afed98e9289f", "src_uid": "f7a32a8325ce97c4c50ce3a5c282ec50", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\ntype tStrct struct {\n\tdays, index int\n}\n\ntype tArray []tStrct\n\nfunc (l tArray) Len() int {\n\treturn len(l)\n}\nfunc (l tArray) Less(i, j int) bool {\n\treturn l[i].days < l[j].days\n}\nfunc (l tArray) Swap(i, j int) {\n\tl[i], l[j] = l[j], l[i]\n}\n\nvar readWriter = bufio.NewReadWriter(\n\tbufio.NewReader(os.Stdin),\n\tbufio.NewWriter(os.Stdout))\n\nfunc main() {\n\tdefer readWriter.Flush()\n\tvar n, k, a int\n\tfmt.Fscan(readWriter, &n, &k)\n\tl := make(tArray, n+1)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscan(readWriter, &a)\n\t\tl[i] = tStrct{a, i+1}\n\t}\n\tl[n].days = 1<<30\n\tsort.Sort(l)\n\tfor i, cur := range l {\n\t\tk -= cur.days\n\t\tif k < 0 {\n\t\t\ta = i\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Fprintln(readWriter, a)\n\tfor _, cur := range l[:a] {\n\t\tfmt.Fprint(readWriter, cur.index, \" \")\n\t}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "db4080b6997e0a6f392a0fd60046e60a", "src_uid": "dbb164a8dd190e63cceba95a31690a7c", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n, k int\n fmt.Scanf(\"%d %d\\n\", &n, %k)\n for i := 0; i < k; i++ {\n if n % 10 == 0 {\n n = n / 10\n } else {\n n--\n }\n }\n fmt.Println(n)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "0a9d2b0419dbf37811f999ffd3d8c062", "src_uid": "064162604284ce252b88050b4174ba55", "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+11))\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:=readInt();\n\tk:=readInt();\n\n\tvar ans int = 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": "52201a28f2b73b70d03d8db419e2a986", "src_uid": "064162604284ce252b88050b4174ba55", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\nfunc dec(n int) int {\n if n<=0{\n return 0\n }\n if n%10 == 0 {\n return n/10\n }\n return n--;\n}\nfunc main() {\n var n, k int\n fmt.Scanf(\"%d\", &n)\n fmt.Scanf(\"%d\", &k)\n for ;k-->0;{\n n = dec(n);\n }\n\n fmt.Printf(\"%d\", n)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "96ecd26b20410d623831f1459ad0e4fd", "src_uid": "064162604284ce252b88050b4174ba55", "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+11))\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": "2283182f199e29e2fef939d9022afc37", "src_uid": "064162604284ce252b88050b4174ba55", "difficulty": 800.0} {"lang": "Go", "source_code": "import \"fmt\"\n\nfunc main() {\n\n\tvar n, k int\n\t_, _ = fmt.Scan(&n, &k)\n\n\tfor i := 0; i < k; i++ {\n\t\tif n%10 == 0 {\n\t\t\tn /= 10\n\t\t} else {\n\t\t\tn--\n\t\t}\n\t}\n\n\tfmt.Println(n)\n\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "86e40d8e868100b9ab734693b506da44", "src_uid": "064162604284ce252b88050b4174ba55", "difficulty": 800.0} {"lang": "Go", "source_code": "import \"fmt\"\n\nfunc main(){\n fmt.Println(\"hi\")\n \n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "c7027ed99fbdd65dcd27e73daa54707a", "src_uid": "064162604284ce252b88050b4174ba55", "difficulty": 800.0} {"lang": "Go", "source_code": "//A. Wrong Subtraction\n\n/*\nLittle girl Tanya is learning how to decrease a number by one, but she does it wrong with a number consisting of two or more digits. Tanya subtracts one from a number by the following algorithm:\n\n if the last digit of the number is non-zero, she decreases the number by one;\n if the last digit of the number is zero, she divides the number by 10 (i.e. removes the last digit).\n\nYou are given an integer number \ud835\udc5b\n. Tanya will subtract one from it \ud835\udc58 times. Your task is to print the result after all \ud835\udc58\n\nsubtractions.\n\nIt is guaranteed that the result will be positive integer number.\nInput\n\nThe first line of the input contains two integer numbers \ud835\udc5b\nand \ud835\udc58 (2\u2264\ud835\udc5b\u2264109, 1\u2264\ud835\udc58\u226450\n\n) \u2014 the number from which Tanya will subtract and the number of subtractions correspondingly.\nOutput\n\nPrint one integer number \u2014 the result of the decreasing \ud835\udc5b\nby one \ud835\udc58\n\ntimes.\n\nIt is guaranteed that the result will be positive integer number.\n\nExamples\nInput\n512 4\n\nOutput\n50\n\nInput\n1000000000 9\n\nOutput\n1\n\nNote: The first example corresponds to the following sequence: 512\u2192511\u2192510\u219251\u219250\n*/\npackage main\n\nimport (\n\tassert \"github.com/rnd\"\n)\n\nfunc main() {\n\tassert.Assert(substract(512, 4), 50)\n\tassert.Assert(substract(1000000000, 9), 1)\n}\n\nfunc substract(n, k int) int {\n\tfor i := 0; i < k; i++ {\n\t\tif n%10 == 0 {\n\t\t\tn /= 10\n\t\t} else {\n\t\t\tn--\n\t\t}\n\t}\n\treturn n\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a1f833ca08e4d8bff3a8af6e664bf96b", "src_uid": "064162604284ce252b88050b4174ba55", "difficulty": 800.0} {"lang": "Go", "source_code": "import \"fmt\"\n\nfunc main() {\n var n, k int\n fmt.Scanf(\"%d %d\\n\", &n, %k)\n for i := 0; i < k; i++ {\n if n % 10 == 0 {\n n = n / 10\n } else {\n n--\n }\n }\n fmt.Println(n)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "d1c3223ddce1fa933d011bc9628686ec", "src_uid": "064162604284ce252b88050b4174ba55", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t runes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n }\n\nfunc main(){\n\tvar x, y string\n\t\n\n\tfmt.Scanf(\"%s\\n%s\", &x, &y)\n\n\tc := reverse(x)\n\n\tif c == y {\n\t\tfmt.Println(\"YES\")\n\t}else{\n\t\tfmt.Println(\"NO\")\n\t}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "d65e4df2f4d18b8b9db39c4e17e9b371", "src_uid": "35a4be326690b58bf9add547fb63a5a5", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n \"fmt\"\n \"unicode\"\n \"unicode/utf8\"\n)\n \n// no encoding\nfunc reverseBytes(s string) string {\n r := make([]byte, len(s))\n for i := 0; i < len(s); i++ {\n r[i] = s[len(s)-1-i]\n }\n return string(r)\n}\n \n// reverseCodePoints interprets its argument as UTF-8 and ignores bytes\n// that do not form valid UTF-8. return value is UTF-8.\nfunc reverseCodePoints(s string) string {\n r := make([]rune, len(s))\n start := len(s)\n for _, c := range s {\n // quietly skip invalid UTF-8\n if c != utf8.RuneError {\n start--\n r[start] = c\n }\n }\n return string(r[start:])\n}\n \n// reversePreservingCombiningCharacters interprets its argument as UTF-8\n// and ignores bytes that do not form valid UTF-8. return value is UTF-8.\nfunc reversePreservingCombiningCharacters(s string) string {\n if s == \"\" {\n return \"\"\n }\n p := []rune(s)\n r := make([]rune, len(p))\n start := len(r)\n for i := 0; i < len(p); {\n // quietly skip invalid UTF-8\n if p[i] == utf8.RuneError {\n i++\n continue\n }\n j := i + 1\n for j < len(p) && (unicode.Is(unicode.Mn, p[j]) ||\n unicode.Is(unicode.Me, p[j]) || unicode.Is(unicode.Mc, p[j])) {\n j++\n }\n for k := j - 1; k >= i; k-- {\n start--\n r[start] = p[k]\n }\n i = j\n }\n return (string(r[start:]))\n}\n\nfunc main() {\n fmt.Scanln(s)\n fmt.Scanln(r)\n if r = reverseCodePoints(s){\n fmt.Println(\"YES\")\n }\n else {fmt.Println(\"NO\")\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "e2e52c22aa851c1ca10154311bc88549", "src_uid": "35a4be326690b58bf9add547fb63a5a5", "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\tarr := gsls(reader)\n\trot := gsli(reader)[0]\n\n\tstart := pos(arr[0])\n\tend := pos(arr[1])\n\n\t// fmt.Printf(\"arr: %#v \\n rot: %#v \\n start: %v \\n end: %v\", arr, rot, start, end)\n\n\tcwEnd := posMod(start+rot, 4)\n\tccwEnd := posMod(start-rot, 4)\n\n\tdiff := posMod(end-start, 4)\n\n\tif diff == 0 || diff == 2 {\n\t\tfmt.Print(\"undefined\")\n\t} else if end == cwEnd {\n\t\tfmt.Print(\"cw\")\n\t} else if end == ccwEnd {\n\t\tfmt.Print(\"ccw\")\n\t} else {\n\t\tfmt.Printf(\"cwEnd = %v, ccwEnd = %v\", cwEnd, ccwEnd)\n\t}\n\treturn\n}\n\nfunc pos(x string) (pos int) {\n\tswitch x {\n\tcase \"^\":\n\t\tpos = 0\n\tcase \">\":\n\t\tpos = 1\n\tcase \"v\":\n\t\tpos = 2\n\tcase \"<\":\n\t\tpos = 3\n\t}\n\n\treturn\n}\n\n// Input helpers\n\n// If you don't pass in a reference to the reader, and just instantiate a new\n// one every time, it will work locally, with IO typed at human-speed, but not\n// on Codeforces.\n\n// Get Space-separated Line as Strings\n//\n// Example input:\n// 1 test 382.0\n// Example output:\n// [\"1\", \"test\", \"382.0\"]\n\nfunc gsls() (arr []string) {\n\t// Get a full line\n\treader := bufio.NewReader(os.Stdin)\n\tinput, _ := reader.ReadString('\\n')\n\n\t//Strip newline and return chars, if any\n\tinput = strings.TrimSuffix(input, \"\\n\")\n\tinput = strings.TrimSuffix(input, \"\\r\")\n\n\t// Split at the spaces into an array\n\tarr = strings.Split(input, \" \")\n\n\treturn\n}\n\n// Get Space-separated Line as Integers\n// Any non-valid integers will be 0\n//\n// Example input:\n// test 1 12.3 -117\n// Example output:\n// [0, 1, 0, -117]\n\nfunc gsli(reader *bufio.Reader) (arr []int) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.Atoi(e)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Get Space-separated Line as 64-bit Floats\n// Any non-valid floats will be 0\n//\n// Example input:\n// test 128.328 12 -11.0\n// Example output:\n// [0, 128.328, 12, -11]\n\nfunc gslf(reader *bufio.Reader) (arr []float64) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.ParseFloat(e, 64)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Math helpers\n\n// Positve Modulo\n// Returns x mod y, but always positive\n\nfunc posMod(x, y int) int {\n\treturn (x%y + y) % y\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "5ba14d740fa557d1a3394d35ab3d2a0d", "src_uid": "fb99ef80fd21f98674fe85d80a2e5298", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int64\n fmt.Scan(&n)\n\n p := 1\n if n % 2 == 1 {\n p = -1\n }\n\n fmt.Println(((n + 1) / 2) * p)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "02d6e110e861b1f5698cef77d37e552d", "src_uid": "689e7876048ee4eb7479e838c981f068", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc check(e error) {\n\tif e != nil {\n\t\tpanic(e)\n\t}\n}\n\nfunc main() {\n\trs := Problem486A()\n\tprintf(\"%d\", rs)\n}\n\nfunc Problem486A() int {\n\tvar n int\n\tscanf(\"%d\\n\", &n)\n\tif n % 2 > 0 {\n\t\treturn (( n + 1 ) / 2 ) - ( ( ( n + 1 ) / 2 ) * 2 )\n\t}else {\n\t\treturn n / 2\n\t}\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": "f73fcf8186ddade933fb07d8cbdf6018", "src_uid": "689e7876048ee4eb7479e838c981f068", "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\tin := bufio.NewReader(os.Stdin)\n\tvar n uint64\n\tvar c int64\n\tfmt.Fscanf(in, \"%d\\n\", &n)\n\tfor i:=1; uint32(i) <= n; i++{\n\t\tif i % 2 != 0{\n\t\t\tc -= int32(i);\n\t\t}else{\n\t\t\tc += int32(i);\n\t\t}\n\t}\n\tfmt.Println(c)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "485db95e712af5f808f1cc4533ead7df", "src_uid": "689e7876048ee4eb7479e838c981f068", "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.Scan(&s)\n var howmanya = strings.Count(s, \"a\")\n\tvar long = len(s)\n\tif 2*howmanya > long {\n\t\tfmt.Print(long)\n\t}\n else {\n\t\tfmt.Print(howmanya * 2 - 1)\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "0e1b2bffeddd21b64dee94f546be5db3", "src_uid": "84cb9ad2ae3ba7e912920d7feb4f6219", "difficulty": 800.0} {"lang": "Go", "source_code": "// Codeforces helper functions\n// 20 Jan 18\n// samadhi\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nconst debug = true\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\n}\n\n// Input helpers\n\n// If you don't pass in a reference to the reader, and just instantiate a new\n// one every time, it will work locally, with IO typed at human-speed, but not\n// on Codeforces.\n\n// Get Space-separated Line as Strings\n//\n// Example input:\n// 1 test 382.0\n// Example output:\n// [\"1\", \"test\", \"382.0\"]\n\nfunc gsls(reader *bufio.Reader) (arr []string) {\n\t// Get a full line\n\tinput, _ := reader.ReadString('\\n')\n\n\t//Strip newline and return chars, if any\n\tinput = strings.TrimSuffix(input, \"\\n\")\n\tinput = strings.TrimSuffix(input, \"\\r\")\n\n\t// Split at the spaces into an array\n\tarr = strings.Split(input, \" \")\n\n\treturn\n}\n\n// Get Space-separated Line as Integers\n// Any non-valid integers will be 0\n//\n// Example input:\n// test 1 12.3 -117\n// Example output:\n// [0, 1, 0, -117]\n\nfunc gsli(reader *bufio.Reader) (arr []int) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.Atoi(e)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Get Space-separated Line as 64-bit Floats\n// Any non-valid floats will be 0\n//\n// Example input:\n// test 128.328 12 -11.0\n// Example output:\n// [0, 128.328, 12, -11]\n\nfunc gslf(reader *bufio.Reader) (arr []float64) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.ParseFloat(e, 64)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// String helpers\n\n// Is Lowercase\n// Given some string[i], return whether it is lower case or not.\n\nfunc isl(b byte) bool {\n\tvar r rune\n\tr = rune(b)\n\treturn unicode.IsLower(r)\n}\n\n// Math helpers\n\n// Positve Modulo\n// Returns x mod y, but always positive\n\nfunc posMod(x, y int) int {\n\treturn (x%y + y) % y\n}\n\n// Max Int\n// Returns the max of two ints\n\nfunc maxInt(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\n// Distance formule\n// Calculates the distance to the origin\n\nfunc dist(x, y float64) float64 {\n\treturn math.Sqrt(math.Pow(x, 2) + math.Pow(y, 2))\n}\n\n// Output helpers\n\nfunc yes() {\n\tfmt.Println(\"Yes\")\n}\n\nfunc no() {\n\tfmt.Println(\"No\")\n}\n\n// Debug helpers\n\n// From https://groups.google.com/forum/#!topic/golang-nuts/Qlxs3V77nss\n\nfunc dbg(s string, a ...interface{}) {\n\tif debug {\n\t\tfmt.Printf(s, a...)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "91b029fcde0845f1b1cf1d694e46d162", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nreader := bufio.NewReader(os.Stdin)\nwriter := bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(writer, f, a...) }\n\nfunc main() {\n\t// FLUSH STDOUT\n\tdefer writer.Flush()\n\n\tvar a int\n\tscanf(\"%d\\n\", &a)\n\n\tif a%2 == 1 {\n\t\tprintf(\"Ehab\\n\")\n\t} else {\n\t\tprintf(\"Mahmoud\\n\")\n\t}\n\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "b6414eeb2c0976f4a40b31d5e4fa2f69", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "difficulty": 800.0} {"lang": "Go", "source_code": "// Codeforces helper functions\n// 20 Jan 18\n// samadhi\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nconst debug = true\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\n\tn := gsli(reader)[0]\n\n\tif n%2 == 0 {\n\t\tfmt.Println(\"Mahmoud\")\n\t} else {\n\t\tfmt.Println(\"Ehab\")\n\t}\n\n}\n\n}\n\n// Input helpers\n\n// If you don't pass in a reference to the reader, and just instantiate a new\n// one every time, it will work locally, with IO typed at human-speed, but not\n// on Codeforces.\n\n// Get Space-separated Line as Strings\n//\n// Example input:\n// 1 test 382.0\n// Example output:\n// [\"1\", \"test\", \"382.0\"]\n\nfunc gsls(reader *bufio.Reader) (arr []string) {\n\t// Get a full line\n\tinput, _ := reader.ReadString('\\n')\n\n\t//Strip newline and return chars, if any\n\tinput = strings.TrimSuffix(input, \"\\n\")\n\tinput = strings.TrimSuffix(input, \"\\r\")\n\n\t// Split at the spaces into an array\n\tarr = strings.Split(input, \" \")\n\n\treturn\n}\n\n// Get Space-separated Line as Integers\n// Any non-valid integers will be 0\n//\n// Example input:\n// test 1 12.3 -117\n// Example output:\n// [0, 1, 0, -117]\n\nfunc gsli(reader *bufio.Reader) (arr []int) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.Atoi(e)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Get Space-separated Line as 64-bit Floats\n// Any non-valid floats will be 0\n//\n// Example input:\n// test 128.328 12 -11.0\n// Example output:\n// [0, 128.328, 12, -11]\n\nfunc gslf(reader *bufio.Reader) (arr []float64) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.ParseFloat(e, 64)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// String helpers\n\n// Is Lowercase\n// Given some string[i], return whether it is lower case or not.\n\nfunc isl(b byte) bool {\n\tvar r rune\n\tr = rune(b)\n\treturn unicode.IsLower(r)\n}\n\n// Math helpers\n\n// Positve Modulo\n// Returns x mod y, but always positive\n\nfunc posMod(x, y int) int {\n\treturn (x%y + y) % y\n}\n\n// Max Int\n// Returns the max of two ints\n\nfunc maxInt(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\n// Distance formule\n// Calculates the distance to the origin\n\nfunc dist(x, y float64) float64 {\n\treturn math.Sqrt(math.Pow(x, 2) + math.Pow(y, 2))\n}\n\n// Output helpers\n\nfunc yes() {\n\tfmt.Println(\"Yes\")\n}\n\nfunc no() {\n\tfmt.Println(\"No\")\n}\n\n// Debug helpers\n\n// From https://groups.google.com/forum/#!topic/golang-nuts/Qlxs3V77nss\n\nfunc dbg(s string, a ...interface{}) {\n\tif debug {\n\t\tfmt.Printf(s, a...)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "bcacda078cdf24e5ee14a5b175a121f4", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "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\tisUnique := false\n\tfor !isUnique {\n\t\tyear++\n\t\ts := strconv.Itoa(year)\n\t\tfor _, val := range s {\n\t\t\tif strings.Count(s, 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\tif isUnique {\n\t\t\tbreak\n\t\t}\n\t}\n\tif isUnique {\n\t\tfmt.Println(year)\n\t}\n\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "42ddcaaa02ea369e8b81c455b2066511", "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, 10)\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": "6fa444eebdfade11ac77c20d1ec02df7", "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.Atoi(year)\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": "46d84ac5cec84f6887a2cef9b8fe80d0", "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\tisUnique := false\n\tfor !isUnique {\n\t\tyearInt, _ := strconv.Atoi(year)\n\t\tyearInt++\n\t\ts := strconv.Itoa(yearInt)\n\t\tfor _, val := range s {\n\t\t\tif strings.Count(s, 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\tif isUnique {\n\t\t\tbreak\n\t\t}\n\t}\n\tif isUnique {\n\t\tfmt.Print(yearInt)\n\t}\n\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "dfc885a4b77584db40cee92509913072", "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\tisUnique := false\n\tfor !isUnique {\n\t\tyear++\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\tif isUnique {\n\t\t\tbreak\n\t\t}\n\t}\n\tif isUnique {\n\t\tfmt.Println(year)\n\t}\n\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "0d93d1640ae0c14e9f1692e11c16864c", "src_uid": "d62dabfbec52675b7ed7b582ad133acd", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/golang-collections/collections/set\"\n)\n\nvar s string\n\nfunc main() {\n\tstdin := os.Stdin\n\t// stdin, _ = os.Open(\"1.in\")\n\treader := bufio.NewReaderSize(stdin, 1<<20)\n\tfmt.Fscanf(reader, \"%s\\n\", &s)\n\n\tS := set.New()\n\tfor i := 0; i < len(s); i++ {\n\t\tS.Insert(s[i])\n\t}\n\n\tif S.Len()%2 == 1 {\n\t\tfmt.Println(\"IGNORE HIM!\")\n\t} else {\n\t\tfmt.Println(\"CHAT WITH HER!\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "dd04060e6cdb8fb32fed7c097749af5e", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/emirpasic/gods/sets/hashset\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tst := hashset.New()\n\tfor i := range s {\n\t\tst.Add(s[i])\n\t}\n\tif st.Size()%2 == 0 {\n\t\tfmt.Print(\"CHAT WITH HER!\")\n\t} else {\n\t\tfmt.Print(\"IGNORE HIM!\")\n\t}\n\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a31980c59ebfa6b8b29325cee7343eff", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "difficulty": 800.0} {"lang": "Go", "source_code": "/* https://codeforces.com/problemset/problem/236/A\nA. Boy or Girl\ntime limit per test1 second\nmemory limit per test256 megabytes\ninputstandard input\noutputstandard output\nThose days, many boys use beautiful girls' photos as avatars in forums. So it is pretty hard to tell the gender of a user at the first glance. Last year, our hero went to a forum and had a nice chat with a beauty (he thought so). After that they talked very often and eventually they became a couple in the network.\n\nBut yesterday, he came to see \"her\" in the real world and found out \"she\" is actually a very strong man! Our hero is very sad and he is too tired to love again now. So he came up with a way to recognize users' genders by their user names.\n\nThis is his method: if the number of distinct characters in one's user name is odd, then he is a male, otherwise she is a female. You are given the string that denotes the user name, please help our hero to determine the gender of this user by his method.\n\nInput\nThe first line contains a non-empty string, that contains only lowercase English letters \u2014 the user name. This string contains at most 100 letters.\n\nOutput\nIf it is a female by our hero's method, print \"CHAT WITH HER!\" (without the quotes), otherwise, print \"IGNORE HIM!\" (without the quotes).\n\nExamples\ninputCopy\nwjmzbmr\noutputCopy\nCHAT WITH HER!\ninputCopy\nxiaodao\noutputCopy\nIGNORE HIM!\ninputCopy\nsevenkplus\noutputCopy\nCHAT WITH HER!\nNote\nFor the first example. There are 6 distinct characters in \"wjmzbmr\". These characters are: \"w\", \"j\", \"m\", \"z\", \"b\", \"r\". So wjmzbmr is a female and you should print \"CHAT WITH HER!\".\n*/\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/mpvl/unique\"\n)\n\nfunc main() {\n\t// define input variable\n\tvar name string\n\n\t// take input variable\n\tfmt.Scanln(&name)\n\n\t// convert input string to slice for unique.Strings\n\tsplit_name := strings.Split(name, \"\")\n\n\t// reduce slice to distinct characters\n\tunique.Strings(&split_name)\n\n\t// check if the length of the distinct characters in the slice is even or odd and print output\n\tif len(split_name)%2 == 0 {\n\t\tfmt.Println(\"CHAT WITH HER!\")\n\t} else {\n\t\tfmt.Println(\"IGNORE HIM!\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "b38a435f0f2d64b561540af8006c30fc", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"fmt\"\n\t\"math\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n\tscanner.Scan()\n\tx, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\treturn x\n}\nfunc getI() int {\n\treturn int(getI64())\n}\nfunc getF() float64 {\n\tscanner.Scan()\n\tx, _ := strconv.ParseFloat(scanner.Text(), 64)\n\treturn x\n}\nfunc getS() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc max(a,b int) int { if a > b { return a } else { return b } }\n\nfunc min(a,b int) int { if a < b { return a } else { return b } }\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\n\n\twriter.WriteString(fmt.Sprintf(\"%s\", Problem705A()))\n}\n\nfunc Problem705A() string {\n\tn := getI64()\n\tx := getI64()\n\ty := getI64()\n\t\n\tif (x-1 + y-1) <= (n-x + n-y) {\n\t\treturn \"White\"\n\t} else {\n\t\treturn \"Black\"\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "9c36a6009e924f23468dd99e0e864378", "src_uid": "b8ece086b35a36ca873e2edecc674557", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tn,m:=0,0\n\tfmt.Scanln(&n,&m)\n\t// fmt.Println(n,m)\n\tans:=math.MaxInt64\n\tfor i := 0; i <= n; i++ {\n\t\tfor j := 0; j <= n; j++{\n\t\t\tfor k := 0; k <= n; k++ {\n\t\t\t\tfor l := 0; l <= n; l++ {\n\t\t\t\t\tif i+j+k+l==n && 2*i+3*j+4*k+5*l==m{\n\t\t\t\t\t\tif i g {\n\t\treturn n\n\t} else {\n\t\treturn g\n\t}\n}\n\nfunc Min(n int, g int) int {\n\tif n > g {\n\t\treturn g\n\t} else {\n\t\treturn n\n\t}\n}\n\nfunc main() {\n\tvar f string\n\n\tvar str, goal string\n\t//var buffer bytes.Buffer\n\n\tfmt.Scan(&goal)\n\tfmt.Scan(&str)\n\n\tpos, neg, q, g := 0, 0, 0, 0\n\n\tfor i := 0; i < len(str); i++ {\n\t\tif str[i] == '+' {\n\t\t\tpos++\n\t\t} else if str[i] == '-' {\n\t\t\tneg++\n\t\t} else {\n\t\t\tq++\n\t\t}\n\n\t\tif goal[i] == '+' {\n\t\t\tg++\n\t\t} else if goal[i] == '-' {\n\t\t\tg--\n\t\t}\n\t}\n\n\tinit := pos - neg\n\n\tif (g == init) && (q == 0) {\n\t\tprintln(1)\n\t\treturn\n\t}\n\n\tans := 0\n\tamount := 1 << uint(q)\n\n\tfor i := 0; i < 1<>uint(j))&1 > 0 {\n\t\t\t\tval++\n\t\t\t} else {\n\t\t\t\tval--\n\t\t\t}\n\t\t}\n\n\t\tval += init\n\n\t\tif val == g {\n\t\t\tans++\n\t\t}\n\t}\n\n\tansw := float32(ans)\n\tansw /= float32(amount)\n\n\tfmt.Printf(\"%.9f\", answ)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "f99b0e4ebbab33dc189922c00e6f8327", "src_uid": "f7f68a15cfd33f641132fac265bc5299", "difficulty": 1300.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t//\"bytes\"\n\t\"fmt\"\n\t//\"strconv\"\n)\n\nfunc Max(n int, g int) int {\n\tif n > g {\n\t\treturn n\n\t} else {\n\t\treturn g\n\t}\n}\n\nfunc Min(n int, g int) int {\n\tif n > g {\n\t\treturn g\n\t} else {\n\t\treturn n\n\t}\n}\n\nfunc main() {\n\t//var f string\n\n\tvar str, goal string\n\t//var buffer bytes.Buffer\n\n\tfmt.Scan(&goal)\n\tfmt.Scan(&str)\n\n\tpos, neg, g := 0, 0, 0\n\n\tvar q uint\n\n\tfor i := 0; i < len(str); i++ {\n\t\tif str[i] == '+' {\n\t\t\tpos++\n\t\t} else if str[i] == '-' {\n\t\t\tneg++\n\t\t} else {\n\t\t\tq++\n\t\t}\n\n\t\tif goal[i] == '+' {\n\t\t\tg++\n\t\t} else if goal[i] == '-' {\n\t\t\tg--\n\t\t}\n\t}\n\n\ttotal := 1 << q\n\tdelta := pos - neg\n\tans := 0\n\n\tfor i := 0; i < total; i++ {\n\t\tval := 0\n\n\t\tfor j := 0; j < q; j++ {\n\t\t\tif ((i >> uint(j)) & 1) > 0 {\n\t\t\t\tval++\n\t\t\t} else {\n\t\t\t\tval--\n\t\t\t}\n\t\t}\n\n\t\tif val+delta == g {\n\t\t\tans++\n\t\t}\n\t}\n\n\tansw := float32(ans)\n\tansw /= float32(total)\n\n\tfmt.Printf(\"%.9f\", answ)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "5e8beba0d8fdfd3c0f3292fbc4277d7f", "src_uid": "f7f68a15cfd33f641132fac265bc5299", "difficulty": 1300.0} {"lang": "Go", "source_code": "// https://codeforces.com/contest/8/problem/B\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\n// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)\n\nfunc main() {\n\n\t//f, _ := os.Open(\"input.txt\")\n\t//input := bufio.NewReader(f)\n\tinput := bufio.NewReader(os.Stdin)\n\tvar str string\n\tfmt.Fscanln(input, &str)\n\n\tconst L = 100*3\n\tf := make([][]int, L)\n\tfor i := 0; i < L; i++ {\n\t\tf[i] = make([]int, L)\n\t}\n\n\tl, c := 150, 150\n\tf[l][c] = true\n\tfor i := 0; i < len(str); i++ {\n\t\tswitch str[i] {\n\t\tcase 'L': c--\n\t\tcase 'R': c++\n\t\tcase 'D': l++\n\t\tcase 'U': l--\n\t\t} \n\n\t\tif f[l][c] > 0 {\n\t\t\tfmt.Print(\"BUG\")\n\t\t\treturn\n\t\t}\n\n\t\tif (f[l - 1][c] > 0 && f[l - 1][c] < i - 1) || \n\t\t(f[l + 1][c] > 0 && f[l + 1][c] < i - 1) || \n\t\t(f[l][c - 1] > 0 && f[l][c - 1] < i - 1) || \n\t\t(f[l][c - 1] > 0 && f[l][c - 1] < i - 1) {\n\t\t\tfmt.Print(\"BUG\")\n\t\t\treturn\n\t\t}\n\n\t\tf[l][c] = i + 1\n\t}\n\n\n\tfmt.Print(\"OK\")\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "36e203f5f7475a48c736df8e6b7c10eb", "src_uid": "bb7805cc9d1cc907b64371b209c564b3", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\ntype crushes []int\n\nfunc gcd(a, b int64) int64 {\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n\nfunc lcm(a, b int64) int64 {\n\treturn a * b / gcd(a, b)\n}\n\nfunc lcmm(a ...int) int64 {\n\tl := int64(a[0])\n\tfor _, v := range a {\n\t\tl = lcm(l, int64(v))\n\t}\n\treturn l\n}\n\nfunc (cr crushes) CountStepsToReturn(start int) int {\n\tcnt := 1\n\tcur := start\n\tfor cnt <= len(cr) {\n\t\tcur = cr[cur]\n\t\tif cur == start {\n\t\t\tbreak\n\t\t}\n\t\tcnt++\n\t}\n\tif cnt > len(cr) {\n\t\treturn -1\n\t}\n\treturn cnt\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar cr crushes = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&cr[i])\n\t\tcr[i]--\n\t}\n\tmin := make([]int, n)\n\tvar ans int\n\tfor i := 0; i < n; i++ {\n\t\tm := cr.CountStepsToReturn(i)\n\t\tif m == -1 {\n\t\t\tans = -1\n\t\t\tbreak\n\t\t} else if m%2 == 0 {\n\t\t\tm = m / 2\n\t\t}\n\t\tmin[i] = m\n\t}\n\tif ans != -1 {\n\t\tans = lcmm(min...)\n\t}\n\tfmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "2e0e15af9d2d96400265a6dc68ceade7", "src_uid": "149221131a978298ac56b58438df46c9", "difficulty": 1600.0} {"lang": "Go", "source_code": "#include \nusing namespace std;\n\nint main() {\n int n, index;\n cin >> n >> index;\n index--;\n\n bool c[n];\n for (int i = 0; i < n; i++) {\n int num;\n cin >> num;\n c[i] = num == 1;\n }\n\n int total = c[index] ? 1 : 0;\n for (int i = 1; i < 100; i++) {\n int l = index - i, r = index + i;\n if ((l >= 0) && (r < n) && c[l] && c[r])\n total += 2;\n\n if ((l >= 0) && (r >= n) && c[l])\n total++;\n\n if ((l < 0) && (r < n) && c[r])\n total++;\n }\n\n cout << total << endl;\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "ac61efbb5eced1f96582afe2c366fc3b", "src_uid": "4840d571d4ce6e1096bb678b6c100ae5", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int\n names := [...]string{\"Sheldon\",\"Leonard\",\"Penny\",\"Rajesh\",\"Howard\"}\n fmt.Scan(&n)\n p := 1\n for n > (5*p) {\n n -= (5*p)\n p *= 2\n }\n fmt.Println(ans[(n-1)/p])\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "75bd67aadd541d7b1a6cf00ba2bde47f", "src_uid": "023b169765e81d896cdc1184e5a82b22", "difficulty": 1100.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.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": "97945e556e1718da1a3589ca438494c2", "src_uid": "80520be9916045aca3a7de7bc925af1f", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t)\n\nconst INF = 0x3f3f3f3f\n\nvar n, m, tot int\n\nfunc min(x, y int) int {\n\tif x b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc main() {\n\tbTemp, _ := strconv.ParseInt(readLine(), 10, 64)\n\tb := int64(bTemp)\n\tgTemp, _ := strconv.ParseInt(readLine(), 10, 64)\n\tg := int64(gTemp)\n\tif g < min {\n\t\tmin = g\n\t}\n\tnTemp, _ := strconv.ParseInt(readLine(), 10, 64)\n\tn := int64(nTemp)\n\tmin := Min(n, g)\n\tminBoys = n - min\n\tmaxBoys := Min(n, b)\n\tfmt.Print(maxBoys - minBoys + 1)\n}\n\nfunc readLine() string {\n\tstr, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\treturn strings.TrimRight(string(str), \"\\r\\n\")\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "b9f131550ca034daff9a45a9e5405291", "src_uid": "9266a69e767df299569986151852e7b1", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype IO struct {\n\tscanner *bufio.Scanner\n\twriter *bufio.Writer\n}\nfunc NewIO() IO {\n\tio := IO{scanner: bufio.NewScanner(os.Stdin), \n\t\twriter: bufio.NewWriter(os.Stdout)}\n\tio.scanner.Split(bufio.ScanWords)\n\treturn io\n}\nfunc toInt(buf []byte) (n int) {\n\tsgn bool := false\n\tfor _, v := range buf {\n\t\tif v == '-' {\n\t\t\tsgn = true\n\t\t} else {\n\t\t\tn = n*10 + int(v-'0')\n\t\t}\n\t}\n\tif sgn {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc (io *IO) NextInt() int {\n\tio.scanner.Scan()\n\treturn toInt(io.scanner.Bytes())\n}\nfunc (io *IO) Write(data ...interface{}) {\n\tfor _, el := range data {\n\t\tswitch el.(type) {\n\t\t\tcase int:\n\t\t\t\tio.writer.WriteString(strconv.Itoa(el.(int)))\n\t\t\tcase string:\n\t\t\t\tio.writer.WriteString(el.(string))\n\t\t\tcase rune:\n\t\t\t\tio.writer.WriteRune(el.(rune))\n\t\t}\n\t}\n}\nfunc (io *IO) Writeln(data ...interface{}) {\n\tio.Write(data...)\n\tio.writer.WriteRune('\\n')\n}\nfunc (io *IO) Flush() {\n\tio.writer.Flush()\n}\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\nconst N int = 100\n\nfunc main() {\n\tio := NewIO()\n\n\tn := io.NextInt()\n\tvar a [N](int)\n\tans := 0\n\tfor i:=0; i0 && a[i]!=1 && a[i-1]!=1 {\n\t\t\tgoto Bad\n\t\t}\n\t\tif i>1 && a[i]==2 && a[i-1]==1 && a[i-2]==3 {\n\t\t\tans--\n\t\t}\n\t\tif i>0 {\n\t\t\tif Max(a[i],a[i-1])==2 {\n\t\t\t\tans += 3\n\t\t\t} else {\n\t\t\t\tans += 4\n\t\t\t}\n\t\t}\n\t}\n\n\tio.Writeln(\"Finite\")\n\tio.Writeln(ans)\n\tio.Flush()\n\treturn\n\nBad:\n\tio.Writeln(\"Infinite\")\n\tio.Flush()\n\treturn\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a3b88016fb1e47b4c0b5e0c4dc93cebc", "src_uid": "6c8f028f655cc77b05ed89a668273702", "difficulty": 1400.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\tk := readInt()\n\tif k == 0 {\n\t\tfmt.Println(0, 0)\n\t\treturn\n\t}\n\ta := 0\n\tif k < n {\n\t\ta = 1\n\t}\n\tb := min(n-k, k*2)\n\tfmt.Println(a, b)\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, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\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 max(a, 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": "755ae5c5d310a515cd604543ceca80a9", "src_uid": "bdccf34b5a5ae13238c89a60814b9f86", "difficulty": 1200.0} {"lang": "Go", "source_code": "import \"fmt\"\n\nfunc main() {\n\tvar (\n\t\tn int\n\t\tk int\n\t)\n\tfmt.Scan(&n, &k)\n\tmin, max := Calculate854B(n, k)\n\tfmt.Print(min, max)\n}\n\nfunc Calculate854B(n int, k int) (int, int) {\n\tvar min = 1\n\tvar max = n - k\n\tif k <= n/3 {\n\t\tmax = k * 2\n\t}\n\tif n == k || k == 0 {\n\t\tmin = 0\n\t\tmax = 0\n\t}\n\treturn min, max\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "4fc83cfb5b14a63955856bcbbd30c7ea", "src_uid": "bdccf34b5a5ae13238c89a60814b9f86", "difficulty": 1200.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\tk := readInt()\n\tif k == 0 {\n\t\tfmt.Println(0, 0)\n\t\treturn\n\t}\n\tminAns := 0\n\tmaxAns := 0\n\tif k < n {\n\t\tminAns = 1\n\t}\n\tmaxAns = min((n - k), k+1)\n\tfmt.Println(minAns, maxAns)\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, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\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 max(a, 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": "9686dd5b6bf19158162e21fc1ea49a0e", "src_uid": "bdccf34b5a5ae13238c89a60814b9f86", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strings\"\n \"strconv\"\n \"sort\"\n )\n\nfunc main (){\n var n, k int\n var s string\n reader := bufio.NewReader(os.Stdin)\n fmt.Scan(&n, &k )\n\n entrada, _ := reader.ReadString('\\r')\n s = strings.TrimRight(entrada, \"\\n\")\n arrs := strings.Field()\n\n var t2[] int\n dic:= map[int] bool {}\n\n for pos, i := range arrs { \n j, _ := strconv.Atoi(i)\n _, ok := dic[j] \n if !ok {\n dic[j] = true\n t2 = append(t2, pos+1)\n }\n\n }\n\n if len(dic) < k {\n fmt.Println(\"NO\")\n } else {\n sort.Ints(t2)\n fmt.Println(\"YES\")\n fmt.Println(strings.Trim(fmt.Sprint(t2), \"[]\"))\n }\n\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "78f36f10ec44d7327c72a94a8ada958f", "src_uid": "5de6574d57ab04ca195143e08d28d0ad", "difficulty": 800.0} {"lang": "Go", "source_code": "// Codeforces 988 A Diverse Team train \npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"strings\"\n\t\"strconv\"\n\t\"os\"\n\t\"sort\"\n)\nvar in *bufio.Reader\n\nfunc readFive() (int,int,int,int,int) {\n\tvar a [5]int\n\ts, err := in.ReadString('\\n')\n\tif err != nil {\n\t\tfmt.Println(\"first read failure\", err)\n\t\tpanic(err)\n\t}\n\tss := strings.Split(strings.Trim(s, \" \\n\\r\"), \" \")\n\tfor i:=0; i=k {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tcanForm = (it == k)\n}\n\nfunc printRes() {\n\tif canForm {\n\t\tfmt.Println(\"YES\")\n\t\tfor i:=0; i -1 {\n\t\t\t\tfmt.Print(string(s[strings.IndexRune(s, k) + dx]))\n\t\t\t}\n\t\t}\n\t}\n\n}\n\nfunc next() string {\n\tin.Scan()\n\treturn in.Text()\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "42889c38652218106ee4787f3ce68f4e", "src_uid": "df49c0c257903516767fdb8ac9c2bfd6", "difficulty": 900.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 reader io.Reader\nvar scanner *bufio.Scanner\n\nfunc Init(io io.Reader, max_token_size int) {\n\treader = bufio.NewReader(io)\n\tscanner = bufio.NewScanner(reader)\n\t// max token size\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer([]byte{}, max_token_size)\n}\n\nfunc stderr(v ...interface{}) {\n\tfmt.Fprintln(os.Stderr, v...)\n}\n\nfunc die(v ...interface{}) {\n\tfmt.Fprintln(os.Stderr, v...)\n\tos.Exit(1)\n}\n\nfunc NextInt() int {\n\tbytes := NextBytes()\n\ti, err := Atoi(bytes)\n\tif err != nil {\n\t\tdie(err)\n\t}\n\treturn i\n}\nfunc NextInt64() int64 {\n\tbytes := NextBytes()\n\ti, err := Atoi64(bytes)\n\tif err != nil {\n\t\tdie(err)\n\t}\n\treturn i\n}\n\nfunc NextBytes() []byte {\n\tif !scanner.Scan() {\n\t\tdie(scanner.Err())\n\t}\n\tbytes := scanner.Bytes()\n\tcopied := make([]byte, len(bytes))\n\tcopy(copied, bytes)\n\treturn copied\n}\n\nfunc Atoi(b []byte) (int, error) {\n\tneg := false\n\tif b[0] == '+' {\n\t\tb = b[1:]\n\t} else if b[0] == '-' {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tn := 0\n\tfor _, v := range b {\n\t\tif v < '0' || v > '9' {\n\t\t\treturn 0, strconv.ErrSyntax\n\t\t}\n\t\tn = n*10 + int(v-'0')\n\t}\n\tif neg {\n\t\treturn -n, nil\n\t}\n\treturn n, nil\n}\n\nfunc Atoi64(b []byte) (int64, error) {\n\tneg := false\n\tif b[0] == '+' {\n\t\tb = b[1:]\n\t} else if b[0] == '-' {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tvar n int64\n\tfor _, v := range b {\n\t\tif v < '0' || v > '9' {\n\t\t\treturn 0, strconv.ErrSyntax\n\t\t}\n\t\tn = n*10 + int64(v-'0')\n\t}\n\tif neg {\n\t\treturn -n, nil\n\t}\n\treturn n, nil\n}\n\nfunc ExtendByteArray(a []byte, size int) []byte {\n\tif size <= len(a) {\n\t\treturn a\n\t} else {\n\t\treturn append(a, make([]byte, size-len(a))...)\n\t}\n}\n\nfunc ExtendIntArray(a []int, size int) []int {\n\tif size <= len(a) {\n\t\treturn a\n\t} else {\n\t\treturn append(a, make([]int, size-len(a))...)\n\t}\n}\n\nfunc reverseInts(a []int) {\n\tfor l, r := 0, len(a)-1; l < r; l, r = l+1, r-1 {\n\t\ta[l], a[r] = a[r], a[l]\n\t}\n}\n\nfunc unique(a []int) int {\n\tnewLen := 0\n\tn := len(a)\n\tfor i := 0; i < n; i++ {\n\t\tif newLen == 0 || a[i] != a[newLen-1] {\n\t\t\ta[newLen] = a[i]\n\t\t\tnewLen++\n\t\t}\n\t}\n\treturn newLen\n}\n\nfunc min(a, b int) int {\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 a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tinf := os.Stdin\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\t// inf, err := os.Open(\"a.in\")\n\t// if err != nil {\n\t// \tdie(err)\n\t// }\n\t// out, err := os.Create(\"a.out\")\n\t// if err != nil {\n\t// \tdie(err)\n\t// }\n\t// defer out.Close()\n\tInit(inf, 1000010)\n\n\tu := NextInt64()\n\tv := NextInt64()\n\tMAXP := 63\n\tMAXC := 4\n\ta := make([]int, MAXP)\n\tb := make([]int, MAXP)\n\n\tfor i := 0; i < MAXP; i++ {\n\t\ta[i] = int(u & 1)\n\t\tb[i] = int(v & 1)\n\t\tu >>= 1\n\t\tv >>= 1\n\t}\n\n\tdp := make([][]int, MAXP)\n\tp := make([][][3]int, MAXP)\n\tfor i := 0; i < MAXP; i++ {\n\t\tdp[i] = make([]int, MAXC)\n\t\tp[i] = make([][3]int, MAXC)\n\t\tfor j := 0; j < MAXC; j++ {\n\t\t\tdp[i][j] = -1\n\t\t}\n\t}\n\n\tMAXINT := 1000000000\n\n\tvar f func(i, carry int) int\n\tf = func(i, carry int) int {\n\n\t\tif i == -1 {\n\t\t\tif carry == 0 {\n\t\t\t\treturn 0\n\t\t\t} else {\n\t\t\t\treturn MAXINT\n\t\t\t}\n\t\t}\n\n\t\tif dp[i][carry] != -1 {\n\t\t\treturn dp[i][carry]\n\t\t}\n\n\t\tres := MAXINT\n\t\tresk1, resc := -1, -1\n\n\t\tfor k1 := 0; k1 < MAXP*2; k1++ {\n\t\t\tif (k1 >> 1) > carry {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif (k1 & 1) != a[i] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor ncarry := 0; ncarry < MAXC; ncarry++ {\n\t\t\t\tif ((k1 + ncarry) >> 1) > carry {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif ((k1+ncarry)>>1) == carry && ((k1+ncarry)&1) == b[i] {\n\t\t\t\t\tt := max(k1, f(i-1, ncarry))\n\t\t\t\t\tif t < res {\n\t\t\t\t\t\tres = t\n\t\t\t\t\t\tresk1 = k1\n\t\t\t\t\t\tresc = ncarry\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdp[i][carry] = res\n\t\tp[i][carry][1] = resk1\n\t\tp[i][carry][2] = resc\n\t\treturn res\n\t}\n\n\tres := f(MAXP-1, 0)\n\tif res == MAXINT {\n\t\tfmt.Fprintln(out, -1)\n\t\treturn\n\t}\n\n\tfmt.Fprintln(out, res)\n\n\tans := make([]int, res)\n\n\tfor i, carry, j := MAXP-1, 0, 0; i >= 0; i-- {\n\t\tncarry := p[i][carry][2]\n\t\tk1 := p[i][carry][1]\n\t\tfor k1 > 0 {\n\t\t\tans[j] |= (1 << i)\n\t\t\tj++\n\t\t\tif j == res {\n\t\t\t\tj = 0\n\t\t\t}\n\t\t\tk1--\n\t\t}\n\t\tcarry = ncarry\n\t}\n\n\tfor i := 0; i < res; i++ {\n\t\tfmt.Fprint(out, ans[i], \" \")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "6309e48cd9988e9201b01985f540414d", "src_uid": "490f23ced6c43f9e12f1bcbecbb14904", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main(){\n\tvar s,v1,v2,t1,t2 int\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in,&s,&v1,&v2,&t1,&t2)\n\ta1 := 2*t1+s*v1\n\ta2 := 2*t2+s*v2\n\tif a1\n#define tr(v,it) for(auto it=v.begin(); it!=v.end(); it++)\n#define mp(x,y) make_pair(x,y)\n#define pb(x) push_back(x)\n#define F first\n#define S second\n#define endl \"\\n\"\n#define MOD 1000000007\n#define pie 3.141592653589793\n#define INF 1e18\nusing namespace std;\n\nint main()\n{\n //freopen(\"input.txt\",\"r\",stdin);\n //freopen(\"output.txt\",\"w\",stdout);\n\n ios::sync_with_stdio(0); cin.tie(0);\n\n long long n;\n cin>>n;\n double value=0;\n long long x,y;\n for(int i=1; i<=n; i++)\n {\n for(int j=i; j<=n; j++)\n {\n long long a=i;\n long long b=j;\n if(a+b==n)\n {\n long long k=__gcd(i,j);\n if(k==1)\n {\n double tempv=(a*1.0/b);\n if(tempv>value)\n {\n x=i;\n y=j;\n }\n }\n }\n\n }\n }\n cout< s2 {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc Test(t *testing.T) {\n\tassert.Equal(t, run(\"aaaa\", \"aaaA\"), 0)\n\tassert.Equal(t, run(\"abs\", \"Abz\"), -1)\n\tassert.Equal(t, run(\"abcdefg\", \"AbCdEfF\"), 1)\n}\n\nfunc main() {\n\tvar s1, s2 string\n\tfmt.Scan(&s1, &s2)\n\tfmt.Println(run(s1, s2))\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "0f46dacabc43c8997d7b53f8d7cfede7", "src_uid": "ffeae332696a901813677bd1033cf01e", "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\ntype vallen struct {\n\tlen, val int\n}\n\nvar orders [10]vallen = [...]vallen{\n\t{1000000000, 512},\n\t{100000000, 256},\n\t{10000000, 128},\n\t{1000000, 64},\n\t{100000, 32},\n\t{10000, 16},\n\t{1000, 8},\n\t{100, 4},\n\t{10, 2},\n\t{1, 1},\n}\n\nfunc solve() {\n\tn := readString()\n\ts := make([]byte, len(n))\n\n\trest := false\n\tfor i, c := range n {\n\t\tif rest {\n\t\t\ts[i] = '1'\n\t\t\tcontinue\n\t\t}\n\t\tif c >= '2' {\n\t\t\trest = true\n\t\t\ts[i] = '1'\n\t\t\tcontinue\n\t\t}\n\t\ts[i] = n[i]\n\t}\n\tvar r int\n\tfmt.Sscanf(string(s), \"%b\", &r)\n\tfmt.Println(r)\n}\n\nfunc solve2() {\n\tn := readInt()\n\tr := 0\n\n\tb := 1 << 31\n\tfor ; b > 0; b >>= 1 {\n\t\tr |= b\n\t\tif r > n {\n\t\t\tr &= ^b\n\t\t}\n\t}\n\tfmt.Sscanf(fmt.Sprintf(\"%d\", r), \"%b\", &r)\n\tfmt.Println(r)\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\t//solve2()\n}\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", "lang_cluster": "Go", "compilation_error": true, "code_uid": "042a79aa2a1772da9dd0e12b73970671", "src_uid": "64a842f9a41f85a83b7d65bfbe21b6cb", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"math\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\n\tinput, _, _ := reader.ReadLine()\n\tvalue, _ := strconv.Atoi(string(input))\n\n\tresultNumber := 0\n\n\tfor i := 01;true; i++ {\n\t\tif value < math.Pow(10, i) {\n\t\t\tbreak\n\t\t} else {\n\t\t\tresultNumber++\n\t\t}\n\t}\n\n\tfmt.Println(resultNumber)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "f562841f5e4db9e39ebd99c4e8b38358", "src_uid": "64a842f9a41f85a83b7d65bfbe21b6cb", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\n \nimport \"fmt\"\n \nfunc main() {\n\tvar a int\n var b int\n var c int\n\tfmt.Scan(&a, &b, &c)\n\tif b >=a and c >= a {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "8ef8b2b8363781fc3c89407c6baa50bb", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n\nfunc main() {\n in := bufio.NewReader(os.Stdin)\n out := bufio.NewWriter(os.Stdout)\n defer out.Flush()\n tot := 0\n fmt.Fscan(in, &tot)\n times := tot/3\n if tot % 3 > 0 {times++}\n fmt.Fprint(times, \"\\n\")\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "9009f4885856d5fb596eecc8537578b2", "src_uid": "a993069e35b35ae158d35d6fe166aaef", "difficulty": 800.0} {"lang": "Go", "source_code": "package main \n\nimport \"fmt\"\n\n\nfunc main() {\n\tvar n,m int;\n\t_,_ = fmt.Scanf(\"%d %d\",&n,&m)\n\tvar u = n-m;\n\tvar l = m-1;\n\tif n == m{\n\t\tfmt.Println(m)\n\t}\n\telse if(u > l){\n\t\tfmt.Println(m+1)\n\t}else{\n\t\tfmt.Println(m-1)\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "f8c71d9c2baff5aeb1a09119944b9fd2", "src_uid": "f6a80c0f474cae1e201032e1df10e9f7", "difficulty": 1300.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"math/bits\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar s []byte\n\tfmt.Scan(&s)\n\tn := 1 << uint(len(s))\n\tr := 0\n\tfor i := n - 1; i > 0; i-- {\n\t\tif bits.OnesCount(uint(i)) <= r {\n\t\t\tcontinue\n\t\t}\n\t\tvar t []byte\n\t\tfor j := 0; j < len(s); j++ {\n\t\t\tif (i>>uint(j))&1 != 0 {\n\t\t\t\tt = append(t, s[j])\n\t\t\t}\n\t\t}\n\t\tv, _ := strconv.Atoi(string(t))\n\t\tw := int(math.Sqrt(float64(v)))\n\t\tif v == w*w {\n\t\t\tr = bits.OnesCount(uint(i))\n\t\t}\n\t}\n\tif r == 0 {\n\t\tfmt.Println(\"-1\")\n\t} else {\n\t\tfmt.Println(len(s) - r)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "875672810df43b15b5c7024349a2e613", "src_uid": "fa4b1de79708329bb85437e1413e13df", "difficulty": 1400.0} {"lang": "Go", "source_code": "http://puu.sh/q1b0g/98e80a146f.png", "lang_cluster": "Go", "compilation_error": true, "code_uid": "113b486b0d80169d65c68b8deec9e568", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "difficulty": 1200.0} {"lang": "Go", "source_code": "func checkWord (word string) string{\nisLower :=0\n\tisUpper :=0\n\t//s.Count(word,lower)\n\tfor _,char := range word {\n\tif\tunicode.IsLower(char){\n\t\tisLower++;\n\t}else{\n\t\tisUpper++;\n\t}\n\t}\n\n\tif isUpper > isLower{\n\t\treturn s.ToUpper(word)\n\t}else{\n\t\treturn s.ToLower(word)\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "598210e424bc3de6968052760383b0d8", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\nimport (\n\ts \"strings\"\n\t\"unicode\"\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _ := reader.ReadString('\\n')\n\tfmt.Print(checkWord(text));\n}\n\nfunc checkWord (word string) string{\n\tisLower :=0\n\tisUpper :=0\n\tfor _,char := range word {\n\tif\tunicode.IsLower(char){\n\t\tisLower++;\n\t}else if unicode.IsUpper(char){\n\t\tisUpper++;\n\t}\n\t}\n\tif isUpper > isLower{\n\t\treturn s.ToUpper(word)\n\t}else{\n\t\treturn s.ToLower(word)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "481c13fcf4622f433cb3f8203ac65411", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nfunc main() {\n\tvar s strings\n\tfmt.Scan(&s)\n\tu, l := 0, 0\n\tfor _, r := range s {\n\t\tif unicode.IsLower(r) {\n\t\t\tl++\n\t\t} else if unicode.IsUpper(r) {\n\t\t\tu++\n\t\t}\n\t}\n\tif u > l {\n\t\tfmt.Println(strings.ToUpper(s))\n\t} else {\n\t\tfmt.Println(strings.ToLower(s))\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "2bbb39a8aaebe3345925792c5f80faa7", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "difficulty": 800.0} {"lang": "Go", "source_code": "# \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\n# \u2591\u2591\u2591\u2591\u2591\u2584\u2580\u2580\u2580\u2584\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\n# \u2584\u2588\u2588\u2588\u2580\u2591\u25d0\u2591\u2591\u2591\u258c\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\n# \u2591\u2591\u2591\u2591\u258c\u2591\u2591\u2591\u2591\u2591\u2590\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\n# \u2591\u2591\u2591\u2591\u2590\u2591\u2591\u2591\u2591\u2591\u2590\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\n# \u2591\u2591\u2591\u2591\u258c\u2591\u2591\u2591\u2591\u2591\u2590\u2584\u2584\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\n# \u2591\u2591\u2591\u2591\u258c\u2591\u2591\u2591\u2591\u2584\u2580\u2592\u2592\u2580\u2580\u2580\u2580\u2584\u2591\u2591\u2591\u2591\u2591\n# \u2591\u2591\u2591\u2590\u2591\u2591\u2591\u2591\u2590\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2580\u2580\u2584\u2591\u2591\u2591\n# \u2591\u2591\u2591\u2590\u2591\u2591\u2591\u2591\u2590\u2584\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2580\u2584\u2591\n# \u2591\u2591\u2591\u2591\u2580\u2584\u2591\u2591\u2591\u2591\u2580\u2584\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2592\u2580\u2584\n# \u2591\u2591\u2591\u2591\u2591\u2591\u2580\u2584\u2584\u2584\u2584\u2584\u2588\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2584\u2580\u2584\n# \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u258c\u258c\u2591\u258c\u258c\u2591\u2591\u2591\u2591\u2591\u2591\u2591\n# \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u258c\u258c\u2591\u258c\u258c\u2591\u2591\u2591\u2591\u2591\u2591\u2591\n# \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2584\u2584\u258c\u258c\u2584\u258c\u258c\u2591\u2591\u2591\u2591\u2591\u2591\u2591\n# \u2591\u2591\u2591\u2591\u2591\u2591PAWANG ULAR\u2591\u2591\u2591\u2591\u2591\u2591\n# \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\n\ns = input()\nx = 0\nfor c in s:\n if c.isupper() :\n x += 1\n\nif x > len(s) - x:\n print(s.upper())\nelse :\n print(s.lower())", "lang_cluster": "Go", "compilation_error": true, "code_uid": "7f2af9d5fa8d5cd69ec26b83aa36139c", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n, ans int\n ans = 0\n \n fmt.Scan(&n)\n ans += n/100\n n %= 100\n ans += n/50\n n %= 50\n ans += n/20\n n %= 20\n ans += n/5\n n %= 20\n ans + n\n \n fmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a98415410b55cd6bdb09df127576a2d6", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "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([]int{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": "e5501f44e14dcc47a08b90ec082f967a", "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\nfunc main() {\n\tvar n int\n\tbil := []int{100, 20, 10, 5}\n\tin := bufio.NewReader(os.Stdin)\n\tans := 0\n\tfor _, v := range bil {\n\t\tans = ans + n/v\n\t\tn = n % v\n\t}\n\tans = ans + n\n\tfmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "6e5d1ed1f188673bf0ebb889b767cb55", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "difficulty": 800.0} {"lang": "Go", "source_code": "//A. \u0412\u044b\u0438\u0433\u0440\u0430\u0442\u044c \u0432 \u043b\u043e\u0442\u0435\u0440\u0435\u044e\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n uint32\n\tfmt.Scan(&n)\n\tminKol(n)\n}\n\nfunc minKol(sum uint32) uint32 {\n\tbills := [...]uint32{1, 5, 10, 20, 100}\n\tvar uint32 mode = sum\n\tvar uint32 rez\n\tvar int i = 4\n\n\tfor mode != 0 {\n\t\trez = rez + mode/bills[i]\n\t\tmode = sum % bills[i]\n\t\tmode = mode % bills[i]\n\t\ti--\n\t}\n\treturn rez\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "ebbe7ca5b2c1cc7988b8db3086697d26", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\n\nfunc main() {\n var n, m, k int32;\n fmt.Scan(&n, &m);\n \n for n > 0 {\n k++;\n if !(k % m) {\n k++;\n }\n n--;\n }\n \n fmt.Print(k);\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "cd329f562a1e275872fa9bac5f8b045d", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\n\nfunc main() {\n var n, m, k int32;\n fmt.Scan(&n, &m);\n \n while n > 0 {\n k++;\n if !(k % m) {\n k++;\n }\n n--;\n }\n \n fmt.Print(k);\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "601e9a7c0245798b938e4b270fe0b1a5", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\n\nfunc main() {\n var n, m, k int32;\n fmt.Scan(&n, &m);\n \n while (n > 0) {\n k++;\n if (!(k % m)) k++;\n n--;\n }\n \n fmt.Print(k);\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "e5c80f2676fe21b293f9e84d237672b0", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\n\nfunc main() {\n var n, m, k int32\n fmt.Scan(&n, &m)\n \n while n > 0 {\n k++;\n if !(k % m) {\n k++\n }\n n--\n }\n \n fmt.Print(k)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "7ca518f85b407eefd1070bdeaff13856", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "difficulty": 900.0} {"lang": "Go", "source_code": "\n\nimport \"fmt\"\nfunc ptich(x,n int) int{\n dem := 2\n i := 2\n for ; i * i < x; i++{\n if x % i == 0 && i <= n && x / i <= n{\n dem += 2\n }\n }\n if i * i == x{\n dem++\n }\n return dem\n}\nfunc main() {\n var n, x int\n fmt.Scanf(\"%d%d\",&n,&x)\n fmt.Println(ptich(x,n))\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "04c62bf1e94bcea392296cc4624d27e1", "src_uid": "c4b139eadca94201596f1305b2f76496", "difficulty": 1000.0} {"lang": "Go", "source_code": "= 0{\n\t\treturn x\t\n\t}else{\n\t\treturn -x\n\t}\n\t\n}\n\nfunc main(){\n\tvar n = map[string]int{\"a\": 1, \"b\":2, \"c\":3,\"d\":4, \"e\":5,\"f\":6,\"g\":7, \"h\":8}\n\tvar sstart, sfin string\n\tfmt.Scan(&sstart, &sfin)\n\txstart := n[sstart[:1]]\n\tystart, _ := strconv.Atoi(sstart[1:])\n\n\txfin := n[sfin[:1]]\n\tyfin, _ := strconv.Atoi(sfin[1:])\n\n\tcrossx := xstart - xfin\n\tcrossy := ystart - yfin\n\tacrossx := abs(crossx)\n\tacrossy := abs(crossy)\n\tfmt.Printf(\"acrossx = %d\\n acrossy = %d\\n\", acrossx, acrossy)\n\tvar m int\n\tif acrossx <= acrossy {\n\t\tm = acrossy\n\n\t}else{\n\t\tm = acrossx\n\t}\n\tfmt.Printf(\"m = %d\", m)\n\tans := make([]string, m)\n\tcm := \"\"\n\tsmx, smy:= \"\", \"\"\n\tif crossx > 0 {\n\t\tcm += \"L\"\n\t\tsmx = \"L\"\n\t}else if crossx == 0{\n\t\tcm+= \"\"\n\t}else{\n\t\tcm +=\"R\"\n\t\tsmx = \"R\"\n\t}\n\tif crossy > 0 {\n\t\t\tcm += \"D\"\n\t\t\tsmy = \"D\"\n\t}else if crossy == 0{\n\t\tcm += \"\"\n\t}else{\n\t\t\tcm += \"U\"\n\t\t\tsmy = \"U\"\n\t}\n\n\tfmt.Printf(\"cm = %s\\n\", cm)\n\tif (acrossx <= acrossy) && crossx != 0{\n\t\tfor i := 0; i < acrossx; i ++{\n\t\t\tfmt.Printf(\"%s\\n\", cm)\n\t\t}\n\t\tfor i := 0; i < acrossy - acrossx; i++ {\n\t\t\tfmt.Printf(\"%s\\n\", smy)\n\t\t}\n\t}else{\n\t\tfor i := 0; i < acrossy; i ++{\n\t\t\tfmt.Printf(\"%s\\n\", cm)\n\t\t}\n\t\tfor i := 0; i < acrossx - acrossy; i++ {\n\t\t\tfmt.Printf(\"%s\\n\", smx)\n\t\t}\n\t}\n\t\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a0fc8158a38013a0a6084d863eaa396d", "src_uid": "d25d454702b7755297a7a8e1f6f36ab9", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\nimport (\n \"fmt\"\n)\nfunc main(){\n var n,l int\n var s string\n fmt.Scan(&n,&s)\n for i:=1;i SF{\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n \n \n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "5d3f08fbe8993698452af6ae8f619b87", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n \"fmt\"\n \"strings\"\n)\n func main() {\n var l int\n var str string\n fmt.Scan(&l, &str)\n fs := s.Count(str, \"FS\")\n sf := s.Count(str, \"SF\")\n if sf > fs {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "e4fd445bff82429b7edafb86c88b04b3", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a int\n scanf(\"%d\\n\", &a)\n\tfmt.Println(Problem617A(a))\n}\n\nfunc Problem617A(position int) (steps int) {\n\tsteps = 0\n\tfor curr := 5; curr > 0; curr-- {\n\t\tfor position >= curr {\n\t\t\tsteps++\n\t\t\tposition-=curr\n\t\t}\n\t}\n\treturn\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "26966e7d3ac8e0f61b5d36571666728c", "src_uid": "4b3d65b1b593829e92c852be213922b6", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\t// var a string\n\tvar n, q int\n\t// var x float64\n\t// var s string\n\t// scr := bufio.NewReader(os.Stdin)\n\t// ocr := bufio.NewWriter(os.Stdout)\n\n\tfmt.Scanln(&q)\n\n\tif q <= 5 {\n\t\tfmt.Println(\"1\")\n\t} else {\n\t\tn = q % 5\n\t\tq = q / 5\n\n\t\tif n != 0 {\n\t\t\tfmt.Println(q + 1)\n\t\t} else {\n\t\t\tfmt.Println(q)\n\t\t}\n\t}\n\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "25df2e86fad6a91176263852876483a6", "src_uid": "4b3d65b1b593829e92c852be213922b6", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n \"os\"\n)\n\nfunc main() {\n var a int\n scanf(\"%d\\n\", &a)\n\tprintf(Problem617A(a))\n}\n\nfunc Problem617A(position int) (steps int) {\n\tsteps = 0\n\tfor curr := 5; curr > 0; curr-- {\n\t\tfor position >= curr {\n\t\t\tsteps++\n\t\t\tposition-=curr\n\t\t}\n\t}\n\treturn\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": "eace8219ab73fc3e0a42a6d80c368153", "src_uid": "4b3d65b1b593829e92c852be213922b6", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tc := n / 2 + n % 2\n\tstep := n / 5\n\tif n % 5 > 0 {\n\t step++\n\t}\n\tfmt.Print(step)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "322c5702cb62bd706279456818956b08", "src_uid": "4b3d65b1b593829e92c852be213922b6", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n \"os\"\n)\n\nfunc main() {\n var a int\n scanf(\"%d\\n\", &a)\n steps := Problem617A(a)\n\tprintf(steps)\n}\n\nfunc Problem617A(position int) (steps int) {\n\tsteps = 0\n\tfor curr := 5; curr > 0; curr-- {\n\t\tfor position >= curr {\n\t\t\tsteps++\n\t\t\tposition-=curr\n\t\t}\n\t}\n\treturn\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": "f8c6a1301650a815c00806833a0199a3", "src_uid": "4b3d65b1b593829e92c852be213922b6", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n, m uint64\n fmt.Scanf(\"%d %d\", &n, &m)\n res1 := [5]uint64{}\n res2 := [5]uint64{}\n for i := range(res1) {\n res1[i] = n / 5\n }\n for i := range(res2) {\n res2[i] = m / 5\n }\n if temp := n % 5; temp != 0 {\n for i := uint64(1); i <= temp; i++ {\n res1[i]++\n }\n }\n if temp := m % 5; temp != 0 {\n for i := uint64(1); i <= temp; i++ {\n res2[i]++\n }\n }\n result := uint64(0)\n for i := 0; i < 5; i++ {\n result += res1[i] * res2[(5 - i) % 5]\n }\n fmt.Println(result)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "878c26e8b0fbd1e4b3229056400bdd3a", "src_uid": "df0879635b59e141c839d9599abd77d2", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n, m uint64\n fmt.Scanf(\"%d %d\", &n, &m)\n res1 := [5]uint64{}\n res2 := [5]uint64{}\n for i := range(res1) {\n res1[i] = n / 5\n }\n for i := range(res2) {\n res2[i] = m / 5\n }\n\n if temp := n % 5; temp != 0 {\n for i := uint64(1); i <= temp; i++ {\n res1[i]++\n }\n }\n if temp := m % 5; temp != 0 {\n for i := uint64(1); i <= temp; i++ {\n res2[i]++\n }\n }\n result := uint64(0)\n for i := 0; i < 5; i++ {\n result += res1[i] * res2[(5 - i) % 5]\n }\n fmt.Println(result)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "d18913065620f4d96285653c03112747", "src_uid": "df0879635b59e141c839d9599abd77d2", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\nimport \"strconv\"\n\nfunc reverse(s string) string {\n\tchars := []rune(s)\n\tfor i, j := 0, len(chars)-1; i < j; i, j = i+1, j-1 {\n\t\tchars[i], chars[j] = chars[j], chars[i]\n\t}\n\treturn string(chars)\n}\n\nfunc main() {\n\tvar p, l int\n\tvar s int64\n\tfmt.Scan(&p)\n\tfmt.Scan(&l)\n\tfor i := 1; i < p+1; i++ {\n\t\tr, k := strconv.Itoa(i), strconv.Itoa(i)\n\t\tr = reverse(r)\n\t\tm, _ := strconv.Atoi(k + r)\n\t\ts += m\n\t}\n\ts = s % l\n\tfmt.Println(s)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "03b7bbf4d4a2e304dddace8868843a25", "src_uid": "00e90909a77ce9e22bb7cbf1285b0609", "difficulty": 1300.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\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\tn := nextInt()\n\tres := 0\n\tnFact := factorial(n)\n\tfor i := 1; i <= n; i++ {\n\t\tdown := factorial(i) * factorial(n-i)\n\t\tres += nFact / down\n\t}\n\tprintln(res)\n\n}\nfunc factorial(x int) int {\n\tif x == 0 {\n\t\treturn 1\n\t}\n\n\treturn x * factorial(x-1)\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\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, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "b0f2464d1cc7df8fc04c0814c0feb889", "src_uid": "6df251ac8bf27427a24bc23d64cb9884", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"golang.org/x/tools/go/ssa/interp/testdata/src/fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s []rune\n\tvar t []rune\n\tvar r []rune\n\tline := 1\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tfor scanner.Scan() {\n\n\t\tif line == 1 {\n\t\t\ts = []rune(scanner.Text())\n\t\t\tline += 1\n\n\t\t} else if line == 2 {\n\t\t\tt = []rune(scanner.Text())\n\t\t\tbreak\n\t\t}\n\t}\n\n\tstringLen := len(s)\n\tr = s\n\n\tfor i := stringLen - 1; i >= 0; i++ {\n\t\t//rAscii := []byte(r[i])[0]\n\t\tfor r[i] < 'z' {\n\t\t\tr[i]++\n\t\t\tif strings.Compare(string(r), string(t)) == -1 {\n\t\t\t\tfmt.Println(string(r))\n\t\t\t\tos.Exit(0)\n\t\t\t}\n\t\t}\n\t\tif r[i] == 'z' {\n\t\t\tr[i] = 'a'\n\t\t}\n\t}\n\tfmt.Println(\"No such string\")\n\tos.Exit(0)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "fb1ea287734db3ce93045ef4ef772aec", "src_uid": "47618510d2a17b1cc1e6a688201d51a3", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nconst SIDES int64 = 6\n\nfunc main() {\n\tvar n, total int64\n\n\tfmt.Scanf(\"%d\", &n)\n\n\tfor i := 0; i < n; i++ {\n\t\ttotal += (i + 1) * SIDES\n\t}\n\tfmt.Println(total + 1)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "c140507917319031c1917bb59f367a04", "src_uid": "c046895a90f2e1381a7c1867020453bd", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar num string\n\tfmt.Scan(&num)\n\n\tfor _, v := range []string{\"144\", \"14\", \"1\"} {\n\t\tnum = strings.Replace(num, v, \"\", -1)\n\t}\n\n\tif len(num) > 0 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "1da0039816bd38e883776404c2cafc39", "src_uid": "3153cfddae27fbd817caaf2cb7a6a4b5", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t//\t\"gonum.org/v1/plot\"\n\t//\t\"gonum.org/v1/plot/plotter\"\n\t//\t\"gonum.org/v1/plot/plotutil\"\n\t//\t\"gonum.org/v1/plot/vg\"\n\t//\t\"image/color\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar debug bool = debug\n\ntype line struct {\n\tx1, x2, y1, y2, m float64\n\thorizontal bool\n}\n\nfunc solve() {\n\tx1 := readFloat()\n\ty1 := readFloat()\n\tx2 := readFloat()\n\ty2 := readFloat()\n\tx3 := readFloat()\n\ty3 := readFloat()\n\n\t//\tmaxz := maxInt([...]float64{x1, x2, x3, y1, y2, y3})\n\t//\tminz := minInt([...]float64{x1, x2, x3, y1, y2, y3})\n\n\tl12 := makeLine(x1, x2, y1, y2)\n\tl13 := makeLine(x1, x3, y1, y3)\n\tl23 := makeLine(x2, x3, y2, y3)\n\n\tp12 := makePerp(l12)\n\tp13 := makePerp(l13)\n\tp23 := makePerp(l23)\n\n\tif debug {\n\t\tfmt.Println(\"M12\", l12.m, p12.m)\n\t\tfmt.Println(\"M13\", l13.m, p13.m)\n\t\tfmt.Println(\"M23\", l23.m, p23.m)\n\t}\n\n\t// find intercept\n\tix, iy := intercept(p12, p23)\n\n\ta0 := math.Atan2(y1-iy, x1-ix)\n\ta := make([]float64, 2, 2)\n\ta[0] = math.Atan2(y2-iy, x2-ix)\n\ta[1] = math.Atan2(y3-iy, x3-ix)\n\n\tif debug {\n\t\tfmt.Println(\"A\", (a[0]-a0)*(180.0/math.Pi), (a[1]-a0)*(180.0/math.Pi))\n\t}\n\n\tb := make([]float64, 2, 2)\n\ti := 3\n\tb[0] = math.Abs(math.Sin(float64(i) * (a[0] - a0)))\n\tb[1] = math.Abs(math.Sin(float64(i) * (a[1] - a0)))\n\tb[0] += math.Abs(1.0 - math.Cos(float64(i)*(a[1]-a0)))\n\tb[1] += math.Abs(1.0 - math.Cos(float64(i)*(a[1]-a0)))\n\tif debug {\n\t\tfmt.Println(\"err\", i, b[0], b[1], \"area\",\n\t\t\tarea(float64(i), ix, iy, x1, y1))\n\t}\n\n\tfound := false\n\tN := i\n\tNerr := b[0] + b[1]\n\tfor i = 3; i <= 100; i++ {\n\t\tb[0] = math.Abs(math.Sin(float64(i) * (a[0] - a0)))\n\t\tb[1] = math.Abs(math.Sin(float64(i) * (a[1] - a0)))\n\t\tb[0] += math.Abs(1.0 - math.Cos(float64(i)*(a[0]-a0)))\n\t\tb[1] += math.Abs(1.0 - math.Cos(float64(i)*(a[1]-a0)))\n\t\tif debug {\n\t\t\tfmt.Println(\"err\", i, b[0], b[1], \"area\",\n\t\t\t\tarea(float64(i), ix, iy, x1, y1))\n\t\t}\n\n\t\te := b[0] + b[1]\n\t\tif !found && e < 0.00001 {\n\t\t\tfound = true\n\t\t\tN = i\n\t\t\tNerr = e\n\t\t}\n\t}\n\tif debug {\n\t\tfmt.Println(\"N\", N, \"err\", Nerr)\n\t}\n\tfmt.Printf(\"%0.6f\\n\", area(float64(N),\n\t\tix, iy,\n\t\tx1, y1))\n\n\t// plt, err := plot.New()\n\t// if err != nil {\n\t// \tpanic(err)\n\t// }\n\t// pts := make(plotter.XYs, 3)\n\t// pts[0].X = x1\n\t// pts[0].Y = y1\n\t// pts[1].X = x2\n\t// pts[1].Y = y2\n\t// pts[2].X = x3\n\t// pts[2].Y = y3\n\t// s, err := plotter.NewScatter(pts)\n\t// if err != nil {\n\t// \tpanic(err)\n\t// }\n\t// s.GlyphStyle.Color = color.RGBA{R: 255, G: 0, B: 255, A: 255}\n\t// plt.Add(s)\n\n\t// pts[0].X = p12.x1\n\t// pts[0].Y = p12.y1\n\t// pts[1].X = p13.x1\n\t// pts[1].Y = p13.y1\n\t// pts[2].X = p23.x1\n\t// pts[2].Y = p23.y1\n\t// s, err = plotter.NewScatter(pts)\n\t// if err != nil {\n\t// \tpanic(err)\n\t// }\n\t// s.GlyphStyle.Color = color.RGBA{R: 0, G: 0, B: 255, A: 255}\n\t// plt.Add(s)\n\n\t// addLine(plt, p12.x1, p12.y1, ix, iy)\n\t// addLine(plt, p23.x1, p23.y1, ix, iy)\n\t// addLine(plt, p13.x1, p13.y1, ix, iy)\n\n\t// plt.X.Min = minz\n\t// plt.X.Max = maxz\n\t// plt.Y.Min = minz\n\t// plt.X.Max = maxz\n\n\t// if err := plt.Save(4*vg.Inch, 4*vg.Inch, \"hello.png\"); err != nil {\n\t// \tpanic(err)\n\t// }\n\n}\n\n// func addLine(p *plot.Plot, x1, y1, x2, y2 float64) {\n// \tpts := make(plotter.XYs, 2)\n// \tpts[0].X = x1\n// \tpts[0].Y = y1\n// \tpts[1].X = x2\n// \tpts[1].Y = y2\n\n// \terr := plotutil.AddLinePoints(p, \"a\", pts)\n// \tif err != nil {\n// \t\tpanic(err)\n// \t}\n// }\n\nfunc area(n, p1x, p1y, p2x, p2y float64) float64 {\n\tt := (2.0 * math.Pi) / n\n\n\tx := p1x - p2x\n\tx *= x\n\ty := p1y - p2y\n\ty *= y\n\tr := math.Sqrt(x + y)\n\n\ts := math.Sin(t)\n\tc := math.Cos(t)\n\td := r * math.Sqrt(s*s+c*c-2.0*c+1.0)\n\n\tx = r * r\n\ty = 0.25 * d * d\n\tz := math.Sqrt(x - y)\n\n\treturn (n * d * z) / 2.0\n}\n\nfunc intercept(l1, l2 line) (x, y float64) {\n\tif l1.m == 0.0 {\n\t\tif l1.horizontal {\n\t\t\ty = l1.y1\n\t\t\tx = solveX(y, l2)\n\t\t} else {\n\t\t\tx = l1.x1\n\t\t\ty = solveY(x, l2)\n\t\t}\n\t\treturn\n\t}\n\n\tif l2.m == 0.0 {\n\t\tif l2.horizontal {\n\t\t\ty = l2.y1\n\t\t\tx = solveX(y, l1)\n\t\t} else {\n\t\t\tx = l2.x1\n\t\t\ty = solveY(x, l1)\n\t\t}\n\t\treturn\n\t}\n\n\tx = (l1.m*l1.x1 - l2.m*l2.x1 - l1.y1 + l2.y1) / (l1.m - l2.m)\n\ty = l2.m*(x-l2.x1) + l2.y1\n\n\tx = l1.x1 + (y-l1.y1)/l1.m\n\tif debug {\n\t\tfmt.Println(\"old\", x, y)\n\t\tfmt.Println(\"L1\", l1.x1, l1.y1, l1.m)\n\t\tfmt.Println(\"L2\", l2.x1, l2.y1, l2.m)\n\t}\n\treturn\n}\n\nfunc solveY(x float64, l line) float64 {\n\tif l.m == 0 {\n\t\treturn l.y1\n\t}\n\treturn l.m*(x-l.x1) + l.y1\n}\n\nfunc solveX(y float64, l line) float64 {\n\tif l.m == 0 {\n\t\treturn l.x1\n\t}\n\treturn l.x1 + (y-l.y1)/l.m\n}\n\nfunc makeLine(x1, x2, y1, y2 float64) line {\n\tm := 0.0\n\th := true\n\tif x1 == x2 {\n\t\th = false\n\t\tm = 0.0\n\t} else {\n\t\tm = (y2 - y1) / (x2 - x1)\n\t}\n\n\treturn line{x1, x2, y1, y2, m, h}\n}\n\nfunc makePerp(l line) line {\n\tm := l\n\tif m.m == 0 {\n\t\tm.horizontal = !l.horizontal\n\t} else {\n\t\tm.m = -1.0 / l.m\n\t}\n\tm.x1 = (l.x1 + l.x2) / 2.0\n\tm.y1 = (l.y1 + l.y2) / 2.0\n\treturn m\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 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 readFloat() float64 {\n\tval, _ := strconv.ParseFloat(readString(), 64)\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc maxInt(a [6]float64) (m float64) {\n\tm = a[0]\n\tfor _, k := range a {\n\t\tif k > m {\n\t\t\tm = k\n\t\t}\n\t}\n\treturn\n}\n\nfunc minInt(a [6]float64) (m float64) {\n\tm = a[0]\n\tfor _, k := range a {\n\t\tif k < m {\n\t\t\tm = k\n\t\t}\n\t}\n\treturn\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "68770308abc60f269bfa630c37851066", "src_uid": "980f4094b3cfc647d6f74e840b1bfb62", "difficulty": 2100.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tn := 0\n\n\tt1 := 0\n\tt2 := 0\n\n\tfmt.Scan(&n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&t2)\n\t\tif t2 - t1 > 15 {\n\t\t\tfmt.Print(t1 + 15)\n\t\t\treturn\n\t\t}\n\t\tt1 = t2\n\n\t}\n\tif t2 <= 15 {\n\t\tfmt.Print(t2 + 15)\n\t\treturn\n\t}\n\tif t2 < 75 {\n\t\tfmt.Print(15)\n\t\treturn\n\t}\n\tfmt.Print(90)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "36fba0bf8ffed6b82d65bfe8398d4f16", "src_uid": "5031b15e220f0ff6cc1dd3731ecdbf27", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"container/list\"\n\t\"fmt\"\n)\n\ntype Item struct {\n\tvalue int\n\tdepth int\n}\n\ntype Queue struct {\n\tdata *list.List\n}\n\nfunc NewQueue() *Queue {\n\tq := new(Queue)\n\tq.data = list.New()\n\treturn q\n}\n\nfunc (q *Queue) Enqueue(v interface{}) {\n\tq.data.PushBack(v)\n}\n\nfunc (q *Queue) Dequeue() interface{} {\n\titer := q.data.Front()\n\tv := iter.Value\n\tq.data.Remove(iter)\n\treturn v\n}\n\nfunc (q *Queue) Dump() {\n\tfor iter := q.data.Front(); iter != nil; iter = iter.Next() {\n\t\tfmt.Println(\"item:\", iter.Value)\n\t}\n}\n\nfunc (q *Queue) Empty() bool {\n\treturn q.data.Len() == 0\n}\n\nfunc solve(n, m int) int {\n\tif n >= m {\n\t\treturn n - m\n\t}\n\n\tlen := m*2 + 1\n\tgraph := make([][]int, len, len)\n\tfor i := 0; i < m*2+1; i++ {\n\t\tgraph[i] = make([]int, 2, 2)\n\t}\n\n\tfor i := 1; i < len; i++ {\n\t\tgraph[i][0] = i - 1\n\t\tgraph[i][1] = i * 2\n\t}\n\n\tans := 0\n\tvisit := make([]bool, len, len)\n\tq := NewQueue()\n\tq.Enqueue(Item{value: n, depth: 0})\n\tfor !q.Empty() {\n\t\tv := q.Dequeue().(Item)\n\t\tif v.value == m {\n\t\t\tans = v.depth\n\t\t\tbreak\n\t\t}\n\n\t\tvisit[v.value] = true\n\t\tval := v.value\n\t\tif val > 0 && val < len {\n\t\t\tif graph[val][0] > 0 && graph[val][0] < len && !visit[graph[val][0]] {\n\t\t\t\tit := Item{value: graph[val][0], depth: v.depth + 1}\n\t\t\t\tq.Enqueue(it)\n\t\t\t}\n\n\t\t\tif graph[val][1] > 0 && graph[val][1] < len && !visit[graph[val][0]] {\n\t\t\t\tit := Item{value: graph[val][1], depth: v.depth + 1}\n\t\t\t\tq.Enqueue(it)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn ans\n}\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tfmt.Println(solve(n, m))\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "8623d4908490fb550ba48e866a87d58d", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "difficulty": 1400.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 %d\\n\", &n, &m)\n\tans := 0\n\n\tfor m > n {\n\t\tif m % 2 != 0 {\n\t\t\tm++\n\t\t\tans++\n\t\t} else {\n\t\t\tm /= 2\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Println(ans + (n - m))", "lang_cluster": "Go", "compilation_error": true, "code_uid": "fc4abc1df98edef9041829de52c4281e", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport \u201cfmt\u201d \n\nfunc min(a, b int) int {\n if a < b {\n return a\n }\n return b\n}\n\nfunc main() {\n var a, b, c int\n fmt.Scan(&a, &b, &c)\n b /= 2\n c /= 4\n r := min(a, b)\n r = min(r, c)\n fmt.Print(r*7)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "11b918e9662791f3da03a097e53498d1", "src_uid": "82a4a60eac90765fb62f2a77d2305c01", "difficulty": 800.0} {"lang": "Go", "source_code": "// /\\___/\\\n// ( o o )\n// / * \\\n// \\__\\_/__/ meow!\n// / \\\n// / ___ \\\n// \\/___\\/\n\npackage main\nimport \"fmt\"\nfunc main() { \n\tF := 0\n\tI := 0\n\tT := 0\n\tfmt.Scanf(\"%d %d %d\", &F, &I, &T)\n\tvar t []string\n\tfor i := 0; i < F; i++ {\n var ln string\n\t\tfmt.Scanf(\"%s\", &ln)\n if len(ln) == 0 {\n i--\n } else {\n t = append(txt, ln)\n }\n\t}\n\ta := 0\n\tfor i := 0; i < I; i++ {\n\t\tlk := 0\n\t\tfor j := 0; j < F; j++ {\n\t\t\tif t[j][i] == 'Y' {\n\t\t\t\tlk++\n\t\t\t}\n\t\t}\n\t\tif lk >= T {\n\t\t\ta++\n\t\t}\n\t}\n\tfmt.Println(a)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "e2599b46eafce3970fe45639902e89ad", "src_uid": "4c978130187e8ae6ca013d3f781b064e", "difficulty": 1900.0} {"lang": "Go", "source_code": "\ufeffpackage main\n\nimport \"fmt\"\n\nfunc main() {\n var kitten int\n var f int\n var q int\n var t int\n fmt.Scanf(\"%d\", &f)\n fmt.Scanf(\"%d\", &q)\n fmt.Scanf(\"%d\", &t)\n var love[100] int\n var c int\n var gg int\n for i := 0; i < f; i++ {\n for j := 0; j < q; gg++ {\n fmt.Scanf(\"%c\", &c)\n if c == 'Y' {\n love[j]++\n j++\n }\n if c == 'N' {\n j++\n }\n }\n }\n var lq int\n lq = gg\n lq = 0\n for i := 0; i < q; i++ {\n if (love[i] >= t) {\n lq++\n }\n }\n fmt.Println(lq)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "04f3819f380e1ee41427494ceac001f8", "src_uid": "4c978130187e8ae6ca013d3f781b064e", "difficulty": 1900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n)\n\nfunc main() {\n in := bufio.NewReader(os.Stdin)\n out := bufio.NewWriter(os.Stdout)\n defer out.Flush()\n var n int\n var s string\n fmt.Fscan(*in, &n, &s)\n \n fmt.Fprintln(*out, n + 1)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "f64d2e743c8230284a1a64b3bc673382", "src_uid": "098ade88ed90664da279fe8a5a54b5ba", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n \nfunc main() {\n\tvar n int\n\tvar s string\n \n\tfmt.Scan(&n)\n\tfmt.Scan(&s)\n \n\tfmt.Println(n + 1)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "6f587fa73adf205b40375b677c782de6", "src_uid": "098ade88ed90664da279fe8a5a54b5ba", "difficulty": 800.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 }else{\n fmt.Println(-1)\n }\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "7e7ce211c52fa8c9c7b8366366ab50a8", "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{\n\t\t\tif a+sum>8{\n \t\t sum=sum-8+a\n \t \tc=c+8\n \t\t}\n \telse{\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": "cd94319fbd10c7cf3d536fc3c62c6d6a", "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 }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 c>=k{\n fmt.Println(i)\n }else{\n fmt.Println(-1)\n }\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "644b78de7f398abc859826f16168f6aa", "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{\n\t\t\tif a+sum>8{\n \t\t sum=sum-8+a\n \t \tc=c+8\n \t\t}\n \telse{\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 }else{\n fmt.Println(-1)\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "511dea65d529c9fcacc1af6f37063116", "src_uid": "24695b6a2aa573e90f0fe661b0c0bd3a", "difficulty": 900.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(1000000007))\n\n\tfmt.Print(t3)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "6abca6032e163843b4023d44205b1179", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "difficulty": 1500.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int // membuat variabel n dengan jenis int \n var a [7]int // membuat variabel array a dengan isi 7 elemen berjenis int\n fmt.Scan(&n) // mengambil input\n for i := 0; i < 7; i++ { // looping\n fmt.Scan(&a[i]) // mengambil input ke 2\n total += a[i] / total ditambah array elemen ke i\n } \n n %= total // n dimodulo total\n ans := 0 // membuat variabel ans kemudian diisi dengan 0\n if n == 0 { // jika n sama denga 0\n ans = 6 // ans sama dengan 6\n for ; ans >= 0; ans-- { // looping ke 2\n if a[ans] > 0 { // jika array a elemen ke ans lebih besar dari 0 \n break // keluar dari fungsi\n }\n }\n } else { // lainnya\n for n > a[ans] { // looping ke 3\n n -= a[ans] // n dikurang array a elemen ke ans\n ans++ // ans ditambah\n }\n }\n fmt.Println(ans+1) // cetak hasil ans ditambah 1\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "73401aff9bfa020c378f8b5d4e3d2523", "src_uid": "007a779d966e2e9219789d6d9da7002c", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int // membuat variabel n dengan jenis int \n var a [7]int // membuat variabel array a dengan isi 7 elemen berjenis int\n fmt.Scan(&n) // mengambil input\n for i := 0; i < 7; i++ { // looping\n fmt.Scan(&a[i]) // mengambil input ke 2\n total += a[i] // total ditambah array elemen ke i\n } \n n %= total // n dimodulo total\n ans := 0 // membuat variabel ans kemudian diisi dengan 0\n if n == 0 { // jika n sama denga 0\n ans = 6 // ans sama dengan 6\n for ; ans >= 0; ans-- { // looping ke 2\n if a[ans] > 0 { // jika array a elemen ke ans lebih besar dari 0 \n break // keluar dari fungsi\n }\n }\n } else { // lainnya\n for n > a[ans] { // looping ke 3\n n -= a[ans] // n dikurang array a elemen ke ans\n ans++ // ans ditambah\n }\n }\n fmt.Println(ans+1) // cetak hasil ans ditambah 1\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "55418f6f9454a92a353997a2a5fafb87", "src_uid": "007a779d966e2e9219789d6d9da7002c", "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\nconst (\n\tcha = 2\n)\n\ntype Joystick struct {\n\tCharge int\n\tCharging bool\n}\n\nfunc main() {\n\n\tmin := 0\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tinput := scanner.Text()\n\tcharges := strings.Split(input, \" \")\n\n\tv, _ := strconv.Atoi(charges[0])\n\tj1 := Joystick{v, false}\n\tv, _ = strconv.Atoi(charges[1])\n\tj2 := Joystick{v, false}\n\n\tif j1.Charge < j2.Charge {\n\t\tj1.Charging = true\n\t} else {\n\t\tj2.Charging = true\n\t}\n\n\t// fmt.Println(j1, j2)\n\n\tif j1.Charge == 1 && j2.Chrage == 1 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tfor {\n\t\tif j1.Charge <= 0 || j2.Charge <= 0 {\n\t\t\tbreak\n\t\t}\n\t\tmin++\n\t\tif j1.Charging == true {\n\t\t\tj1.Charge++\n\t\t\tj2.Charge -= 2\n\t\t} else {\n\t\t\tj2.Charge++\n\t\t\tj1.Charge -= 2\n\t\t}\n\t\tif j1.Charge < j2.Charge {\n\t\t\tj1.Charging = true\n\t\t\tj2.Charging = false\n\t\t} else {\n\t\t\tj2.Charging = true\n\t\t\tj1.Charging = false\n\t\t}\n\n\t}\n\tfmt.Println(min)\n\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "99da1a7e84e6af2249a20e1f78d188fb", "src_uid": "ba0f9f5f0ad4786b9274c829be587961", "difficulty": 1100.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\treturn\n\t}\n\tfmt.Println(1 << (n / 2))\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a633a9c2f1f441d4e9004d17a6176fd7", "src_uid": "4b7ff467ed5907e32fd529fb39b708db", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar s string\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in, &s)\n\tcountLetter := make(map[string]int)\n\tfor _, v := range s {\n\t\tcountLetter[v]++\n\t}\n\tfmt.Fscan(in, &s)\n\tfor _, v := range s {\n\t\tcountLetter[v]++\n\t}\n\tfmt.Fscan(in, &s)\n\tfor _, v := range s {\n\t\tcountLetter[v]--\n\t}\n\tcount := 0\n\tfor _, v := range countLetter {\n\t\tif v > 0 {\n\t\t\tcount++\n\t\t}\n\t}\n\tif count > 0 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "3bd4eca40c68663cee694770b890b06c", "src_uid": "b6456a39d38fabcd25267793ed94d90c", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport \"fmt\"\n \n \nfunc main() {\n var a, b, steps int\n t := make([]int, 0)\n fmt.Scanf(\"%d %d\", &a, &b)\n fmt.Println(a, b)\n t = append(t, b)\n for {\n if a == b {\n break\n } else {\n if b % 2 == 0 {\n b = b / 2\n t = append(t, b)\n steps = steps + 1\n } else if (b - 1) % 10 == 0 {\n b = (b - 1) / 10\n t = append(t, b)\n steps = steps + 1\n } else {\n break\n }\n }\n }\n if a == b {\n fmt.Printf(\"YES\\n\")\n fmt.Printf(\"%d\\n\", steps)\n for idx := len(t) - 1; idx >= 0; id--{\n if idx == 0 {\n fmt.Printf(\"%d\\n\", t[idx])\n } else {\n fmt.Printf(\"%d \", t[idx])\n }\n }\n } else {\n fmt.Printf(\"No\\n\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "fb2dbbfb8b5e75e81a5da40b50d14676", "src_uid": "fc3adb1a9a7f1122b567b4d8afd7b3f3", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n \nimport \"fmt\"\n \n \nfunc main() {\n var a, b, steps int\n t := make([]int, 0)\n fmt.Scanf(\"%d %d\", &a, &b)\n fmt.Println(a, b)\n t = append(t, b)\n for {\n if a == b {\n break\n } else {\n if b % 2 == 0 {\n b = b / 2\n t = append(t, b)\n steps = steps + 1\n } else if (b - 1) % 10 == 0 {\n b = (b - 1) / 10\n t = append(t, b)\n steps = steps + 1\n } else {\n break\n }\n }\n }\n if a == b {\n fmt.Printf(\"YES\\n\")\n fmt.Printf(\"%d\\n\", steps)\n for idx, val := range t {\n if idx == len(range) - 1 {\n fmt.Printf(\"%d\\n\", val)\n } else {\n fmt.Printf(\"%d \", val)\n }\n }\n } else {\n fmt.Printf(\"No\\n\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "e21c56baf526e15e96b94f0a51255779", "src_uid": "fc3adb1a9a7f1122b567b4d8afd7b3f3", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n \nimport \"fmt\"\n \n \nfunc main() {\n var a, b, steps int\n t := make([]int, 0)\n fmt.Scanf(\"%d %d\", &a, &b)\n t = append(t, b)\n for {\n if a == b {\n break\n } else {\n if b % 2 == 0 {\n b = b / 2\n t = append(t, b)\n steps = steps + 1\n } else if (b - 1) % 10 == 0 {\n b = (b - 1) / 10\n t = append(t, b)\n steps = steps + 1\n } else {\n break\n }\n }\n }\n if a == b {\n fmt.Printf(\"YES\\n\")\n fmt.Printf(\"%d\\n\", steps)\n for idx := len(t) - 1; idx >= 0; id--{\n if idx == 0 {\n fmt.Printf(\"%d\\n\", t[idx])\n } else {\n fmt.Printf(\"%d \", t[idx])\n }\n }\n } else {\n fmt.Printf(\"No\\n\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "e5e787b70a3bbf547dfe7cf231bf2370", "src_uid": "fc3adb1a9a7f1122b567b4d8afd7b3f3", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\ta131()\n}\n\nfunc a131() {\n\tvar s, newS string\n\tfmt.Scan(&s)\n\tfor i := range s {\n\t\tswitch {\n\t\tcase s[i] > 96:\n\t\t\tif i == 0 {\n\t\t\t\tnewS += string(s[i] - 32)\n\t\t\t}\n\t\t\tif i == 1 {\n\t\t\t\tfmt.Println(s)\n\t\t\t}\n\t\tcase s[i] < 91:\n\t\t\tnewS += string(s[i] + 32)\n\t\tdefault:\n\t\t\tnewS += string(s[i])\n\t\t}\n\t}\n\tfmt.Println(newS)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "ee014677f9575988ee5fa848c24c2dbe", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"bytes\"\n\t\"strings\"\n\t\"io\"\n)\n\nfunc main() {\n\n\tbuf := new(bytes.Buffer)\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanLines)\n\n\tstr := \"\"\n\n\tfor sc.Scan() {\n\t\tstr = sc.Text()\n\t\tbreak\n\t}\n\tlower := \"qwertyuiopasdfghjklzxcvbnm\"\n\trd := strings.NewReader(str)\n\tsc = bufio.NewScanner(rd)\n\tsc.Split(bufio.ScanRunes)\n\ti := 0\n\tfor sc.Scan() {\n\t\ti ++\n\t\tif i == 1 {\n\t\t\t{\n\t\t\t\tbuf.WriteString(strings.ToUpper(sc.Text()))\n\n\t\t\t}\n\t\t\tbuf.WriteString(strings.ToLower(sc.Text()))\n\t\t}\n\n\t}\n\tio.Copy(os.Stdout, buf)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "6b2fb053437306a523f5291a4895a111", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\ta131()\n}\n\nfunc a131() {\n\tvar s, newS string\n\tfmt.Scan(&s)\n\tfor i := range s {\n\t\tswitch {\n\t\tcase s[i] > 96:\n\t\t\tif i == 0 {\n\t\t\t\tnewS += string(s[i] - 32)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif i == 1 {\n\t\t\t\tfmt.Println(s)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tnewS += string(s[i])\n\t\tcase s[i] < 91:\n\t\t\tnewS += string(s[i] + 32)\n\t\tdefault:\n\t\t\tnewS += string(s[i])\n\t\t}\n\t}\n\tfmt.Println(newS)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "b54724db58a9dee563319d1a9b2fc0a6", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main(){\n var rel int\n flag := false\n fmt.Scan(&rel)\n var ar [5]int\n for i:=0; i<5; i++ {\n fmt.Scan(&a)\n fmt.Scan(&b)\n ar[a]++\n ar[b]++\n }\n for i:=0; i<5; i++ {\n if(ar[i] == 2){\n flag = true\n }\n }\n if(flag)\n fmt.Println(\"WIN\");\n else\n fmt.Println(\"FAIL\");\n\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "1669a60bf091155d521eea1670bad13d", "src_uid": "2bc18799c85ecaba87564a86a94e0322", "difficulty": 1300.0} {"lang": "Go", "source_code": "package main\n \nimport (\n\t\"fmt\"\n)\n \nfunc queen(x int, y int, z int) int {\n\tres := z * 2\n\tif x == y {\n\t\tres += x * 2\n\t\treturn res\n\t} \n\tif x > y {\n\t\tres += y * 2 + 1\n\t\treturn res\n\t}\n\tif x < y {\n\t\tres += x * 2 + 1\n\t\treturn res\n\t}\n}\n \nfunc main() {\n\tvar a int\n\tvar b int\n\tvar c int\n\tfmt.Scan(&a, &b, &c)\n\tfmt.Println(queen(a, b, c))\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "f4046a7a072f9795ad62ecfe34da485b", "src_uid": "609f131325c13213aedcf8d55fc3ed77", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n \nimport (\n\t\"fmt\"\n)\n \nfunc queen(x int64, y int64, z int64) int {\n\tres := z * 2\n\tif x == y {\n\t\tres += x * 2\n\t\treturn res\n\t} else if x > y {\n\t\tres += y * 2 + 1\n\t\treturn res\n\t} else {\n\t\tres += x * 2 + 1\n\t\treturn res\n\t}\n}\n \nfunc main() {\n\tvar a int64\n\tvar b int64\n\tvar c int64\n\tfmt.Scan(&a, &b, &c)\n\tfmt.Println(queen(a, b, c))\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "2144d3091e04b78e8f43d2b60982843b", "src_uid": "609f131325c13213aedcf8d55fc3ed77", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar in = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tdefer out.Flush()\n\tin.Split(bufio.ScanWords)\n\n\ta, b ,c := nextInt(), nextInt(), nextInt()\n\n\tvar lo, hi int64 = 0, 1000000000\n\tvar m, x, rem int64 \n\tvar bad bool\n\tfor hi - lo > 1 {\n\t\t\n\t\tm = lo + (hi - lo) / 2\n\t\tx = b * m\n\t\trem = a * c - x\n\t\tbad = false\n\n\t\tfor rem > 0 {\n\t\t\tx += b\n\t\t\tx -= a\n\t\t\tif x < 0 {\n\t\t\t\tbad = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t\trem -= b\n\t\t}\n\n\t\tif bad {\n\t\t\tlo = m\n\t\t}else {\n\t\t\thi = m\n\t\t}\n\t}\n\n\tfmt.Println(hi)\n}\n\nfunc next() string {\n\tif !in.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\n\treturn in.Text()\n}\n\nfunc nextInt() int {\n\tret, _ := strconv.Atoi(next())\n\treturn ret\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "1c31bb5d4078471689abbd35679a883f", "src_uid": "7dd098ec3ad5b29ad681787173eba341", "difficulty": 1000.0} {"lang": "Go", "source_code": "import (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n,x,y int\n\tfmt.Scan(&n,&x,&y)\n\tif n==2{\n\t\tfmt.Println(\"NO\")\n\t}else\n\t{if x == n/2 || x == (n/2)+1 && y == n/2 || y == (n/2)+1{\n\t\tfmt.Println(\"NO\")\n\t}else\n\t{fmt.Println(\"YES\")}\n\t}\n\t\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "5e15955889dcadb9a5aa97a3819de365", "src_uid": "dc891d57bcdad3108dcb4ccf9c798789", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\nimport (\n\t\"fmt\"\n)\n\nfunc code877A(){\n\tvar str string\n\tfmt.Scanf(\"%s\\n\", &str)\n\tvar dest = [5]string {\"Danil\", \"Olya\", \"Slava\", \"Ann\" ,\"Nikita\"}\n\tsum := 0\n\tfor i := 0; i < 5; i++{\n\t\tsum += matchStr(str, dest[i])\n\t}\n\tif sum == 1{\n\t\tfmt.Println(\"YES\")\n\t}else{\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc matchStr(src string, dest string) int{\n\tsum := 0\n\tfor i := 0; i + len(dest) - 1 < len(src); i++{\n\t\tflag := true\n\t\tfor j := 0; j < len(dest); j++{\n\t\t\tif src[i + j] != dest[j]{\n\t\t\t\tflag = false\n\t\t\t}\n\t\t}\n\t\tif flag {\n\t\t\tsum++\n\t\t}\n\t}\n\treturn sum\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "2d0c97968f44baa94af76cf3bdf027bf", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "difficulty": 1100.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 = '\\n'\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": "34e16e606e6338b0f4deba660425ce42", "src_uid": "d86a1b5bf9fe9a985f7b030fedd29d58", "difficulty": null} {"lang": "Go", "source_code": "#include \n#include \n#include \nusing namespace std;\n\nint main() {\n int n;\n scanf(\"%d\", &n);\n vector a(n);\n for(int i = 0; i < n; i++) {\n scanf(\"%d\", &a[i]);\n }\n for(int i = 0; i < n-1; i++) {\n int x = min(a[i], a[i+1]), y = max(a[i], a[i+1]);\n for(int j = 0; j < n-1; j++) {\n int u = min(a[j], a[j+1]), v = max(a[j], a[j+1]);\n if((x < u and y > u and y < v) or (x > u and x < v and y > v)) {\n\tprintf(\"yes\\n\", i, j);\n\treturn 0;\n }\n }\n }\n printf(\"no\\n\");\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "8fcbffbda1b03431ec693394d526ab98", "src_uid": "f1b6b81ebd49f31428fe57913dfc604d", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t//\"strings\"\n\t//\"sort\"\n)\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\tvar browse []int\n\tvar e, s int\n\n\tfor i := 0; i < n; i++ {\n\t\tvar each int\n\t\tfmt.Scan(&each)\n\n\t\tif each > 0 {\n\t\t\te ++\n\t\t} else {\n\t\t\ts ++\n\t\t}\n\n\t\tbrowse = append(browse, each)\n\t}\n\n\tmax := math.MinInt64\n\n\tfor i := 0; i < k; i++ {\n\t\tvar e1, s1 int\n\t\tvar j int = i\n\n\t\tfor j < n {\n\t\t\tif browse[j] > 0 {\n\t\t\t\te1 ++\n\t\t\t} else {\n\t\t\t\ts1 ++\n\t\t\t}\n\n\t\t\tj += k\n\t\t}\n\n\t\tresult := ((e - e1) - (s - s1))\n\t\tif result < 0 {\n\t\t\tresult = -result\n\t\t}\n\n\t\tmax = int(math.Max(float64(max), float64(result)))\n\t}\n\n\tfmt.Println(max)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "2631177be35061927cef07b74ea9d2ae", "src_uid": "6119258322e06fa6146e592c63313df3", "difficulty": 1000.0} {"lang": "Go", "source_code": "\ufeffpackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m, x, y int\n\tfmt.Scan(&n, &m)\n\tif n > m {\n\t\tx = n\n\t}else{\n\t\tx = m\n\t}\n\n\tif n < m {\n\t\ty = n\n\t}else{\n\t\ty = m\n\t}\n\n\tfmt.Print( x-1, y)\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "d7d9beef86511de00f88688e388f9b19", "src_uid": "c8378e6fcaab30d15469a55419f38b39", "difficulty": 1300.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, cnt0, cnt1 int32\n\tvar str string\n\n\tfor _, c := range(str) {\n\t\tif c == '0' {\n\t\t\tcnt0 ++\n\t\t} else {\n\t\t\tcnt1 ++\n\t\t}\n\t}\n\tif (cnt0 != cnt1) {\n\t\tfmt.Println(1)\n\t\tfmt.Println(str)\n\t} else {\n\t\tfmt.Println(2)\n\t\tfmt.Println(str[0:1], str[1:])\n\t}\n}\n\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "1950972862cae247d844395263d94e39", "src_uid": "4ebed264d40a449602a26ceef2e849d1", "difficulty": 800.0} {"lang": "Go", "source_code": "n := 0\nfmt.Scanf(\"%d\", &n)\nfor i := 0; i <= 1e5; i++ {\n tmp := i\n c := 0\n for {\n if tmp % 5 {\n break\n }\n tmp /= 5\n c ++\n }\n if c < n {\n continue\n }\n if c == n {\n fmt.Println(\"5\")\n for j := i; j < i + 5; j++ {\n fmt.Print(j, \" \")\n }\n }\n if c > n {\n break\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "c54880a9172192828d42f6a8acfbb599", "src_uid": "c27ecc6e4755b21f95a6b1b657ef0744", "difficulty": 1300.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\nfunc main() {\n var n int\n fmt.Scan(&n)\n if n == 1 {\n fmt.Println(0)\n return\n }\n var fpp int64\n var fp int64 = 0\n var f int64 = 3\n for i := 3; i <= n; i++ {\n fpp = gp\n fp = g\n f = (2 * fp + 3 * fpp) % 1000000007\n }\n fmt.Println(3 * f % 1000000007)\n \n return\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a7ae3c64fffd501b99f6e4eb93db8013", "src_uid": "77627cc366a22e38da412c3231ac91a8", "difficulty": 1500.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n \n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "5efdfbddfe2eeca0b190564c77dd5d9d", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\nimport (\n \"fmt\"\n \"math\"\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": "dca4e9156c8c63fd3e2d1d5ac71af698", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\nimport \"math\"\n\nfunc main() {\n var (\n x int\n y int\n z int\n t1 int\n t2 int\n t3 int\n )\n fmt.Scanln(&x,&y,&z,&t1,&t2,&t3)\n if z == x {\n if t1*math.Abs(y-x) <= t2*math.Abs(y-x)+t3*2 {\n fmt.Println(\"NO\")\n } else {\n fmt.Println(\"YES\")\n }\n } else {\n if t1*math.Abs(y-x) <= t2*math.Abs(z-x)+t2*math.Abs(y-x)+t3*3 {\n fmt.Println(\"NO\")\n } else {\n fmt.Println(\"YES\")\n }\n }\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "2b491b85450ca91922a6ff3a7d20177a", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\nvar k, n int64\nfunc main() {\n\tfmt.Scan(&n, &k)\n\tif k == 1 {\n\t\tfmt.Print(n)\n\t} else {\n\t\tvar i uint = 1\n\t\tvar s int64\n\t\tfor s = 1; (s << 1) <= n; i++ {\n\t\t\ts <<= 1;\n\t\t}\n\t\tif(i == 64){\n\t\t\tfmt.Print(9223372036854775807)\n\t\t}else{\n\t\t\tfmt.Print((1 << i) - 1)\n\t\t}\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "5db58411f58a1d600ae5da79e7643570", "src_uid": "16bc089f5ef6b68bebe8eda6ead2eab9", "difficulty": 1300.0} {"lang": "Go", "source_code": "package main\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var n, k uint64\n fmt.Scanln(&n, &k)\n if k == 1 || n == 1 {\n fmt.Println(n)\n } else {\n var degree_2 uint64 = uint(math.Log2(float64(n)))\n result := (1 << (degree_2 + 1)) - 1\n fmt.Println(result)\n }\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "6c7964ef02b464acdf0387541ba8801d", "src_uid": "16bc089f5ef6b68bebe8eda6ead2eab9", "difficulty": 1300.0} {"lang": "Go", "source_code": "hezhao@localhost assignment1 $ vi assignment1.py\npackage main\n\nimport (\n \"fmt\"\n)\n\nfunc gcd(x, y int) int {\n if y == 0 {\n return x\n }\n return gcd(y, x%y)\n}\n\nfunc main() {\n var a, b, x, y int\n fmt.Scanf(\"%d%d%d%d\", &a, &b, &x, &y)\n c := a*b/gcd(a, b)\n fmt.Println(y/c-(x-1)/c)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "bf1d3f0b799981a78cc515f84aab1040", "src_uid": "c7aa8a95d5f8832015853cffa1374c48", "difficulty": 1200.0} {"lang": "Go", "source_code": "import java.util.Iterator;\nimport java.util.LinkedList;\nimport java.util.Scanner;\n\nclass Main {\n\n public static void main(String args[]) {\n\n Scanner stdIn = new Scanner(System.in);\n int N = stdIn.nextInt();\n stdIn.nextLine();\n String s = stdIn.nextLine();\n LinkedList queue = new LinkedList();\n for (char c : s.toCharArray()) {\n queue.add(c);\n }\n int D = 0;\n int R = 0;\n char last = ' ';\n while (queue.size() > 1) {\n int len = queue.size();\n for (Iterator iter = queue.iterator(); iter.hasNext(); ) {\n char c = iter.next();\n last = c;\n if (c == 'D') {\n if (D > 0) {\n iter.remove();\n D--;\n } else {\n R++;\n }\n } else {\n if (R > 0) {\n iter.remove();\n R--;\n } else {\n D++;\n }\n }\n }\n if (len == queue.size()) {\n break;\n }\n\n }\n System.out.println(queue.get(0));\n \n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "dbb7cd442fad79775f276e45eff681d8", "src_uid": "7725f9906a1b87bf4e866df03112f1e0", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main(){\n var target string\n\t_, err := fmt.Scanln(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.Scanln(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.Scanln(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 }else{\n fmt.Println(\"NO\")\n}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a7e130e29268ebde125a78b833d15c19", "src_uid": "cad8283914da16bc41680857bd20fe9f", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/go-redis/redis\"\n\n\t\"net/http\"\n\t\"log\"\n)\n\nfunc saveStat(redisClient *redis.Client) func (w http.ResponseWriter, r *http.Request) {\n\treturn func (w http.ResponseWriter, r *http.Request) {\n\t\terr := redisClient.Set(\"key\", \"value\", 0).Err()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tfmt.Fprintf(w, \"{\\\"status\\\": \\\"ok\\\"}\")\n\t\tfmt.Println(r.URL.Query()[\"param\"])\n\t\tfmt.Println(r.URL.Query()[\"value\"])\n\t}\n}\n\nfunc main() {\n\n\tclient := redis.NewClient(&redis.Options{\n\t\tAddr: \"127.0.0.1:6379\",\n\t\tPassword: \"\",\n\t\tDB: 0,\n\t})\n\n\thttp.HandleFunc(\"/set\", saveStat(client)) // set router\n\terr := http.ListenAndServe(\":9090\", nil) // set listen port\n\tif err != nil {\n\t\tlog.Fatal(\"ListenAndServe: \", err)\n\t}\n\n\n\n\n\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "e107c85c549a90362b579f736e8836bc", "src_uid": "21f579ba807face432a7664091581cd8", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype edge struct {\n\tid int\n\tn1 *node\n\tn2 *node\n\tw int\n\tleft int\n}\n\ntype node struct {\n\tid int\n\tedges []*edge\n}\nvar edges []*edge\nvar nodes []*node\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tq := 1\n\t//fmt.Fscanf(in, \"%d\\n\", &q)\n\tfor ii := 0; ii < q; ii++ {\n\t\tn := 0\n\t\tfmt.Fscanf(in, \"%d\\n\", &n)\n\t\tf := make([][][]int, n+1) // f[i][j] filled in the first i elements, remaining j odd number\n\t\ta := make([]int, n+1)\n\t\tfor i := 1; i <= n; i++ {\n\t\t\tfmt.Fscanf(in, \"%d\", &a[i])\n\t\t}\n\t\tfmt.Fscanf(in, \"\\n\")\n\t\tfor i := 0; i < n + 1; i++ {\n\t\t\tf[i] = make([][]int, n+1)\n\t\t\tfor j := 0; j < n + 1; j++ {\n\t\t\t\tf[i][j] = make([]int, 2)\n\t\t\t\tf[i][j][0] = 9999999999\n\t\t\t\tf[i][j][1] = 9999999999\n\t\t\t}\n\t\t}\n\t\tif a[1] == 0 {\n\t\t\tf[1][(n+1)/2-1][1] = 0\n\t\t\tif n > 1 {\n\t\t\t\tf[1][(n+1)/2][0] = 0\n\t\t\t}\n\t\t} else if a[1] % 2 == 1 {\n\t\t\tf[1][(n+1)/2-1][1] = 0\n\t\t} else {\n\t\t\tf[1][(n+1)/2][0] = 0\n\t\t}\n\t\tfor i := 2; i <= n; i++ {\n\t\t\tfor j := 0; j < n; j++ {\n\t\t\t\tif a[i] == 0 {\n\t\t\t\t\tf[i][j][0] = min(f[i-1][j][0], f[i-1][j][1] + 1)\n\t\t\t\t\tf[i][j][1] = min(f[i-1][j+1][0] + 1, f[i-1][j+1][1])\n\t\t\t\t} else if a[i] % 2 == 0 {\n\t\t\t\t\tf[i][j][0] = min(f[i-1][j][0], f[i-1][j][1] + 1)\n\t\t\t\t} else {\n\t\t\t\t\tf[i][j][1] = min(f[i-1][j+1][0] + 1, f[i-1][j+1][1])\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//fmt.Println(f[1])\n\t\tfmt.Fprintf(out, \"%d\\n\", min(f[n][0][0], f[n][0][1]))\n\t}\n\treturn\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc solve(e *edge, from *node) int {\n\tn1 := e.n1\n\tn2 := e.n2\n\tcur := 0\n\tif n1 != from {\n\t\tcur += solveNode(n1, e)\n\t\te.left = cur\n\t}\n\tif n2 != from {\n\t\tcur += solveNode(n2, e)\n\t\te.left = cur\n\t}\n\treturn e.left\n}\n\nfunc solveNode(n *node, from *edge) int {\n\tif len(n.edges) == 1 && n.edges[0] == from{\n\t\treturn 1\n\t}\n\tcur := 1\n\tfor _, e := range n.edges {\n\t\tif e != from {\n\t\t\tcur += solve(e, n)\n\t\t}\n\t}\n\treturn cur\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "77481aecc2dd4c83229dc85e183688aa", "src_uid": "90db6b6548512acfc3da162144169dba", "difficulty": 1800.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=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 == mike_is_daddy {\n fmt.Println(i)\n break\n }\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "9b009d9e7214be73ebdb378d6a62cc14", "src_uid": "0a98a6a15e553ce11cb468d3330fc86a", "difficulty": 1100.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": "7442c96459f521620dcbc90cff12694c", "src_uid": "0a98a6a15e553ce11cb468d3330fc86a", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main \n\nimport \"fmt\"\n\nfunc main() {\n\tvar yScore int\n\tfmt.Scan(&yScore)\n\tvar wScore int\n\tfmt.Scan(&wScore)\n\n\tmaxNo := yScore\n\n\tif yScore > wScore {\n\t\tmaxNo = yScore\n\t} else {\n\t\tmaxNo = wScore\n\t}\n\tmaxNo = 6 - maxNo+1\n\tmaxNo = 6 / 3\n\tif maxNo = 0 {\n\t\tmaxNo = 1\n\t}\n\tfmt.Printf(\"1/%d\", maxNo)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "a5c8b68cbfd368da40cd141dd9b57ca3", "src_uid": "f97eb4ecffb6cbc8679f0c621fd59414", "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\ta := readInt()\n\tb := readInt()\n\tif a < b {\n\t\ta = b\n\t}\n\n\tar = []string{\"0/1\", \"1/1\", \"5/6\", \"2/3\", \"1/2\", \"1/3\", \"1/6\"}\n\tfmt.Println(ar[a])\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 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", "lang_cluster": "Go", "compilation_error": true, "code_uid": "3bb56ca348c55bb1d2c6dc08e80c65c1", "src_uid": "f97eb4ecffb6cbc8679f0c621fd59414", "difficulty": 800.0} {"lang": "Go", "source_code": "import (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\ta := make([]int, n)\n\tvar k int\n\tfmt.Scanf(\"%d\", &k)\n\tb := make([]int, k)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &a[i])\n\t}\n\tfor i := 0; i < k; i++ {\n\t\tfmt.Scanf(\"%d\", &b[i])\n\t}\n\tsort.Ints(b)\n\tindex := len(b)-1\n\tfor i := 0; i < n; i++ {\n\t\tif a[i] == 0 {\n\t\t\ta[i] = b[index]\n\t\t\tindex--\n\t\t}\n\t}\n\tif isNotInc(a) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\nfunc isNotInc(a []int) bool {\n\tfor i := 1; i < len(a); i++ {\n\t\tif a[i] < a[i-1] {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "c616e158222d14e4af59e86d367d3f8b", "src_uid": "40264e84c041fcfb4f8c0af784df102a", "difficulty": 900.0} {"lang": "Go", "source_code": "\ufeffpackage main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t//\"strconv\"\n\t\"unicode\"\n)\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n input:= bufio.NewScanner(os.Stdin)\n var c rune\n input.Scan()\n s=input.Text()\n c = rune(s[len(s)-2])\n //c = unicode.ToLower(c)\n //fmt.Println(s)\n fmt.Println(string(c))\n if (c == 'a' || c == 'e' || c == 'i' || c == 'u' || c == 'o' || c == 'y') {\n \tfmt.Println(\"YES\")\n \treturn\n }\n fmt.Println(\"NO\")\n}\n\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "de28185b437eeaebb34b83b5ac673643", "src_uid": "dea7eb04e086a4c1b3924eff255b9648", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a,b string\n\tfmt.Scan(a,b)\n\tif(a = b){\n\t\tfmt.Println(a)\n\t}\n\telse {\n\t\tfmt.Println(1)\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "9454466b6a3ee8dd99c8815c450b80b4", "src_uid": "9c5b6d8a20414d160069010b2965b896", "difficulty": 800.0} {"lang": "Go", "source_code": "\ufeffpackage main\nimport (\n\t\"fmt\"\n\t//\"unicode/utf8\"\n\t//\"strconv\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tif n<3 {\n\t\tfmt.Println(\"-1\")\n\t} else {\n\t\tfor i=n;i>=1;i-- {\n\t\t\tfmt.Print(i,\" \")\n\t\t}\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "4f46977dc261bd10f56d461008cd4410", "src_uid": "fe8a0332119bd182a0a5b7758716317e", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var m, n uint64\n fmt.Scan(&n, &m)\n if n > 32 {\n fmt.Print(m)\n return\n }\n var exp uint64 = 1\n for i:=uin64(0); i= k || res%5 != 0 {\n break\n }\n res = res / 5\n cnt5++\n }\n for {\n if cnt2 >= k || res%2 != 0 {\n break\n }\n res = res / 2\n cnt2++\n }\n for i := 0; i < k; i++ {\n res = res * 10\n }\n fmt.Println(res)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "4583ecb0d1daefd10a97d31c3929c83c", "src_uid": "73566d4d9f20f7bbf71bc06bc9a4e9f3", "difficulty": 1100.0} {"lang": "Go", "source_code": "\n\n\n\n\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "c0c6b7eb04f681a6c0cfac89d8e7483e", "src_uid": "6c7ab07abdf157c24be92f49fd1d8d87", "difficulty": 900.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\tv := make([]int, 101)\n\tfor i := 0; i < n; i++ {\n\t\tv[readInt()]++\n\t}\n\tpos := 0\n\tcnt2 := 0\n\tcnt1 := 0\n\ttotal1 := 0\n\ttotal2 := 0\n\tres := make([]int, 0)\n\tfor i := 0; i < len(v); i++ {\n\t\tif v[i] != 0 {\n\t\t\tres = append(res, i)\n\t\t\tif pos%2 == 0 {\n\t\t\t\tcnt1++\n\t\t\t\ttotal1 += v[i]\n\t\t\t} else {\n\t\t\t\ttotal2 += v[i]\n\t\t\t\tcnt2++\n\t\t\t}\n\t\t\tpos++\n\t\t}\n\t}\n\tif cnt1 == cnt2 && total1 == total2 {\n\t\tfmt.Println(\"YES\")\n\t\tfor i := 0; i < len(res); i++ {\n\t\t\tif i > 0 {\n\t\t\t\tfmt.Print(\" \")\n\t\t\t}\n\t\t\tfmt.Print(res[i])\n\t\t}\n\t\tfmt.Println()\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": "60e435193dc26b177849f65ec9f13511", "src_uid": "2860b4fb22402ea9574c2f9e403d63d8", "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 solve() {\n\tn := readInt()\n\tv := make([]int, 101)\n\tfor i := 0; i < n; i++ {\n\t\tv[readInt()]++\n\t}\n\tpos := 0\n\tcnt1 := 0\n\tcnt2 := 0\n\ttotal1 := 0\n\ttotal2 := 0\n\tres := make([]int, 0)\n\tfor i := 0; i < len(v); i++ {\n\t\tif v[i] != 0 {\n\t\t\tres = append(res, i)\n\t\t\tif pos%2 == 0 {\n\t\t\t\tcnt1++\n\t\t\t\ttotal1 += v[i]\n\t\t\t} else {\n\t\t\t\ttotal2 += v[i]\n\t\t\t\tcnt2++\n\t\t\t}\n\t\t\tpos++\n\t\t}\n\t}\n\tif cnt1 == cnt2 && total1 == total2 {\n\t\tfmt.Println(\"YES\")\n\t\tfor i := 0; i < len(res); i++ {\n\t\t\tif i > 0 {\n\t\t\t\tfmt.Print(\" \")\n\t\t\t}\n\t\t\tfmt.Print(res[i])\n\t\t}\n\t\tfmt.Println()\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": "50cc1f737addd21577959b6123041179", "src_uid": "2860b4fb22402ea9574c2f9e403d63d8", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n \nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n \nfunc main() {\n\tvar n int\n\tfmt.Scan(&inp)\n\tbySum := func(x int) int { return x / 11 }\n\tpossBySum := bySum(n)\n\tbyReqSymb := func(x string) int { return strings.Count(x, \"8\") }\n\tpossByReqSymb := byReqSymb(inp)\n\tif possBySum >= possByReqSymb {\n\t\tfmt.Println(possByReqSymb)\n\t} else {\n\t\tfmt.Println(possBySum)\n\t}\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "0911976bb831db3682143c6ca4f409bf", "src_uid": "259d01b81bef5536b969247ff2c2d776", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner *bufio.Scanner\nvar writer *bufio.Writer\n\nfunc init() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter = bufio.NewWriter(os.Stdout)\n}\n\nfunc nextToken() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextToken())\n\treturn v\n}\n\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(nextToken(), 10, 64)\n\treturn v\n}\n\nfunc nextFloat() float64 {\n\tv, _ := strconv.ParseFloat(nextToken(), 64)\n\treturn v\n}\n\nfunc printInt(x int) {\n\twriter.WriteString(strconv.Itoa(x))\n}\n\nvar n int32\nvar s string\nvar a [500][500]int\n\nfunc main() {\n\tn = nextInt()\n\ts = nextToken()\n\tx, y := 250, 250\n\ta[x][y] = 1\n\tans := 0\n\tfor _, c := range s {\n\t\tswitch c {\n\t\tcase 'U':\n\t\t\ty++\n\t\tcase 'D':\n\t\t\ty--\n\t\tcase 'L':\n\t\t\tx--\n\t\tcase 'R':\n\t\t\tx++\n\t\t}\n\t\tans += a[x][y]\n\t\ta[x][y]++\n\t}\n\tprintInt(ans)\n\twriter.Flush()\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "eca4cd4141971d6421364dccfe413569", "src_uid": "7bd5521531950e2de9a7b0904353184d", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"bufio\"\nimport \"strconv\"\nimport \"os\"\n\nvar in *bufio.Scanner\nvar out *bufio.Writer\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": "6fb732e21dd1eb8a9d6bab2328c8623c", "src_uid": "0f270af00be2a523515d5e7bd66800f6", "difficulty": 2000.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 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": "5f5b7d518f021f02982704d0d124c197", "src_uid": "0f270af00be2a523515d5e7bd66800f6", "difficulty": 2000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar s string = \"\"\n\treader := bufio.NewReader(os.Stdin)\n\ts, _ := reader.ReadString('\\n')\n\tvar result string = \"\"\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i:i+1] == \".\" {\n\t\t\tresult += \"0\"\n\t\t} else if s[i:i+1] == \"-\" {\n\t\t\tif s[i+1:i+2] == \".\" {\n\t\t\t\tresult += \"1\"\n\t\t\t\ti++\n\t\t\t} else if s[i+1:i+2] == \"-\" {\n\t\t\t\tresult += \"2\"\n\t\t\t\ti++\n\t\t\t}\n\t\t}\n\n\t}\n\tfmt.Println(result)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "7945f0fafb53a0acc6dfc5a66204becc", "src_uid": "46b5a1cd1bd2985f2752662b7dbb1869", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar count [10]int\nvar numbers []int\n\nfunc initCount(n int64) int {\n\tvar cnt int\n\tfor ; n > 0; {\n\t\tcount[n%10]++\n\t\tnumbers = append(numbers, int(n%int64(10)))\n\t\tn /= 10\n\t\tcnt ++\n\t}\n\treturn cnt\n}\n\nvar dp [1<<18][100]int\n\nfunc main() {\n\tvar n, m int64\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tcnt := initCount(n)\n\tdp[0][0] = 1\n\tvar mask int = uint(1)< 0; {\n\t\tcount[n%10]++\n\t\tnumbers = append(numbers, int(n%int64(10)))\n\t\tn /= 10\n\t\tcnt ++\n\t}\n\treturn cnt\n}\n\nvar dp [1<<18][100]int64\n\nfunc main() {\n\tvar n, m int64\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tcnt := initCount(n)\n\tdp[0][0] = 1\n\tvar mask int = int(uint(1)< 0; {\n\t\tcount[n%10]++\n\t\tnumbers = append(numbers, int(n%int64(10)))\n\t\tn /= 10\n\t\tcnt ++\n\t}\n\treturn cnt\n}\n\nvar dp [1<<18][100]int\n\nfunc main() {\n\tvar n, m int64\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tcnt := initCount(n)\n\tdp[0][0] = 1\n\tvar mask int = uint(1)< 0; {\n\t\tcount[n%10]++\n\t\tnumbers = append(numbers, int(n%int64(10)))\n\t\tn /= 10\n\t\tcnt ++\n\t}\n\treturn cnt\n}\n\nvar dp [1<<18][100]int\n\nfunc main() {\n\tvar n, m int64\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tcnt := initCount(n)\n\tdp[0][0] = 1\n\tvar mask int = 1< y {return x};return y}\r\nfunc abs(x int64) int64 {if x > 0 {return x};return -x}\r\nfunc min(x, y int64) int64 {if x < y {return x};return y}\r\nfunc memset(a []int, v int) {\r\n if len(a) == 0 {return}\r\n a[0] = v\r\n for bp := 1; bp < len(a); bp *= 2 {\r\n copy(a[bp:], a[:bp])\r\n }\r\n}\r\n\r\n/* ===========================PART 2: Heap func ============================ */\r\n// type hp struct{ sort.IntSlice }\r\n// func (h hp) Less(i, j int) bool { return h.IntSlice[i] > h.IntSlice[j] }\r\n// func (h *hp) Push(v interface{}) { h.IntSlice = append(h.IntSlice, v.(int)) }\r\n// func (h *hp) Pop() interface{} { a := h.IntSlice; v := a[len(a)-1]; h.IntSlice = a[:len(a)-1]; return v }\r\n\r\n// /* ===========================PART 3: String func ============================ */\r\n// func reverse(a []byte){\r\n// \tfor i,n :=0,len(a);i 0 {\n\t\t\tpos += 1\n\t\t} else if num < 0 {\n\t\t\tneg += 1\n\t\t}\n\t}\n\n\tif neg >= (len(nums)+1)/2 {\n\t\tfmt.Println(-1)\n\t} else if pos >= (len(nums)+1)/2 {\n\t\tfmt.Println(1)\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "3f4f4b751429d697974466711e1ebd99", "src_uid": "a13cb35197f896cd34614c6c0b369a49", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var n int64\n fmt.Scan(&n)\n if n == 1 {\n fmt.Printf(\"1\\n0\")\n return\n }\n \n if min_factor(n) == 1 {\n fmt.Printf(\"1\\n0\")\n return\n }\n \n sq := int(math.Sqrt(float64(n)))\n for i := 2; i <= sq; i++ {\n if n % int64(i) == 0 {\n if min_factor(n / int64(i)) != 1 {\n fmt.Printf(\"1\\n%v\", int64(i) * min_factor(n / int64(i)))\n break\n } else {\n fmt.Printf(\"2\")\n break\n }\n }\n }\n \n return \n}\n\nfunc min_factor(x int64) int64 {\n sq := int64(math.Sqrt(float64(n)))\n for i := int64(2); i <= sq; i++ {\n if x % i == 0 {\n return i\n }\n }\n \n return 1\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "ea99526b6f6cd2872585b86045fd3401", "src_uid": "f0a138b9f6ad979c5ca32437e05d6f43", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var n int64\n fmt.Scan(&n)\n if n == 1 {\n fmt.Printf(\"1\\n0\")\n return\n }\n \n if min_factor(n) == 1 {\n fmt.Printf(\"1\\n0\")\n return\n }\n \n sq := int(math.Sqrt(float64(n)))\n for i := 2; i <= sq; i++ {\n if n % int64(i) == 0 {\n if min_factor(n / (int64)i) != 1 {\n fmt.Printf(\"1\\n%v\", int64(i) * min_factor(n / (int64)i))\n break\n } else {\n fmt.Printf(\"2\")\n break\n }\n }\n }\n \n return \n}\n\nfunc min_factor(x int64) int64 {\n sq := int64(math.Sqrt(float64(n)))\n for i := int64(2); i <= sq; i++ {\n if x % i == 0 {\n return i\n }\n }\n \n return 1\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "683d1b52ece333ab5e5768d8e0822adb", "src_uid": "f0a138b9f6ad979c5ca32437e05d6f43", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nconst maxSide = (1 << 12) - 1\n\nvar (\n\thilbert [maxSide][maxSide]bool\n\tlevel [maxSide][maxSide]float64\n)\n\nfunc build(row, col int, level uint) {\n\tif level == 1 {\n\t\treturn\n\t}\n\tside := (1 << level) - 1\n\tmidr, midc := row+side/2, col+side/2\n\n\tbuild(midr+1, col, level-1)\n\n\tfor r := 0; r < side/2; r++ {\n\t\tfor c := 0; c < side/2; c++ {\n\t\t\thilbert[midr+r+1][midc+c+1] = hilbert[midr+r+1][col+c]\n\t\t\thilbert[row+c][midc+1+side/2-1-r] = !hilbert[midr+r+1][col+c]\n\t\t\thilbert[row+side/2-c-1][col+r] = !hilbert[midr+r+1][col+c]\n\t\t}\n\t}\n\n\t// stitching\n\tfor c := col; c < col+side; c++ {\n\t\thilbert[midr][c] = false\n\t}\n\tfor r := row; r < row+side; r++ {\n\t\thilbert[r][midc] = r > midr\n\t}\n}\n\nconst eps = 1e-7\n\n// var cosa, tana2 float64 // cache\n\nfunc area(distance, a float64) float64 {\n\tif distance < 0 {\n\t\tpanic(\"Negative distance\")\n\t}\n\tif a < 0 || a > math.Pi/2 {\n\t\tpanic(\"Angle out of bounds\")\n\t}\n\n\tcosa, tana := math.Cos(a), math.Tan(a)\n\tleft := distance / cosa\n\t// Special case when angle is next to zero.\n\tif a < eps {\n\t\tif left > 1 {\n\t\t\treturn 1\n\t\t}\n\t\treturn left\n\t}\n\tright := left - tana\n\tfmt.Printf(\"distance %f, angle %f, left %f, right %f\\n\", distance, a, left, right)\n\tif left < 1 {\n\t\t// No side above the brim.\n\t\treturn (left + right) / 2\n\t}\n\tif right > 1 {\n\t\t// Both sides above the brim.\n\t\treturn 1\n\t}\n\t// Left side is above, right is not.\n\treturn 1 - (1-right)*(1-right)/(2*tana)\n}\n\nfunc main() {\n\tfmt.Println(area(1 / (8 * math.Sqrt(float64(1)/2)), math.Pi/4))\n\treturn\n\n\t/**/\n\tinput := os.Stdin\n\toutput := os.Stdout\n\t/*/\n\tinput, err := os.Open(\"important.in\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\toutput, err := os.Create(\"important.out\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t/**/\n\tvar n, a int\n\tfmt.Fscanf(input, \"%d %d\", &n, &a)\n\tfmt.Fprintf(output, \"%d %d\\n\", n, a)\n\n\tbuild(0, 0, uint(n))\n\tside := (1 << uint(n)) - 1\n\tvar queue []int\n\tarad := float64(a) * math.Pi / 180\n\tcosa := math.Cos(arad)\n\tfor c := 0; c < side; c++ {\n\t\tif !hilbert[0][c] {\n\t\t\tqueue = append(queue, 0)\n\t\t\tqueue = append(queue, c)\n\t\t\tlevel[0][c] = cosa\n\t\t}\n\t}\n\tfor ; len(queue) != 0; queue = queue[2:] {\n\t\trow, col := queue[0], queue[1]\n\t\tfmt.Println(row, col)\n\t}\n\tfmt.Println(cosa)\n\t/*\n\t\tfor i := 0; i < (1< x {\n\t\t\tmin = x\n\t\t}\n\t}\n\treturn min\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\nfunc ReadInt64() (i int64) { Scan(&i); return }\nfunc ReadInt64s(n int) []int64 {\n\tv := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "fb4d8ec677ee3a745a51b7904b338077", "src_uid": "e6dc3bc64fc66b6127e2b32cacc06402", "difficulty": 1800.0} {"lang": "Go", "source_code": "// 388A\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar x [100]int\n\tvar n, rnt int\n\tfor fmt.Scan(n) {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tfmt.Scan(x[i])\n\t\t}\n\t\tsort.Ints(x[:])\n\t\tfor rnt = 1; rnt <= n; rnt++ {\n\t\t\tfor j := 0; j < n; j++ {\n\t\t\t\tif x[j]-j/rnt < 0 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif j == n {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(rnt)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "1b1b17600562cffaed0343c67b58cfe3", "src_uid": "7c710ae68f27f140e7e03564492f7214", "difficulty": 1400.0} {"lang": "Go", "source_code": "\ufeffpackage main\nimport (\n\t\"fmt\"\n)\nfunc main() {\n\tvar n,c,x,l,e int\n\tfmt.Scan(&n,&c)\n\tv:= make([]int,n)\n\tfmt.Scan(&l)\n\te=0\n\tfor i:=1;i(l-x-c) {\n\t\t\te=e\n\t\t} else {e=l-x-c}\n\t\tl=x\n\t}\n\tfmt.Println(e)\n}\n\n\n\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "9e799825782dfb99415415d6e7bb6c94", "src_uid": "411539a86f2e94eb6386bb65c9eb9557", "difficulty": 1000.0} {"lang": "Go", "source_code": "import (\n \"fmt\"\n)\n\nfunc main() {\n int a, b, c;\n fmt.Scan(&a, &b, &c);\n int base = a;\n if (base > b - 1) {\n base = b - 1;\n }\n if (base > c - 2) {\n base = c - 2;\n }\n fmt.Println(3 * base + 3);\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "184f04ccead02f660612245b5ff7f9fd", "src_uid": "03ac8efe10de17590e1ae151a7bae1a5", "difficulty": 800.0} {"lang": "Go", "source_code": "\nimport (\n\t\"fmt\"\n)\n\nfunc min(n1 int, n2 int) int {\n\tif n1 < n2 {\n\t\treturn n1\n\t} else {\n\t\treturn n2\n\t}\n}\n\nfunc main() {\n\tvar y, b, r int\n\tfmt.Scanf(\"%d %d %d\", &y, &b, &r)\n\tyNum := min(y, min(b-1, r-2))\n\tfmt.Println(yNum*3 + 3)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "88f817da116ce723cb3a0f3b12b19f83", "src_uid": "03ac8efe10de17590e1ae151a7bae1a5", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n int a, b, c;\n fmt.Scan(&a, &b, &c);\n int base = a;\n if (base > b - 1) {\n base = b - 1;\n }\n if (base > c - 2) {\n base = c - 2;\n }\n fmt.Println(3 * base + 3);\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "e6ccd1e079713885261adb29316da12e", "src_uid": "03ac8efe10de17590e1ae151a7bae1a5", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b, c;\n fmt.Scan(&a, &b, &c);\n base := a;\n if (base > b - 1) {\n base = b - 1;\n }\n if (base > c - 2) {\n base = c - 2;\n }\n fmt.Println(3 * base + 3);\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "e0153044ca5269cd843b92706d991328", "src_uid": "03ac8efe10de17590e1ae151a7bae1a5", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n )\nfunc main(){\n int n,s\n fmt.Scan(&n,&s)\n flag := True\n for i := 0; i < n; i++ {\n int a\n fmt.Scan(&a)\n if s<=a {\n flag = False;\n }\n }\n if flag {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n \n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "df8866467e8d54c2337c43c9ead451c1", "src_uid": "496baae594b32c5ffda35b896ebde629", "difficulty": 800.0} {"lang": "Go", "source_code": "fun main()\n{\n val s = readLine()!!.toBigInteger(2).dec()\n val a = (s.bitLength() + 1) / 2\n println(a)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "3879fd9c74dbb14f0ed4cfc9f8015530", "src_uid": "d8ca1c83b431466eff6054d3b422ab47", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n//2N+1 people, then N food is enough\n//2N people, then N food is enough\nfunc main(){\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tif n & 1 == 1{\n\t\tfmt.Printf(\"%d\\n\", n >> 1)\n\t}else{ // n & 1 == 0\n\t\tvar maxpoweroftwo int\n\t\tmaxpoweroftwo = 1\n\t\twhile maxpoweroftwo <= n {\n\t\t\tmaxpoweroftwo <<= 1\n\t\t}\n\t\tfmt.Printf(\"%d\\n\", (n - maxpoweroftwo) >> 1)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "af5d4eaab37d616daf2f29ac4aeddfad", "src_uid": "422abdf2f705c069e540d4f5c09a4948", "difficulty": 2300.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc scanInput() (int64, int64, int64) {\n\tvar x, y, m int64\n\tfmt.Scanf(\"%d %d %d\\n\", &x, &y, &m)\n\treturn x, y, m\n}\n\nfunc fibo(x, y, m int64) int64 {\n\tvar n int64\n\tif n = 0; x < m && y < m && (x+y) <= y && (x+y) <= x {\n\t\tn = -1\n\t\treturn n\n\t} else if math.Signbit(float64(x)) != math.Signbit(float64(y)) {\n\t\tif x > y {\n\t\t\tx, y = y, x\n\t\t}\n\t\tn = (-x) / y\n\t\tx = -((-x) % y)\n\t}\n\n\tfor x < m && y < m {\n\t\tt := x + y\n\t\tif x < y {\n\t\t\tx = t\n\t\t} else {\n\t\t\ty = t\n\t\t}\n\t\tn++\n\t}\n\treturn n\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "2272fbd3147a90a2d18fa08c1536118a", "src_uid": "82026a3c3d9a6bda2e2ac6e14979d821", "difficulty": 1600.0} {"lang": "Go", "source_code": "# define _CRT_SECURE_NO_DEPRECATE\n# include \n# include \n# include \n# include \n# include \n# include \n# include \n# include \n# include \n# include \n# include \n# include \n# include \n# include \n# include \n# include \n# include \n# define inf 9223372036854775807\n# define mp make_pair\n# define pb push_back\n# define FOR(k,a,z) for (int k=a;k\n#include \n#define LSOne(S) (S & (-S))\n#define MAXLOG 50\n#include \n#include \n\n#define P 1000000007\n#define INF 1000000000\n\nusing namespace std;\n\nunordered_map a;\nint n;\n\n\nint main() {\n // freopen(\"input.txt\", \"r\", stdin); freopen(\"output.txt\", \"w\", stdout);\n\n cin>>n;\n int j = n-1;\n int la = 1;\n int s=0;\n\n while (j>=la) {\n\n if (j>la) {\n s+=2;\n\n int sad = n-2*la;\n if (sad>la&&sad%la==0) s+=1;\n\n sad=n-2*j;\n if (sad>j&&sad%j==0) s+=1;\n\n\n } else if(j==la){\n s+=1;\n break;\n } else break;\n\n j--;\n la++;\n }\n\n cout< n2 {\n fmt.Fprintln(out, \"First\");\n } else {\n fmt.Fprintln(out, \"Second\");\n }\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "54f55e3738bfe689c173417776bb5a46", "src_uid": "aed24ebab3ed9fd1741eea8e4200f86b", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\nfunc main() {\n var n uint64\n fmt.Scan(&n)\n if n%10 > 5 {\n fmt.Print(n+(10-(n%10)))\n } else {\n fmr.Print(n-(n%10))\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "7dbfd863a0d20e688233aeb8a900dd93", "src_uid": "29c4d5fdf1328bbc943fa16d54d97aa9", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\nfunc main() \n{\n var a int\n fmt.Scanf(\"%a\", &a)\n fmt.Println(a / 2520)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "ce83a68301ace922d553f43b8f1a2e9f", "src_uid": "8551308e5ff435e0fc507b89a912408a", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\nfunc main() {\n var a long long\n fmt.Scanf(\"%lld\", &a)\n fmt.Println(a / 2520)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "4c1801fb34512f871eaa2dfd1d7b0910", "src_uid": "8551308e5ff435e0fc507b89a912408a", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\nfunc main() {\n var a long long\n fmt.Scanf(\"%d\", &a)\n fmt.Println(a / 2520)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "dd9edefdb8076c43a4e494abd12625d4", "src_uid": "8551308e5ff435e0fc507b89a912408a", "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\tfmt.Println(math.MaxInt32)\n\tfmt.Println(math.MaxInt64)\n\tfmt.Println(math.MaxFloat32)\n\tfmt.Println(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\tresp := math.Min(float64(int64(b_cf702d)*d), startCar(d))\n\n\tfmt.Println(resp)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "e13a1d4303cff73a5a79f467b071f7da", "src_uid": "359ddf1f1aed9b3256836e5856fe3466", "difficulty": 1900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"bufio\"\n\t\"os\"\n)\n\nfunc solve(k, a, b int64) int64 {\n\ta0 := a / k\n\tb0 := b / k\n\tif a - a0 * k > b0 * (k - 1) {\n\t\treturn -1\n\t}\n\tif b - b0 * k > a0 * (k - 1) {\n\t\treturn -1\n\t}\n\treturn a0 + b0\n}\n\nfunc main() {\n\tcin := NewParser(bufio.NewReaderSize(os.Stdin, 1<<16))\n\tk := cin.nextInt64()\n\ta := cin.nextInt64()\n\tb := cin.nextInt64()\n\tfmt.Printf(\"%d\\n\", solve(k, a, b))\n}\n\ntype ParserReader struct {\n\tr io.ByteReader\n\terr error\n\tc byte\n}\n\nfunc NewParser(r io.ByteReader) *ParserReader {\n\treturn &ParserReader{r, nil, 0}\n}\n\nfunc (p *ParserReader) next() error {\n\tp.c, p.err = p.r.ReadByte()\n\treturn p.err\n}\n\nfunc isDigit(c byte) bool {\n\treturn '0' <= c && c <= '9'\n}\n\nfunc (p *ParserReader) nextUInt64() uint64 {\n\tfor !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar r uint64\n\tfor isDigit(p.c) && p.err == nil {\n\t\tr := r*10 + (p.c - '0')\n\t\tp.next()\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextUInt() uint {\n\tfor !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar r uint\n\tfor isDigit(p.c) && p.err == nil {\n\t\tr := r*10 + (p.c - '0')\n\t\tp.next()\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextInt64() int64 {\n\tfor p.c != '-' && !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar sign bool\n\tif p.c == '-' {\n\t\tsign = true\n\t}\n\tr := int64(p.nextUInt64())\n\tif sign {\n\t\treturn -r\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextInt() int {\n\tfor p.c != '-' && !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar sign bool\n\tif p.c == '-' {\n\t\tsign = true\n\t}\n\tr := int(p.nextUInt())\n\tif sign {\n\t\treturn -r\n\t}\n\treturn r\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "673a42fb84055af57ef96e7defb32edd", "src_uid": "6e3b8193d1ca1a1d449dc7a4ad45b8f2", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"github.com/qiuyesuifeng/goyacc/Godeps/_workspace/src/github.com/cznic/mathutil\"\n)\n\nfunc main() {\n\tli := make([]int, 5)\n\tsum := 0\n\tfor i := 0 ; i < 5; i++ {\n\t\tfmt.Scanf(\"%d\", &li[i])\n\t\tsum += li[i]\n\t}\n\tsort.Ints(li)\n\tcut := 0\n\tfor i:=4; i>= 0; i-- {\n\t\tif i >= 2 && li[i] == li[i-1] && li[i-1] == li[i-2] {\n\t\t\tcut = mathutil.Max(cut, li[i] * 3)\n\t\t}\n\t\tif i >= 1 && li[i] == li[i-1] {\n\t\t\tcut = mathutil.Max(cut, li[i] * 2)\n\t\t}\n\t}\n\tfmt.Printf(\"%d\", sum-cut)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "73908fdd2da2c8f23a24bd70678ad207", "src_uid": "a9c17ce5fd5f39ffd70917127ce3408a", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF1183H(_r io.Reader, _w io.Writer) {\n\tvar n int\n\tvar k, ans int64\n\tvar s []byte\n\tFscan(bufio.NewReader(_r), &n, &k, &s)\n\tprev := [26]int{}\n\tdp := make([][]int64, n+1)\n\tfor i := range dp {\n\t\tdp[i] = make([]int64, n+1)\n\t}\n\tdp[0][0] = 1\n\tfor i := 1; i <= n; i++ {\n\t\tc := s[i-1] - 'a'\n\t\tdp[i][0] = 1\n\t\tfor j := 1; j <= i; j++ {\n\t\t\tdp[i][j] = dp[i-1][j] + dp[i-1][j-1]\n\t\t\tif p := prev[c]; p > 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\n//func main() { CF1183H(os.Stdin, os.Stdout) }\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "9f68f162684706bfb4677f6d38f34aca", "src_uid": "ae5d21919ecac431ea7507cb1b6dc72b", "difficulty": 2000.0} {"lang": "Go", "source_code": "/*********************************************************************************\n* File Name : A.go\n* Created By : YIMMON, yimmon.zhuang@gmail.com\n* Creation Date : [2014-03-04 23:07]\n* Last Modified : [2014-03-04 23:29]\n* Description :\n**********************************************************************************/\n\npackage main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n)\n\nfunc main() {\n scanner.Split(bufio.ScanWords)\n\n var n, p, k = scanner.nextInt(), scanner.nextInt(), scanner.nextInt()\n if p-k > 1 {\n fmt.Print(\"<< \")\n }\n for i := max(1, p-k); i < p; i++ {\n fmt.Printf(\"%d \", i)\n }\n fmt.Printf(\"(%d)\", p)\n for i := p + 1; i <= n && i <= p+k; i++ {\n fmt.Printf(\" %d\", i)\n }\n if p+k < n {\n fmt.Print(\" >>\")\n }\n fmt.Println()\n}\n\nfunc max(a, b int) int {\n if a > b {\n return a\n }\n return b\n}\n\ntype Scanner struct {\n *bufio.Scanner\n}\n\nvar scanner = Scanner{bufio.NewScanner(os.Stdin)}\n\nfunc (self *Scanner) next() string {\n if !self.Scan() {\n panic(self.Err())\n }\n return self.Text()\n}\n\nfunc (self *Scanner) nextInt() int {\n x, err := strconv.Atoi(self.next())\n if err != nil {\n panic(err)\n }\n return x\n}/*********************************************************************************\n* File Name : A.go\n* Created By : YIMMON, yimmon.zhuang@gmail.com\n* Creation Date : [2014-03-04 23:07]\n* Last Modified : [2014-03-04 23:29]\n* Description :\n**********************************************************************************/\n\npackage main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n)\n\nfunc main() {\n scanner.Split(bufio.ScanWords)\n\n var n, p, k = scanner.nextInt(), scanner.nextInt(), scanner.nextInt()\n if p-k > 1 {\n fmt.Print(\"<< \")\n }\n for i := max(1, p-k); i < p; i++ {\n fmt.Printf(\"%d \", i)\n }\n fmt.Printf(\"(%d)\", p)\n for i := p + 1; i <= n && i <= p+k; i++ {\n fmt.Printf(\" %d\", i)\n }\n if p+k < n {\n fmt.Print(\" >>\")\n }\n fmt.Println()\n}\n\nfunc max(a, b int) int {\n if a > b {\n return a\n }\n return b\n}\n\ntype Scanner struct {\n *bufio.Scanner\n}\n\nvar scanner = Scanner{bufio.NewScanner(os.Stdin)}\n\nfunc (self *Scanner) next() string {\n if !self.Scan() {\n panic(self.Err())\n }\n return self.Text()\n}\n\nfunc (self *Scanner) nextInt() int {\n x, err := strconv.Atoi(self.next())\n if err != nil {\n panic(err)\n }\n return x\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "11248231863b16dad0d40b8c8d8cfe9b", "src_uid": "526e2cce272e42a3220e33149b1c9c84", "difficulty": null} {"lang": "Go", "source_code": "package main\n\nimport \"testing\"\n\nfunc Test_paintTheNumbers(t *testing.T) {\n\ttype args struct {\n\t\tn int\n\t\tslice []int\n\t}\n\ttests := []struct {\n\t\tname string\n\t\targs args\n\t\twant int\n\t}{\n\t\t{\n\t\t\tname: \"TC_01\",\n\t\t\targs: args{\n\t\t\t\tn: 6,\n\t\t\t\tslice: []int{10, 2, 3, 5, 4, 2},\n\t\t\t},\n\t\t\twant: 3,\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tif got := paintTheNumbers(tt.args.n, tt.args.slice); got != tt.want {\n\t\t\t\tt.Errorf(\"paintTheNumbers() = %v, want %v\", got, tt.want)\n\t\t\t}\n\t\t})\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "f843c90c0eeaacfa34b2f4893b953bcd", "src_uid": "63d9b7416aa96129c57d20ec6145e0cd", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar i, n int64\n\t\n\tfmt.Scanf(\"%d\", &n)\n\n\ttotal := 0\n\tfor i = 1; i <= n; i++ {\n\t\ttotal += int64(math.Pow(2.0, float64(i)))\n\t}\n\tfmt.Println(total)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "024a6ca7c11b3eb1431355e13a978ca2", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n int64\n\t\n\tfmt.Scanf(\"%d\", &n)\n\n\ttotal := 0\n\tfor i := 1; i <= n; i++ {\n\t\ttotal += int64(math.Pow(2.0, float64(i)))\n\t}\n\tfmt.Println(total)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "8fab934c22659d9a9ee43cb20a959649", "src_uid": "f1b43baa14d4c262ba616d892525dfde", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"sort\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF582B(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar n, t, d int\n\tFscan(in, &n, &t)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\tFscan(in, &a[i])\n\t}\n\tdp := []int{}\n\tfor i := 0; i < n+10 && t > 0; i++ {\n\t\tt--\n\t\tcur := len(dp)\n\t\tfor _, v := range a {\n\t\t\tif p := sort.SearchInts(dp, v+1); p < len(dp) {\n\t\t\t\tdp[p] = v\n\t\t\t} else {\n\t\t\t\tdp = append(dp, v)\n\t\t\t}\n\t\t}\n\t\td = len(dp) - cur\n\t\tcur = len(dp)\n\t}\n\tif t == 0 {\n\t\tFprint(out, len(dp))\n\t\treturn\n\t}\n\tFprintln(out, len(dp)+t*d)\n}\n\n//func main() { CF582B(os.Stdin, os.Stdout) }\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "b309049d57ae9730a67a2007a6456f5a", "src_uid": "26cf484fa4cb3dc2ab09adce7a3fc9b2", "difficulty": 1900.0} {"lang": "Go", "source_code": "// 378A\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n var a, b, wina, winb, draw int\n fmt.Scan(&a, &b)\n for x := 1; x <= 6; x++ {\n\t\tai := float64(x)-a\n\t\tbi := float64(x)-b\n if math.Abs(ai) < math.Abs(bi) {\n wina++\n } else if math.Abs(ai) > math.Abs(bi) {\n winb++\n } else {\n draw++\n }\n }\n fmt.Println(wina, draw, winb)\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "6e35062e041139a35954a72b14621677", "src_uid": "504b8aae3a3abedf873a3b8b127c5dd8", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\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\nfunc main() {\n\tvar n, m int\n\tfmt.Scanln(&n,&m)\n\t//fmt.Println(n,m)\n\ta := make([]int, n)\n\tb := make([]int, m)\n\tfor i := 0; i < n; i++{\n\t\tif(i < n-1){\n\t\t\tfmt.Scanf(\"%d\",&a[i])\n\t\t} else {\n\t\t\tfmt.Scanf(\"%d\\n\",&a[i])\n\t\t}\n\t\t//fmt.Printf(\"%d\\n\",a[i])\n\t}\n\tfor i := 0; i < m; i++{\n\t\tif(i < m-1){\n\t\t\tfmt.Scanf(\"%d\",&b[i])\n\t\t} else {\n\t\t\tfmt.Scanf(\"%d\\n\",&b[i])\n\t\t}\n\t\t//fmt.Printf(\"%d\\n\",b[i])\n\t}\n\tsort.Ints(a)\n\tsort.Ints(b)\n\tvar ans int = 99999999\n\tfor i := 0; i < n; i++{\n\t\tfor j := 0; j < m; j++{\n\t\t\tif a[i] == b[j]{\n\t\t\t\tans = min(ans,a[i])\n\t\t\t}\n\t\t}\n\t}\n\tif(ans == 99999999){\n\t\tans = min(a[0] * 10 + b[0], b[0] * 10 + a[0])\n\t}\n\tfmt.Println(ans)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "8a683d4754ea3fd96de7aaf6b4bc6a44", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\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\nfunc main() {\n\tvar n, m int\n\tfmt.Scanln(&n,&m)\n\t//fmt.Println(n,m)\n\ta := make([]int, n)\n\tb := make([]int, m)\n\tfor i := 0; i < n; i++{\n\t\tif(i < n-1){\n\t\t\tfmt.Scanf(\"%d\",&a[i])\n\t\t} else {\n\t\t\tfmt.Scanf(\"%d\\n\",&a[i])\n\t\t}\n\t\t//fmt.Printf(\"%d\\n\",a[i])\n\t}\n\tfor i := 0; i < m; i++{\n\t\tif(i < m-1){\n\t\t\tfmt.Scanf(\"%d\",&b[i])\n\t\t} else {\n\t\t\tfmt.Scanf(\"%d\\n\",&b[i])\n\t\t}\n\t\t//fmt.Printf(\"%d\\n\",b[i])\n\t}\n\tsort.Ints(a)\n\tsort.Ints(b)\n\tvar ans int = 99999999\n\tfor i := 0; i < n; i++{\n\t\tfor j := 0; j < m; j++{\n\t\t\tif a[i] == b[j]{\n\t\t\t\tans = min(ans,a[i])\n\t\t\t}\n\t\t}\n\t}\n\tif(ans == 99999999){\n\t\tans = min(a[0] * 10 + b[0], b[0] * 10 + a[0])\n\t}\n\tfmt.Println(ans)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "5d6ebbe2a2c7446a1d2acc10c1ac95ed", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "difficulty": 900.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\tm := readInt()\n\n\tns := make(map[int]bool, n)\n\tfor i := 0; i < n; i++ {\n\t\tns[readInt()] = true\n\t}\n\n\tms := make(map[int]bool, m)\n\tfor i := 0; i < m; i++ {\n\t\tms[readInt()] = true\n\t}\n\n\tfor i := 1; i <= 9; i++ {\n\t\tif ms[i] && ns[i] {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t}\n\tfor i := 10; i <= 99; i++ {\n\t\tif ms[i/10] && ns[i%10] {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t\tif ns[i/10] && ms[i%10] {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\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 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", "lang_cluster": "Go", "compilation_error": false, "code_uid": "4eedf6e979bf13d7f1fb5c2e3db62d41", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\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\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d%d\",&n,&m)\n\ta := make([]int, n)\n\tb := make([]int, m)\n\tfor i := 0; i < n; i++{\n\t\tfmt.Scanf(\"%d\",&a[i])\n\t}\n\tfor i := 0; i < n; i++{\n\t\tfmt.Scanf(\"%d\",&b[i])\n\t}\n\tsort.Ints(a)\n\tsort.Ints(b)\n\tvar ans int = 99999999\n\tfor i := 0; i < n; i++{\n\t\tfor j := 0; j < m; j++{\n\t\t\tif a[i] == b[j]{\n\t\t\t\tans = min(ans,a[i])\n\t\t\t}\n\t\t}\n\t}\n\tif(ans == 0){\n\t\tans = min(a[0] * 10 + b[0], b[0] * 10 + a[0])\n\t}\n\tfmt.Println(ans)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "2faf13eff0e178f23b4a3a92bd0009d5", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\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\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\",&n,&m)\n\ta := make([]int, n)\n\tb := make([]int, m)\n\tfor i := 0; i < n; i++{\n\t\tfmt.Scanf(\"%d\",&a[i])\n\t}\n\tfor i := 0; i < m; i++{\n\t\tfmt.Scanf(\"%d\",&b[i])\n\t}\n\tsort.Ints(a)\n\tsort.Ints(b)\n\tvar ans int = 99999999\n\tfor i := 0; i < n; i++{\n\t\tfor j := 0; j < m; j++{\n\t\t\tif a[i] == b[j]{\n\t\t\t\tans = min(ans,a[i])\n\t\t\t}\n\t\t}\n\t}\n\tif(ans == 99999999){\n\t\tans = min(a[0] * 10 + b[0], b[0] * 10 + a[0])\n\t}\n\tfmt.Println(ans)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "e40172e5b6cba8cbcea7ae04256d7995", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\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\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d%d\",&n,&m)\n\ta := make([]int, n)\n\tb := make([]int, m)\n\tfor i := 0; i < n; i++{\n\t\tfmt.Scanf(\"%d\",&a[i])\n\t}\n\tfor i := 0; i < m; i++{\n\t\tfmt.Scanf(\"%d\",&b[i])\n\t}\n\tsort.Ints(a)\n\tsort.Ints(b)\n\tvar ans int = 99999999\n\tfor i := 0; i < n; i++{\n\t\tfor j := 0; j < m; j++{\n\t\t\tif a[i] == b[j]{\n\t\t\t\tans = min(ans,a[i])\n\t\t\t}\n\t\t}\n\t}\n\tif(ans == 99999999){\n\t\tans = min(a[0] * 10 + b[0], b[0] * 10 + a[0])\n\t}\n\tfmt.Println(ans)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "0c8bdcc49f039a231614386b3bd3aaf6", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\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\nfunc main() {\n\tvar n, m int\n\tfmt.Scanln(&n,&m)\n\tfmt.Println(n,m)\n\ta := make([]int, n)\n\tb := make([]int, m)\n\tfor i := 0; i < n; i++{\n\t\tif(i < n-1){\n\t\t\tfmt.Scanf(\"%d\",&a[i])\n\t\t} else {\n\t\t\tfmt.Scanf(\"%d\\n\",&a[i])\n\t\t}\n\t\tfmt.Printf(\"%d\\n\",a[i])\n\t}\n\tfor i := 0; i < m; i++{\n\t\tif(i < m-1){\n\t\t\tfmt.Scanf(\"%d\",&b[i])\n\t\t} else {\n\t\t\tfmt.Scanf(\"%d\\n\",&b[i])\n\t\t}\n\t\tfmt.Printf(\"%d\\n\",b[i])\n\t}\n\tsort.Ints(a)\n\tsort.Ints(b)\n\tvar ans int = 99999999\n\tfor i := 0; i < n; i++{\n\t\tfor j := 0; j < m; j++{\n\t\t\tif a[i] == b[j]{\n\t\t\t\tans = min(ans,a[i])\n\t\t\t}\n\t\t}\n\t}\n\tif(ans == 99999999){\n\t\tans = min(a[0] * 10 + b[0], b[0] * 10 + a[0])\n\t}\n\tfmt.Println(ans)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "8961ead9443ae5a8fed34a06111dcb03", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\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\nfunc main() {\n\tvar n, m int\n\tfmt.Scanln(&n,&m)\n\tfmt.Println(n,m)\n\ta := make([]int, n)\n\tb := make([]int, m)\n\tfor i := 0; i < n; i++{\n\t\tif(i < n-1){\n\t\t\tfmt.Scanf(\"%d\",&a[i])\n\t\t} else {\n\t\t\tfmt.Scanf(\"%d\\n\",&a[i])\n\t\t}\n\t\t//fmt.Printf(\"%d\\n\",a[i])\n\t}\n\tfor i := 0; i < m; i++{\n\t\tif(i < m-1){\n\t\t\tfmt.Scanf(\"%d\",&b[i])\n\t\t} else {\n\t\t\tfmt.Scanf(\"%d\\n\",&b[i])\n\t\t}\n\t\t//fmt.Printf(\"%d\\n\",b[i])\n\t}\n\tsort.Ints(a)\n\tsort.Ints(b)\n\tvar ans int = 99999999\n\tfor i := 0; i < n; i++{\n\t\tfor j := 0; j < m; j++{\n\t\t\tif a[i] == b[j]{\n\t\t\t\tans = min(ans,a[i])\n\t\t\t}\n\t\t}\n\t}\n\tif(ans == 99999999){\n\t\tans = min(a[0] * 10 + b[0], b[0] * 10 + a[0])\n\t}\n\tfmt.Println(ans)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "0112d914aedb9c49317836b95ea3d699", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\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\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\\n\",&n,&m)\n\ta := make([]int, n)\n\tb := make([]int, m)\n\tfor i := 0; i < n; i++{\n\t\tif i != n-1{\n\t\t\tfmt.Scanf(\"%d\",&a[i])\n\t\t}else{\n\t\t\tfmt.Scanf(\"%d\\n\",&a[i])\n\t\t}\n\t}\n\tfor i := 0; i < m; i++{\n\t\tif i != m-1{\n\t\t\tfmt.Scanf(\"%d\",&b[i])\n\t\t}else{\n\t\t\tfmt.Scanf(\"%d\\n\",&b[i])\n\t\t}\n\n\t}\n\tsort.Ints(a)\n\tsort.Ints(b)\n\tvar ans int = 99999999\n\tfor i := 0; i < n; i++{\n\t\tfor j := 0; j < m; j++{\n\t\t\tif a[i] == b[j]{\n\t\t\t\tans = min(ans,a[i])\n\t\t\t}\n\t\t}\n\t}\n\tif(ans == 99999999){\n\t\tans = min(a[0] * 10 + b[0], b[0] * 10 + a[0])\n\t}\n\tfmt.Println(ans)\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "93594286d75703b0d24fa3f19ed2f1bd", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, m, z, cnt, cnt1, cnt2 int\n\n\tfmt.Scanln(&n, &m)\n\tt := make([]int, n)\n\tres := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &z)\n\n\t\tt[i] = z\n\t}\n\n\tfor x, y := range t {\n\t\tcnt += y\n\t\tif cnt > m {\n\t\t\tcnt2 = cnt\n\t\t\tsort.Ints(t[:x])\n\t\t\tfor i := len(t[:x]) - 1; i >= 0; i-- {\n\n\t\t\t\tcnt2 -= t[i]\n\t\t\t\tcnt1++\n\n\t\t\t\tif cnt2 <= m {\n\t\t\t\t\tres[x] = cnt1\n\t\t\t\t\tcnt1 = 0\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tres[x] = 0\n\t\t}\n\t}\n\n\tfor _, y := range res {\n\t\tfmt.Printf(\"%d \", y)\n\t}\n\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "045f029bb3882249493d3b4bbfe90f00", "src_uid": "d3c1dc3ed7af2b51b4c49c9b5052c346", "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, m := 0, 0\n\tfmt.Fscanf(in, \"%d %d\\n\", &n, &m)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(in, \"%d\", &a[i])\n\t}\n\tcnt := make([]int, 101)\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tans := 0\n\t\tsum += a[i]\n\t\ttmp := sum\n\t\t//fmt.Println(\"begin\", i)\n\t\tfor j := 100; j >= 1; j-- {\n\t\t\tif tmp <= m {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif cnt[j] == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t//fmt.Println(j, cnt[j], tmp)\n\t\t\tneed := (tmp - m) / j\n\t\t\tif (tmp-m)%j != 0 {\n\t\t\t\tneed++\n\t\t\t}\n\t\t\tif need <= cnt[j] {\n\t\t\t\tans += need\n\t\t\t\ttmp -= need * j\n\t\t\t} else {\n\t\t\t\tans += cnt[j]\n\t\t\t\ttmp -= cnt[j] * j\n\t\t\t}\n\t\t}\n\t\tcnt[a[i]]++\n\t\tif i != 0 {\n\t\t\tfmt.Fprintf(out, \" \")\n\t\t}\n\t\tfmt.Fprintf(out, \"%d\", ans)\n\t}\n\tfmt.Fprintf(out, \"\\n\")\n\treturn\n}\n\nfunc gcd(a, b uint64) uint64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%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 min(a, b int) int {\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 ok(a, b int) bool {\n\tif min(abs(a-b), abs(a+b)) <= min(abs(a), abs(b)) && max(abs(a+b), abs(a-b)) >= max(abs(a), abs(b)) {\n\t\treturn true\n\t}\n\treturn false\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "80116f6a8df2528317bb2a474ab1404f", "src_uid": "d3c1dc3ed7af2b51b4c49c9b5052c346", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar d, cnt, index int\n\tvar st, st1 string\n\tfmt.Scanln(&d)\n\n\tfor d > 0 {\n\t\tfmt.Scanln(&st)\n\t\tfmt.Scanln(&st1)\n\t\ta := make([]rune, 0)\n\t\tb := make([]rune, 0)\n\n\t\tfor _, y := range st {\n\t\t\ta = append(a, y)\n\t\t}\n\t\tif len(st) > len(st1) {\n\t\t\tcnt = 5\n\t\t}\n\n\t\tfor _, y := range st1 {\n\t\t\tif len(b) > len(a) {\n\t\t\t\tcnt = 5\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif (index <= len(a)-1) && (a[index] == y) {\n\t\t\t\tb = append(b, y)\n\t\t\t\tindex++\n\t\t\t\tcontinue\n\t\t\t} else if (len(b) > 1) && (y == b[len(b)-1]) {\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tcnt = 5\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif cnt == 5 {\n\t\t\tfmt.Println(\"NO\")\n\t\t} else {\n\t\t\tfmt.Println(\"YES\")\n\t\t}\n\t\tcnt = 0\n\t\tindex = 0\n\n\t\td--\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "f86108278b8249306fe168110c5842ce", "src_uid": "d3c1dc3ed7af2b51b4c49c9b5052c346", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nvar(\n\tn int\t\t\t\t/*Number of students*/\n\tM int\t\t\t\t/*Maximum time*/\n\tt[110] int \t\t/*Students' time*/\n\tsum[110] int \t\t/*sum [0..i)*/\n\tbuffer[110] int \t/*used for sorting*/\n)\n\n\n\nfunc main(){\n\t//input\n\tfmt.Scanf(\"%d %d\", &n, &M)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &t[i])\n\t}\n\n\tsum[0] = 0\n\tfor i := 1; i < n; i++ {\n\t\tsum[i] = sum[i - 1] + t[i - 1]\n\t}\n\tbuffer = sum\n\n\tfor i := 0; i < n; i++ {\t/*Next student*/\n\t\tans := 0\n\t\trequired := M - t[i]\n\t\tcurrent := sum[i]\n\t\tif current > required{\n\t\t\tcopy(buffer[0:i], t[0:i])\n\t\t\tsort.Ints(buffer[0:i])\n\t\t}\n\t\tfor current > required {\n\t\t\tans++\n\t\t\tcurrent -= buffer[i - ans] /*M > t[i]*/\n\t\t}\n\t\tfmt.Printf(\"%d \", ans)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "f199ea58d1a60b6c390665924daa5ac5", "src_uid": "d3c1dc3ed7af2b51b4c49c9b5052c346", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\nimport\n(\n \"fmt\"\n // \"math\"\n)\nfunc main(){\n var i int\n fmt.Scanf(\"%d\" , &i)\n // temp:= i\n x :=1\n count := 0\n var s []int\n for ;x81){\n continue\n }\n temp := x\n rs := (i-x)\n // temp2 :=1\n // fmt.Println(x)\n sum :=0\n for ;temp>0;temp/=10{\n\n // fmt.Println(mult)\n // var digits [] int\n\n xlast := temp%10\n sum +=xlast\n\n // res := temp + xlast\n // fmt.Println(temp,xlast)\n\n }\n if sum==rs{\n s = append(s,x)\n count ++\n }\n }\n if (count == 0){\nfmt.Println(0)\n}else\n{\n fmt.Println(count)\n for x:=0;x0;temp/=10{\n\n // fmt.Println(mult)\n // var digits [] int\n\n xlast := temp%10\n sum +=xlast\n\n // res := temp + xlast\n // fmt.Println(temp,xlast)\n\n }\n if sum==rs{\n s = append(s,x)\n count ++\n }\n }\n if (count == 0){\nfmt.Println(0)\n}else\n{\n for x:=0;x81){\n continue\n }\n temp := x\n rs := (i-x)\n // temp2 :=1\n // fmt.Println(x)\n sum :=0\n for ;temp>0;temp/=10{\n\n // fmt.Println(mult)\n // var digits [] int\n\n xlast := temp%10\n sum +=xlast\n\n // res := temp + xlast\n // fmt.Println(temp,xlast)\n\n }\n if sum==rs{\n s = append(s,x)\n count ++\n }\n }\n if (count == 0){\nfmt.Println(0)\n}else\n{\n for x:=0;x0;mult++{\n\n // fmt.Println(mult)\n\n coef := math.Pow(10,float64(mult))\n // fmt.Println(coef)\n xlast := x%int(coef)\n temp = x/int(coef)\n if temp == 0{\n break\n }\n res := temp + xlast\n // fmt.Println(temp,xlast)\n if rs==res{\n s = append(s,x)\n count ++\n }\n }\n\n }\n if (count == 0){\nfmt.Println(0)\n}else\n{\n for x:=0;x81){\n break\n }\n temp := x\n rs := (i-x)\n // temp2 :=1\n // fmt.Println(x)\n sum :=0\n for ;temp>0;temp/=10{\n\n // fmt.Println(mult)\n // var digits [] int\n\n xlast := temp%10\n sum +=xlast\n\n // res := temp + xlast\n // fmt.Println(temp,xlast)\n\n }\n if sum==rs{\n s = append(s,x)\n count ++\n }\n }\n if (count == 0){\nfmt.Println(0)\n}else\n{\n for x:=0;x 0 {\n\t\t\ttotal += j % 10\n\t\t\tj /= 10\n\t\t}\n\n\t\tif total == N {\n\t\t\tans = append(ans, i)\n\t\t}\n\t}\n\tfmt.Println(len(ans))\n\tPrintI(ans...)\n}\n\nfunc mapToString(arr []int) []string {\n\tret := make([]string, len(arr))\n\tfor i := 0; i < len(arr); i++ {\n\t\tret[i] = strconv.Itoa(arr[i])\n\t}\n\treturn ret\n}\n\nfunc PrintI(args ...int) {\n\tfmt.Println(strings.Join(mapToString(args), \" \"))\n}\n\nfunc max(a int, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\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": "58267ad525bfe3547f605fa307941522", "src_uid": "ae20ae2a16273a0d379932d6e973f878", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\nimport\n(\n \"fmt\"\n // \"math\"\n)\nfunc main(){\n var i int\n fmt.Scanf(\"%d\" , &i)\n // temp:= i\n x :=1\n count := 0\n var s []int\n if(i>81){\n x =x-81\n }\n\n for ;x81){\n continue\n }\n temp := x\n rs := (i-x)\n // temp2 :=1\n // fmt.Println(x)\n sum :=0\n for ;temp>0;temp/=10{\n\n // fmt.Println(mult)\n // var digits [] int\n\n xlast := temp%10\n sum +=xlast\n\n // res := temp + xlast\n // fmt.Println(temp,xlast)\n\n }\n if sum==rs{\n s = append(s,x)\n count ++\n }\n }\n if (count == 0){\nfmt.Println(0)\n}else\n{\n fmt.Println(count)\n for x:=0;x ans) {\n\t\t\tans = d[i];\n\t\t}\n\t\tmaxs[s[i] - 'a'] = Max(maxs[s[i] - 'a'], d[i]);\n\t}\n\tfmt.Fprintln(out, ans);\n\tfor _, x := range d {\n\t\tfmt.Fprint(out, x, \" \");\n\t}\n\tout.Flush();\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "a162553317f7a0dc98bf3e87603f80c4", "src_uid": "9bd31827cda83eacfcf5e46cdeaabe2b", "difficulty": 1800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"bufio\"\n)\n\nfunc Max(x, y int) int {\n if x < y {\n return y\n }\n return x\n}\n\nfunc main () {\n\tin := bufio.NewReader(os.Stdin);\n\tout := bufio.NewWriter(os.Stdout);\n\tvar n int;\n\tvar s string;\n\t\n\tfmt.Fscanln(in, &n);\n\tfmt.Fscanln(in, &s);\n\tvar maxs [26]int;\n\td := make([]int, n);\n\tans := 0;\n\tfor i := 0; i < n; i++ {\n\t\tfor j := s[i] + 1; j <= 'z'; j++ {\n\t\t\td[i] = Max(d[i], maxs[j - 'a'] + 1);\n\t\t}\n\t\tif (d[i] == 0) {\n\t\t\td[i] = 1;\n\t\t}\n\t\tif (d[i] > ans) {\n\t\t\tans = d[i];\n\t\t}\n\t\tmaxs[s[i] - 'a'] = Max(maxs[s[i] - 'a'], d[i]);\n\t}\n\tif (ans > 2) {\n\t\tfmt.Fprintln(out, \"NO\");\n\t} else {\n\t\tfmt.Fprintln(out, \"YES\");\n\t\tfor _, x := range d {\n\t\t\tfmt.Fprint(out, x - 1);\n\t\t}\n\t}\n\tout.Flush();\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "34e389bc1734319ae9aca9651fc449bd", "src_uid": "9bd31827cda83eacfcf5e46cdeaabe2b", "difficulty": 1800.0} {"lang": "Go", "source_code": "// Author: sighduck\n// URL: https://codeforces.com/contest/1150/problem/A\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc min(a []int) int {\n\tminElem := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif a[i] < minElem {\n\t\t\tminElem = a[i]\n\t\t}\n\t}\n\treturn minElem\n}\n\nfunc max(a []int) int {\n\tmaxElem := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif a[i] > maxElem {\n\t\t\tmaxElem = a[i]\n\t\t}\n\t}\n\treturn maxElem\n}\n\nfunc Solve(n int, m int, r int, s []int, b[]int) int {\n\tminBuyPrice := min(s)\n\tmaxSellPrice := max(b)\n\tif maxSellPrice > minBuyPrice {\n\t\tshares := r / minBuyPrice\n\t\tremainder := r % minBuyPrice\n\t\treturn shares * maxSellPrice + remainder\n\t}\n\treturn r\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar n, m, r int\n\tfmt.Fscanf(reader, \"%d %d %d\\n\", &n, &m, &r)\n\ts := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscan(reader, &s[i])\n\t}\n\tb := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Fscan(reader, &b[i])\n\t}\n\n\tfmt.Fprintf(writer, \"%d\\n\", Solve(n, m, r, s, b))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "df012cd4331afcaa86cc13f52253c83c", "src_uid": "42f25d492bddc12d3d89d39315d63cb9", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc min(a,b int) int {\n\tif(a < b){\n\t\treturn a\n\t\t}\n\treturn b\n}\nfunc katta(a,b int) int {\n\tif(a < b){\n\t\treturn b\n\t}\n\treturn a\n}\nfunc ab(x int) int {\n\tif(x <= -1){\n\t\tx *= -1\n\t}\n\treturn x\n}\n//a b c d e f g h j k l m n o p q r s t u v w x y z\nfunc calc(s string) (res int) {\n\n\tres += min(ab(int(s[0]) - int('A')) ,ab(int('Z') - int(s[0])) + 1)\n\tres += min(ab(int(s[1]) - int('C')),ab(int('Z') - int(s[1])) + 3)\n\tres += min(ab(int(s[2])- int('T')),min(ab(int('Z') - int(s[2])) + 20,ab(int('A') - int(s[2]))+7))\n\tres += min(ab(int(s[3])- int('G')),ab(int('Z') - int(s[3])) + 7)\n\treturn\n}\n\nfunc main() {\n\tvar n , m ,r int\n\tfmt.Scanf(\"%d %d %d\",&n,&m,&r)\n\tmaxe := 0\n\tmine := 1001\n\tvar x int\n\tfor i := 0 ; i < n;i++{\n\t\tfmt.Scan(&x)\n\t\tif(x < mine){\n\t\t\tmine = x\n\t\t}\n\t}\n\tfor i := 0 ; i< m ;i ++{\n\t\tfmt.Scan(&x)\n\t\tif(x > maxe){\n\t\t\tmaxe = x\n\t\t}\n\t}\n\tfmt.Println(katta(((r/mine) * maxe) + r % mine,r))\n\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "8d7d80529aa69d96d8ec0d7fadb814c5", "src_uid": "42f25d492bddc12d3d89d39315d63cb9", "difficulty": 800.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 CF1114C(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar n, x int64\n\tFscan(in, &n, &x)\n\tans := int64(1e18)\n\tf := func(p, e int64) {\n\t\tc := int64(0)\n\t\tfor pp := p; pp <= n; pp *= p {\n\t\t\tc += n / pp\n\t\t}\n\t\tif c/e < ans {\n\t\t\tans = c / e\n\t\t}\n\t}\n\tfor i := int64(2); i*i <= x; i++ {\n\t\te := int64(0)\n\t\tfor ; x%i == 0; x /= i {\n\t\t\te++\n\t\t}\n\t\tif e > 0 {\n\t\t\tf(i, e)\n\t\t}\n\t}\n\tif x > 1 {\n\t\tf(x, 1)\n\t}\n\tFprint(out, ans)\n}\n\nfunc main() { CF1114C(os.Stdin, os.Stdout) }\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "f83dd91dbf3a09764b4144f43be279e1", "src_uid": "491748694c1a53771be69c212a5e0e25", "difficulty": 1700.0} {"lang": "Go", "source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/1114/C\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, b int64\n)\n\nfunc main() {\n\tn, b = ReadInt64_2()\n\n\tmemo := TrialDivision(b)\n\n\tcounts := make(map[int64]int64)\n\tfor a := range memo {\n\t\tcnt := int64(0)\n\t\tcur := a\n\t\tfor n/cur != 0 {\n\t\t\tcnt += n / cur\n\n\t\t\tcur *= a\n\t\t}\n\n\t\tcounts[a] = cnt\n\t}\n\n\tans := int64(INF_BIT60)\n\tfor a, cnt := range counts {\n\t\te := memo[a]\n\t\tChMin(&ans, cnt/e)\n\t}\n\tfmt.Println(ans)\n}\n\n// ChMin accepts a pointer of integer and a target value.\n// If target value is SMALLER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMin(updatedValue *int64, target int64) bool {\n\tif *updatedValue > target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n// TrialDivision returns the result of prime factorization of integer N.\nfunc TrialDivision(n int64) map[int64]int64 {\n\tvar i, exp int64\n\tp := map[int64]int64{}\n\n\tif n <= 1 {\n\t\tpanic(errors.New(\"[argument error]: TrialDivision only accepts a NATURAL number\"))\n\t}\n\n\tfor i = 2; i*i <= n; i++ {\n\t\texp = 0\n\t\tfor n%i == 0 {\n\t\t\texp++\n\t\t\tn /= i\n\t\t}\n\n\t\tif exp == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tp[i] = exp\n\t}\n\tif n > 1 {\n\t\tp[n] = 1\n\t}\n\n\treturn p\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": "07826f2ace5b644573889776eeb7c9ce", "src_uid": "491748694c1a53771be69c212a5e0e25", "difficulty": 1700.0} {"lang": "Go", "source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/1114/C\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, b int64\n)\n\nfunc main() {\n\tn, b = ReadInt64_2()\n\n\tif n == 1 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tmemo := TrialDivision(b)\n\n\tcounts := make(map[int64]int64)\n\tfor a := range memo {\n\t\tcnt := int64(0)\n\t\tcur := a\n\t\tfor n/cur != 0 {\n\t\t\tcnt += n / cur\n\n\t\t\tcur *= a\n\t\t}\n\n\t\tcounts[a] = cnt\n\t}\n\n\tans := int64(INF_BIT60)\n\tfor a, cnt := range counts {\n\t\te := memo[a]\n\t\tChMin(&ans, cnt/e)\n\t}\n\tfmt.Println(ans)\n}\n\n// ChMin accepts a pointer of integer and a target value.\n// If target value is SMALLER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMin(updatedValue *int64, target int64) bool {\n\tif *updatedValue > target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n// TrialDivision returns the result of prime factorization of integer N.\nfunc TrialDivision(n int64) map[int64]int64 {\n\tvar i, exp int64\n\tp := map[int64]int64{}\n\n\tif n <= 1 {\n\t\tpanic(errors.New(\"[argument error]: TrialDivision only accepts a NATURAL number\"))\n\t}\n\n\tfor i = 2; i*i <= n; i++ {\n\t\texp = 0\n\t\tfor n%i == 0 {\n\t\t\texp++\n\t\t\tn /= i\n\t\t}\n\n\t\tif exp == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tp[i] = exp\n\t}\n\tif n > 1 {\n\t\tp[n] = 1\n\t}\n\n\treturn p\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": "ffdf99df4d7d9e46eda71b5fc8452d78", "src_uid": "491748694c1a53771be69c212a5e0e25", "difficulty": 1700.0} {"lang": "Go", "source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/1114/C\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, b int64\n)\n\nfunc main() {\n\tn, b = ReadInt64_2()\n\n\tif n == 1 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tmemo := TrialDivision(b)\n\n\tcounts := make(map[int64]int64)\n\tfor a := range memo {\n\t\tcnt := int64(0)\n\t\tcur := a\n\t\tfor n/cur > 0 {\n\t\t\tcnt += n / cur\n\t\t\t// PrintfDebug(\"cur: %d, diff: %d\\n\", cur, n/cur)\n\n\t\t\tif IsProductOverflow(cur, a, INF_INT64) {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tcur *= a\n\t\t}\n\n\t\tcounts[a] = cnt\n\t}\n\t// PrintfDebug(\"\u7d20\u56e0\u6570\u5206\u89e3: %v\\n\", memo)\n\t// PrintfDebug(\"\u30ab\u30a6\u30f3\u30c8: %v\\n\", counts)\n\n\tans := int64(INF_INT64)\n\tfor a, cnt := range counts {\n\t\te := memo[a]\n\t\tChMin(&ans, cnt/e)\n\t}\n\tfmt.Println(ans)\n}\n\nfunc IsProductOverflow(i, j, m int64) bool {\n\treturn float64(i)*float64(j) > float64(m)\n}\n\nfunc IsAddOverflow(i, j, m int64) bool {\n\treturn float64(i)+float64(j) > float64(m)\n}\n\n// ChMin accepts a pointer of integer and a target value.\n// If target value is SMALLER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMin(updatedValue *int64, target int64) bool {\n\tif *updatedValue > target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n// TrialDivision returns the result of prime factorization of integer N.\nfunc TrialDivision(n int64) map[int64]int64 {\n\tvar i, exp int64\n\tp := map[int64]int64{}\n\n\tif n <= 1 {\n\t\tpanic(errors.New(\"[argument error]: TrialDivision only accepts a NATURAL number\"))\n\t}\n\n\tfor i = 2; i*i <= n; i++ {\n\t\texp = 0\n\t\tfor n%i == 0 {\n\t\t\texp++\n\t\t\tn /= i\n\t\t}\n\n\t\tif exp == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tp[i] = exp\n\t}\n\tif n > 1 {\n\t\tp[n] = 1\n\t}\n\n\treturn p\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": "29995bc451d93defa4cb1dcac6f1d4f8", "src_uid": "491748694c1a53771be69c212a5e0e25", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\nfunc main() {\n var a, b, c, d, e, f int\n fmt.Scanf(\"%d%d%d%d%d%d\", &a, &b, &c, &d, &e, &f);\n if ((a * c * e < b * d * f) || ((a == 0) && (b * d > 0)) || (c == 0) && (d > 0)) {\n fmt.Printf(\"Ron\\n\");\n } else {\n fmt.Printf(\"Hermione\\n\");\n }\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "dfd6ab25ebe90631a925c11bc29300b8", "src_uid": "44d608de3e1447f89070e707ba550150", "difficulty": 1800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF300C(in io.Reader, out io.Writer) {\n\tconst m int64 = 1e9 + 7\n\tconst mx int = 1e6\n\tF := [mx + 1]int64{1}\n\tfor i := 1; i <= mx; i++ {\n\t\tF[i] = F[i-1] * int64(i) % m\n\t}\n\tpow := func(x, n int64) int64 {\n\t\tres := int64(1)\n\t\tfor ; n > 0; n >>= 1 {\n\t\t\tif n&1 == 1 {\n\t\t\t\tres = res * x % m\n\t\t\t}\n\t\t\tx = x * x % m\n\t\t}\n\t\treturn res\n\t}\n\tinvF := [...]int64{mx: pow(F[mx], m-2)}\n\tfor i := mx; i > 0; i-- {\n\t\tinvF[i-1] = invF[i] * int64(i) % m\n\t}\n\tvar a, b, n int\n\tFscan(in, &a, &b, &n)\n\tC := func(k int) int64 { return F[n] * invF[k] % m * invF[n-k] % m }\n\tans := int64(0)\n\td := n * a\n\tfor i := 0; i <= n; i++ {\n\t\tv := d\n\t\tfor ; v > 0; v /= 10 {\n\t\t\tif v%10 != a && v%10 != b {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif v == 0 {\n\t\t\tans = (ans + C(i)) % m\n\t\t}\n\t\td += b - a\n\t}\n\tFprint(out, ans)\n}\n\nfunc main() { CF300C(os.Stdin, os.Stdout) }\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "9f746fc69df649cfc2b5de658d188281", "src_uid": "d3e3da5b6ba37c8ac5f22b18c140ce81", "difficulty": 1800.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\nconst MAX int64 = 1e7\nconst MOD int64 = 1e9+7\nvar isgood [MAX]bool\nfunc Max(a, b int64) int64 {\n\tif (a < b) {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Init(a, b, n int64) {\n\tvar k int64\n\tfor k = 0; k < MAX; k++ { isgood[k] = true }\n\tfor k = 1; k <= Max(a,b) * n; k++ {\n\t\tp := k\n\t\tfor p > 0 {\n\t\t\tif p % 10 != a && p % 10 != b {\n\t\t\t\tisgood[k] = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tp /= 10\n\t\t}\n\t}\n}\n\nfunc EE(a, b int64) int64 {\n\tvar (\n\t\tr=a%b\n\t\tx0 int64=1\n\t\ty0 int64=0\n\t\tx1 int64=0\n\t\ty1 int64=1\n\t\tmod=b\n\t)\n\tfor r > 0 {\n\t\tf:=a/b\n\t\ttx:=x0-f*x1\n\t\tty:=y0-f*y1\n\t\tx0=x1\n\t\ty0=y1\n\t\tx1=tx\n\t\ty1=ty\n\t\ta=b\n\t\tb=r\n\t\tr=a%b\n\t}\n\treturn (x1%mod+mod)%mod\n}\n\nfunc main() {\n\tvar a,b,n int64\n\tfmt.Scanf(\"%d%d%d\",&a,&b,&n)\n\tInit(a,b,n)\n\tvar (\n\t\tchoose int64=1\n\t\tx int64=0\n\t\ty int64\n\t)\n\tcnt := make(map[int64]int64)\n\tfor x <= n {\n\t\ty=n-x\n\t\ts:=a*x+b*y\n\t\tif isgood[s] { cnt[s]=(cnt[s]+choose)%MOD }\n\t\tchoose=((choose*(n-x))%MOD)*EE(x+1,MOD)%MOD\n\t\tx++\n\t}\n\tvar ans int64 = 0\n\tfor k,v := range cnt {\n\t\tif isgood[k] { ans = (ans + v) % MOD }\n\t}\n\tfmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "a1fffb5f24d2b88837733b8d6df34b95", "src_uid": "d3e3da5b6ba37c8ac5f22b18c140ce81", "difficulty": 1800.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\n\nconst INF int64 = 2147483647\nconst MAX int64 = 1e7\nconst MOD int64 = 1e7+9\nvar isgood [MAX]bool\nfunc Max(a, b int64) int64 {\n\tif (a < b) {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Init(a, b, n int64) {\n\tvar k int64\n\tfor k = 0; k < MAX; k++ { isgood[k] = true }\n\tfor k = 1; k <= Max(a,b) * n; k++ {\n\t\tp := k\n\t\tfor p > 0 {\n\t\t\tif p % 10 != a && p % 10 != b {\n\t\t\t\tisgood[k] = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tp /= 10\n\t\t}\n\t}\n}\n\nfunc EE(a, b int64) int64 {\n\tvar (\n\t\tr=a%b\n\t\tx0 int64=1\n\t\ty0 int64=0\n\t\tx1 int64=0\n\t\ty1 int64=1\n\t\tmod=b\n\t)\n\tfor r > 0 {\n\t\tf:=a/b\n\t\ttx:=x0-f*x1\n\t\tty:=y0-f*y1\n\t\tx0=x1\n\t\ty0=y1\n\t\tx1=tx\n\t\ty1=ty\n\t\ta=b\n\t\tb=r\n\t\tr=a%b\n\t}\n\treturn (x1%mod+mod)%mod\n}\n\nfunc main() {\n\tvar a,b,n int64\n\tfmt.Scanf(\"%d%d%d\",&a,&b,&n)\n\tInit(a,b,n)\n\tvar (\n\t\tchoose int64=1\n\t\tx int64=0\n\t\ty int64\n\t)\n\tcnt := make(map[int64]int64)\n\tfor x <= n {\n\t\ty=n-x\n\t\ts:=a*x+b*y\n\t\tif isgood[s] { cnt[s]=(cnt[s]+choose)%MOD }\n\t\tchoose=((choose*(n-x))%MOD)*EE(x+1,MOD)%MOD\n\t\tx++\n\t}\n\tvar ans int64 = 0\n\tfor k,v := range cnt {\n\t\tif isgood[k] { ans = (ans + v) % MOD }\n\t}\n\tfmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "229c578011f476e8da603b902c07cebe", "src_uid": "d3e3da5b6ba37c8ac5f22b18c140ce81", "difficulty": 1800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string\n ans := true\n for i := 0; i < 8; i++ {\n fmt.Scan(&s)\n if ans {\n for i := 0; i < 8; i++ {\n if s[i] == s[(i+1)%8] { ans = false; break }\n }\n }\n }\n if ans { fmt.Println(\"YES\") } else { fmt.Println(\"NO\") }\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "d072d2bc9b8008ce2258e56ce4c69ca8", "src_uid": "ca65e023be092b2ce25599f52acc1a67", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tfor i := 0; i < 8; i++ {\n\n\t\tvar line string\n\t\tfmt.Scanln(&line)\n\t\t\n\t\tif !(line == \"WBWBWBWB\" || line == \"BWBWBWBW\"){\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"YES\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "c045d5b4755d1642b9e53fd5f3797564", "src_uid": "ca65e023be092b2ce25599f52acc1a67", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n\nfunc main() {\n\tvalid := true\n\n\tin := bufio.NewReader(os.Stdin)\n\n\tfor i:=0; i<8; i++ {\n\t\tline, _, _ := in.ReadLine()\n\t\ta := string(line)\n\n\t\tvalid = valid && checkString(a)\n\t}\n\n\tif valid {\n\t\tfmt.Print(\"YES\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\n}\n\nfunc checkString(a string) bool {\n\tfor i := 0; i < len(a)-1; i++ {\n\t\tif a[i] == a[i+1] {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tif a[len(a)-1] == a[0] {\n\t\treturn false\n\t}\n\n\treturn true;\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "471cddf76ab9c11294ae1ea075f8737f", "src_uid": "ca65e023be092b2ce25599f52acc1a67", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string\n ans := true\n for i := 0; i < 8; i++ {\n fmt.Scan(&s)\n if ans {\n for i := 0; i < 8; i++ {\n if s[i] == s[(i+1)%8] { ans = false; break }\n }\n }\n }\n if ans { fmt.Println(\"YES\") } else { fmt.Println(\"NO\") }\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "77f26f5477549c4edf27714e6649e3bd", "src_uid": "ca65e023be092b2ce25599f52acc1a67", "difficulty": 1000.0} {"lang": "Go", "source_code": "\ufeffpackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\tn:=0\n\tfor i:=0;i<8;i++ {\n\t\tfmt.Scan(&s)\n\t\tfor j:=1;j= m {\n\t\t\tx = ((x%m)*(n/i))%m\n\t\t\tfor j := n%i; j != 0; j-- {\n\t\t\t\tx *= 3\n\t\t\t\tif x >= m {\n\t\t\t\t\tx %= m\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\tx--\n\tif x == -1 {\n\t\tx = m-1\n\t}\n\twriter.WriteString(fmt.Sprintf(\"%d\\n\", x))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "3739458279b94dac6ca98c7ac803a664", "src_uid": "c62ad7c7d1ea7aec058d99223c57d33c", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\n\nfunc main(){\n\tvar n, m int64\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tn, _ = strconv.ParseInt(r.Text(), 0, 64)\n\tr.Scan()\n\tm, _ = strconv.ParseInt(r.Text(), 0, 64)\n\tvar a int64 = 3\n\tvar b int64 = 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tb = (b*a)%m\n\t\t}\n\t\ta = (a*a)%m\n\t\tn = n/2\n\t}\n\tw.WriteString(strconv.FormatInt((b-1+m)%m, 10)+\"\\n\")\n\tw.Flush()\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "f57d108faeb5bae9c1815e939550cd69", "src_uid": "c62ad7c7d1ea7aec058d99223c57d33c", "difficulty": 1400.0} {"lang": "Go", "source_code": "// 226A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc pow(x, n, mod int64) int64 {\n\tvar a, t int64\n\ta = 1\n\tt = x\n\tfor n != 0 {\n\t\tif n&1 == 1 {\n\t\t\ta = (a * t) % mod\n\t\t}\n\t\tt = (t * t) % mod\n\t\tn >>= 1\n\t}\n\treturn int64(a)\n}\nfunc main() {\n\tvar a, x, c int64\n\tfmt.Scan(&a, &x)\n\tc = pow(3, a, x)\n\tfmt.Println((c - 1 + x) % x)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "a57af9495f87da955da0d8771c82a05d", "src_uid": "c62ad7c7d1ea7aec058d99223c57d33c", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar allLuckNumber[] int64\n\nfunc dfs(dep int, number int64, num4, num7 int){\n\tif num4 == num7{\n\t\tallLuckNumber = append(allLuckNumber, number)\n\t}\n\tif dep > 10{\n\t\treturn;\n\t}\n\tdfs(dep + 1, number * 10 + 4, num4 + 1, num7)\n\tdfs(dep + 1, number * 10 + 7, num4, num7 + 1)\n}\n\nfunc main(){\n\tvar n, ans int64\n\tans = math.MaxInt64\n\tdfs(0, 4, 1, 0)\n\tdfs(0, 7, 0 ,1)\n\tfmt.Scan(&n)\n\tfor _,each := range allLuckNumber{\n\t\tif each >= n && each < ans{\n\t\t\tans = each\n\t\t}\n\t}\n\tfmt.Println(ans)\n\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "7a314f93f18c55936a97199edfe44980", "src_uid": "77b5f83cdadf4b0743618a46b646a849", "difficulty": 1300.0} {"lang": "Go", "source_code": "// URL: http://codeforces.com/contest/96/problem/B\n// ~ Basic Implementation Problem, Brute Force. DP version can be found in\n// 95B, where constraints are big (can't just generate all permutations).\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc isSuperLuckyNumber(n string) bool {\n\treturn strings.Count(n, \"4\") == strings.Count(n, \"7\")\n}\n\nfunc _solve(s string, minLength int, maxLength int, queue []string, answers []string) string {\n\telem := queue[0]\n\tif minLength <= len(elem) && len(elem) <= maxLength {\n\t\telemInt, _ := strconv.Atoi(elem)\n\t\tsInt, _ := strconv.Atoi(s)\n\t\tif isSuperLuckyNumber(elem) && sInt <= elemInt {\n\t\t\treturn elem\n\t\t}\n\t}\n\tif len(elem) <= maxLength {\n\t\tqueue = append(queue, elem+\"4\")\n\t\tqueue = append(queue, elem+\"7\")\n\t\tanswers = append(answers, elem)\n\t\treturn _solve(s, minLength, maxLength, queue[1:], answers)\n\t}\n\treturn _solve(s, minLength, maxLength, queue[1:], answers)\n}\n\nfunc findMinAndMaxLength(s string) (int, int) {\n\tif len(s)%2 == 0 {\n\t\treturn len(s), len(s) + 2\n\t}\n\treturn len(s) + 1, len(s) + 1\n}\n\nfunc solve(s string) string {\n\tminLength, maxLength := findMinAndMaxLength(s)\n\treturn _solve(s, minLength, maxLength, []string{\"4\", \"7\"}, []string{})\n}\n\nfunc main() {\n\treader, writer := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\tvar s string\n\tfmt.Fscanf(reader, \"%s\", &s)\n\tfmt.Fprintln(writer, solve(s))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "aafcc1c63dfcfd030174385c1d73349c", "src_uid": "77b5f83cdadf4b0743618a46b646a849", "difficulty": 1300.0} {"lang": "Go", "source_code": "// 257A-mic_rizal\npackage main\n\nimport (\n \"fmt\"\n \"sort\"\n)\n\nfunc main() {\n var n, m, k, i, x, l int\n fmt.Scan(&n, &m, &k)\n var a []int\n for i = 1; i <= n; i++ {\n fmt.Scan(&x)\n a = append(a, x)\n l++\n }\n sort.Sort(sort.IntSlice(a))\n pos := n - 1\n for k < m && pos >= 0 {\n k += a[pos] - 1\n pos--\n }\n if k < m {\n fmt.Println(\"-1\")\n } else {\n fmt.Println(n - pos - 1)\n }\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "8f1436b21aa37126b4567c7fdb2d204e", "src_uid": "b32ab27503ee3c4196d6f0d0f133d13c", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\n\nfunc main(){\n\tvar n, m, k int\n\tvar a [50]int\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tn, _ = strconv.Atoi(r.Text())\n\tr.Scan()\n\tm, _ = strconv.Atoi(r.Text())\n\tr.Scan()\n\tk, _ = strconv.Atoi(r.Text())\n\tsum := 0\n\tx := 0\n\ti := 0\n\tfor i=0; ik {\n\t\tfor i=49; i>=0; i-- {\n\t\t\tif a[i] > 0 {\n\t\t\t\tk += i;\n\t\t\t\ta[i] -= 1\n\t\t\t\tsum += 1\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif i<0 {\n\t\t\tw.WriteString(\"-1\\n\")\n\t\t\tw.Flush()\n\t\t\treturn\n\t\t}\n\t}\n\tw.WriteString(strconv.Itoa(sum)+\"\\n\")\n\tw.Flush()\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "0518aa222ad21a32b7c8e9f709cf8edd", "src_uid": "b32ab27503ee3c4196d6f0d0f133d13c", "difficulty": 1100.0} {"lang": "Go", "source_code": "// 257A\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, m, x int\n\tfmt.Scan(&n, &m, &x)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\tsort.Sort(sort.IntSlice(a))\n\tfor i := 0; i < n; i++ {\n\t\tif x >= m {\n\t\t\tfmt.Print(i)\n\t\t\treturn\n\t\t} else {\n\t\t\tx += a[n-i-1] - 1\n\t\t}\n\t}\n\tif x >= m {\n\t\tfmt.Print(n)\n\t} else {\n\t\tfmt.Print(-1)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "cb16669df3e3f2ec2f77a3f6ecf26de2", "src_uid": "b32ab27503ee3c4196d6f0d0f133d13c", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n)\n\nfunc main() {\n var n,m,k int\n fmt.Scan(&n,&m,&k)\n a := make([]int,n)\n for i := 0; i < n; i++ {\n fmt.Scan(&a[i])\n }\n sort.Ints(a)\n for ; (k > 0) && (m > 0); k-- {\n if (m <= k) { m = 0; break; }\n if k == 1 {\n for (len(a) != 0) && (a[len(a)-1] > 1){\n m -= a[len(a)-1]\n a = a[:len(a)-1]\n if (m > 0) { m++ } else { break }\n }\n } else {\n if len(a) != 0 {\n m -= a[len(a)-1]\n a = a[:len(a)-1]\n } else {\n m--\n }\n }\n }\n if (m > 0) { fmt.Println(-1) } else { fmt.Println(n-len(a)) }\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "a7e188acdc3b18c67016bbb8eabf1f73", "src_uid": "b32ab27503ee3c4196d6f0d0f133d13c", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\n\nfunc main(){\n\tvar n, m, k int\n\tvar a [50]int\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tn, _ = strconv.Atoi(r.Text())\n\tr.Scan()\n\tm, _ = strconv.Atoi(r.Text())\n\tr.Scan()\n\tk, _ = strconv.Atoi(r.Text())\n\tsum := 0\n\tx := 0\n\ti := 0\n\tfor i:=0; ik {\n\t\tfor i:=49; i>=0; i-- {\n\t\t\tif a[i] > 0 {\n\t\t\t\tk += i;\n\t\t\t\ta[i] -= 1\n\t\t\t\tsum += 1\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif i<0 {\n\t\t\tw.WriteString(\"-1\")\n\t\t\treturn\n\t\t}\n\t}\n\tw.WriteString(strconv.Itoa(sum)+\"\\n\")\n\tw.Flush()\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "74c92ad75b83660224014bc1384c42fd", "src_uid": "b32ab27503ee3c4196d6f0d0f133d13c", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\ntype SA []int\n\nfunc (s SA) Len() int {\n\treturn len(s)\n}\n\nfunc (s SA) Swap(a, b int) {\n\ttmp := s[a]\n\ts[a] = s[b]\n\ts[b] = tmp\n}\nfunc (s SA) Less(i, j int) bool {\n\tif s[i] < s[j] {\n\t\treturn true\n\t}\n\treturn false\n}\nfunc tryS(mat SA, n int, m int64, day int) bool {\n\tdcnt := 0\n\tk := 0\n\tvar sum int64 = 0\n\tfor i := n-1; i >= 0; i-- {\n\t\tif mat[i] > k {\n\t\t\tdcnt++\n\t\t\tsum += int64(mat[i] - k)\n\t\t}else{\n\t\t\tcontinue\n\t\t}\n\t\tif dcnt == day {\n\t\t\tk++\n\t\t\tdcnt = 0\n\t\t}\n\t\tif sum >= m {\n\t\t\tbreak\n\t\t}\n\t}\n\tif sum >= m {\n\t\treturn true\n\t} else {\n\t\treturn false\n\t}\n}\nfunc solveD(mat SA, n int, m int64) int {\n\tl := 1\n\tr := n\n\tans := -1\n\tvar sum int64 = 0\n\tfor i := 0; i < n; i++ {\n\t\tsum += int64(mat[i])\n\t}\n\tif sum < m {\n\t\treturn -1\n\t}\n\tfor l <= r {\n\t\tmid := ((l + r) >> 1)\n\t\tif tryS(mat, n, m, mid) {\n\t\t\tans = mid\n\t\t\tr = mid - 1\n\t\t} else {\n\t\t\tl = mid + 1\n\t\t}\n\t}\n\treturn ans\n}\nfunc main() {\n\tvar n int\n\tvar m int64\n\tbuf := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(buf, \"%d %d\\n\", &n, &m)\n\tmat := make(SA, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(buf, \"%d\", &mat[i])\n\t}\n\tsort.Sort(mat)\n\tfmt.Printf(\"%d\\n\", solveD(mat, n, m))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "90a5917c247c268af9441af0a0d58c9c", "src_uid": "acb8a57c8cfdb849a55fa65aff86628d", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst mod = 998244353\nvar n, m, L, R int\n\nfunc pw(a int, b int) int {\n\tif a == 0 {\n\t\tif b == 0 {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}\n\tvar ret = 1\n\tfor b > 0 {\n\t\tif (b & 1) == 1 {\n\t\t\tret = int(int64(ret) * int64(a) % mod)\n\t\t\tb--\n\t\t} else {\n\t\t\ta = int(int64(a) * int64(a) % mod)\n\t\t\tb /= 2\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tvar reader = bufio.NewReader(os.Stdin)\n\tvar writer = bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\tfmt.Fscanf(reader, \"%d %d %d %d\", &n, &m, &L, &R)\n\n\tvar diff = R - L + 1\n\tvar odd = diff / 2\n\tvar evn = diff / 2\n\n\tif diff % 2 != 0 {\n\t\tif L % 2 == 0 {\n\t\t\tevn++\n\t\t} else {\n\t\t\todd++\n\t\t}\n\t}\n\n\tvar T = int(int64(n) * int64(m) % (mod - 1))\n\tvar ret = pw(evn + odd, T)\n\tret = (ret + pw(evn - odd + mod, T)) % mod\n\n\tif ret < 0 {\n\t\tret += mod\n\t}\n\n\tif int64(n) * int64(m) % 2 == 1 {\n\t\tevn, odd = odd, evn\n\t\tret += pw(evn + odd, T)\n\t\tret %= mod\n\t\tret += pw(evn - odd + mod, T)\n\t\tret %= mod\n\t}\n\n\tret = int(int64(ret) * int64(pw(2, mod - 2)) % mod)\n\tfmt.Fprintf(writer, \"%d\", ret)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "2c67ce94d0d09e2b668a7ae74493fe87", "src_uid": "ded299fa1cd010822c60f2389a3ba1a3", "difficulty": 2100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst mod = 998244353\nvar n, m, L, R int\n\nfunc pw(a int, b int) int {\n\tif a == 0 {\n\t\tif b == 0 {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}\n\tvar ret = 1\n\tfor b > 0 {\n\t\tif (b & 1) == 1 {\n\t\t\tret = int(int64(ret) * int64(a) % mod)\n\t\t\tb--\n\t\t} else {\n\t\t\ta = int(int64(a) * int64(a) % mod)\n\t\t\tb /= 2\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tvar reader = bufio.NewReader(os.Stdin)\n\tvar writer = bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\tfmt.Fscanf(reader, \"%d %d %d %d\", &n, &m, &L, &R)\n\n\tvar diff = R - L + 1\n\tvar odd = diff / 2\n\tvar evn = diff / 2\n\n\tif diff % 2 != 0 {\n\t\tif L % 2 == 0 {\n\t\t\tevn++\n\t\t} else {\n\t\t\todd++\n\t\t}\n\t}\n\n\tvar T = int(int64(n) * int64(m) % (mod - 1))\n\tvar ret = pw(evn + odd, T)\n\tret = (ret + pw(evn - odd, T)) % mod\n\n\tif ret < 0 {\n\t\tret += mod\n\t}\n \n // review\n\tret = int(int64(ret) * int64(pw(2, mod - 2)) % mod)\n\tfmt.Fprintf(writer, \"%d\", ret)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "59eb2e495a73bf1f73cca285b41f0ad0", "src_uid": "ded299fa1cd010822c60f2389a3ba1a3", "difficulty": 2100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst mod = 998244353\nvar n, m, L, R int\n\nfunc pw(a int, b int) int {\n\tif a == 0 {\n\t\tif b == 0 {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}\n\tvar ret = 1\n\tfor b > 0 {\n\t\tif (b & 1) == 1 {\n\t\t\tret = int(int64(ret) * int64(a) % mod)\n\t\t\tb--\n\t\t} else {\n\t\t\ta = int(int64(a) * int64(a) % mod)\n\t\t\tb /= 2\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tvar reader = bufio.NewReader(os.Stdin)\n\tvar writer = bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\tfmt.Fscanf(reader, \"%d %d %d %d\", &n, &m, &L, &R)\n\n\tvar diff = R - L + 1\n\tvar odd = diff / 2\n\tvar evn = diff / 2\n\n\tif diff % 2 != 0 {\n\t\tif L % 2 == 0 {\n\t\t\tevn++\n\t\t} else {\n\t\t\todd++\n\t\t}\n\t}\n\n\tvar T = int(int64(n) * int64(m) % (mod - 1))\n\tvar ret = pw(evn + odd, T)\n\tret = (ret + pw(evn - odd, T)) % mod\n\n\tif ret < 0 {\n\t\tret += mod\n\t}\n\n\tret = int(int64(ret) * int64(pw(2, mod - 2)) % mod)\n\tfmt.Fprintf(writer, \"%d\", ret)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "a0b9c2da686ff7c69c30fd9ee23fd412", "src_uid": "ded299fa1cd010822c60f2389a3ba1a3", "difficulty": 2100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader = bufio.NewReader(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\nconst mod = 998244353\nconst N = 2\nvar n, m, L, R int\n\ntype matrix struct {\n\tf[N][N] int64\n}\n\nfunc print_out(a matrix) {\n\tfor i := 0; i < N; i++ {\n\t\tfor j := 0; j < N; j++ {\n\t\t\tfmt.Fprintf(writer, \"%d \", a.f[i][j])\n\t\t}\n\t\tfmt.Fprintf(writer, \"\\n\")\n\t}\n}\n\nfunc mul(a matrix, b matrix) matrix {\n\tvar c = matrix{}\n\tfor i := 0; i < N; i++ {\n\t\tfor j := 0; j < N; j++ {\n\t\t\tfor k := 0; k < N; k++ {\n\t\t\t\tc.f[i][j] += a.f[i][k] * b.f[k][j]\n\t\t\t\tc.f[i][j] %= mod\n\t\t\t}\n\t\t}\n\t}\n\treturn c\n}\n\nfunc pw(a matrix, b int64) matrix {\n\tvar ret = matrix{}\n\tfor i := 0; i < N; i++ {\n\t\tret.f[i][i] = 1\n\t}\n\n\tfor b > 0 {\n\t\tif (b & 1) == 1 {\n\t\t\tret = mul(ret, a)\n\t\t\tb--\n\t\t} else {\n\t\t\ta = mul(a, a)\n\t\t\tb /= 2\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\tfmt.Fscanf(reader, \"%d %d %d %d\", &n, &m, &L, &R)\n\n\tvar O = int64(R - L + 1) / 2\n\tvar E = int64(R - L + 1) / 2\n\tif (R - L + 1) % 2 != 0 {\n\t\tif L%2 == 0 {\n\t\t\tE++\n\t\t} else {\n\t\t\tO++\n\t\t}\n\t}\n\n\tvar T = int64(n) * int64(m)\n\n\tvar mt = matrix{}\n\tmt.f[0][0] = E\n\tmt.f[0][1] = O\n\tmt.f[1][0] = O\n\tmt.f[1][1] = E\n\n\t//print_out(mt)\n\n\tmt = pw(mt, T - 1)\n\n\t//print_out(mt)\n\n\tvar dp_odd = O\n\tvar dp_evn = E\n\n\tvar fn_dp_odd = mt.f[0][0] * dp_odd % mod + mt.f[1][0] * dp_evn % mod\n\tfn_dp_odd %= mod\n\n\tvar fn_dp_evn = mt.f[1][0] * dp_odd % mod + mt.f[1][1] * dp_evn % mod\n\tfn_dp_evn %= mod\n\n\tvar ret int64\n\tif T % 2 == 1 {\n\t\tret = (fn_dp_odd + fn_dp_evn) % mod\n\t} else {\n\t\tret = fn_dp_evn\n\t}\n\n\tfmt.Fprintf(writer, \"%d\", ret)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "3c7c194c3e55be6f303653586968baf4", "src_uid": "ded299fa1cd010822c60f2389a3ba1a3", "difficulty": 2100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst mod = 998244353\nvar n, m, L, R int\n\nfunc pw(a int64, b int64) int64 {\n\tif a == 0 {\n\t\tif b == 0 {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}\n\tvar ret = int64(1)\n\n\tfor b > 0 {\n\t\tif (b & 1) == 1 {\n\t\t\tret = ret * a % mod\n\t\t\tb--\n\t\t} else {\n\t\t\ta = a * a % mod\n\t\t\tb /= 2\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tvar reader = bufio.NewReader(os.Stdin)\n\tvar writer = bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\tfmt.Fscanf(reader, \"%d %d %d %d\", &n, &m, &L, &R)\n\n\tvar diff = R - L + 1\n\tvar odd = diff / 2\n\tvar evn = diff / 2\n\n\tif diff % 2 != 0 {\n\t\tif L % 2 == 0 {\n\t\t\tevn++\n\t\t} else {\n\t\t\todd++\n\t\t}\n\t}\n\n\tvar T = int64(n) * int64(m)\n\n\tvar ret = pw(int64(evn + odd), T)\n\tret = (ret + pw(int64(evn - odd + mod), T)) % mod\n\n\tif ret < 0 {\n\t\tret += mod\n\t}\n\n\tif T % 2 == 1 {\n\t\tevn, odd = odd, evn\n\t\tret += pw(int64(evn + odd), T)\n\t\tret %= mod\n\t\tret += pw(int64(evn - odd + mod), T)\n\t\tret %= mod\n\t}\n\n\tret = ret * pw(2, mod - 2) % mod\n\tfmt.Fprintf(writer, \"%d\", ret)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "58858e68daeb9825f92449c9f4917bb3", "src_uid": "ded299fa1cd010822c60f2389a3ba1a3", "difficulty": 2100.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\nfunc main(){\n a,m:= 0,1\n ma:=make(map[int]int)\n fmt.Scan(&a,&m)\n for true{\n _,ok:=ma[a];\n if ok{\n break\n }\n ma[a]=1;\n a*=2\n a%=m;\n }\n if _,ok:=ma[0];ok{\n fmt.Println(\"Yes\")\n } else{\n fmt.Println(\"No\")\n }\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "67f751a9fa6075cdf9d01b50224c55c7", "src_uid": "f726133018e2149ec57e113860ec498a", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ReadInt32() int {\n scanner.Scan()\n ans, _ := strconv.Atoi(scanner.Text())\n return ans\n}\n\nfunc ReadInt64() int64 {\n scanner.Scan()\n ans, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return ans\n}\n\nfunc ReadString() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n defer writer.Flush()\n scanner.Split(bufio.ScanWords)\n a := ReadInt32()\n m := ReadInt32()\n f := false\n d := make(map[int]bool)\n\n for {\n q := a % m\n if q == 0 {\n f = true\n break\n } else if _, r := d[q]; r {\n f = false\n break\n } else {\n d[q] = true\n a += q\n }\n }\n\n if f {\n writer.WriteString(\"Yes\\n\")\n } else {\n writer.WriteString(\"No\\n\")\n }\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "81fe73102d6a76d9481b6a016ccc2f9a", "src_uid": "f726133018e2149ec57e113860ec498a", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, m int\n\tfmt.Scan(&a, &m)\n\tvar v [100010]bool\n\tfor {\n\t\tif v[a] {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tif a%m == 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t\tv[a] = true\n\t\ta = (a + a%m) % m\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "13572e6b248be0f68f78941c7fa7d139", "src_uid": "f726133018e2149ec57e113860ec498a", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, m int\n\tfmt.Scanf(\"%d %d \", &a, &m)\n\tvar b [111111]int\n\tfor i := 0; i <= m; i++ {\n\t\tb[i] = 0\n\t}\n\tfor {\n\t\tif a == 0 {\n\t\t\tfmt.Printf(\"Yes\\n\")\n\t\t\tbreak\n\t\t}\n\t\tif b[a] == 1 {\n\t\t\tfmt.Printf(\"No\\n\")\n\t\t\tbreak\n\t\t}\n\t\tb[a] = 1\n\t\ta += a % m\n\t\ta %= m\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "214033af4a866b461cabb98304e38b05", "src_uid": "f726133018e2149ec57e113860ec498a", "difficulty": 1400.0} {"lang": "Go", "source_code": "//package main\nimport \"fmt\"\nfunc main(){\n a,m:= 0,1\n ma:=make(map[int]int)\n fmt.Scan(&a,&m)\n for true{\n _,ok:=ma[a];\n if ok{\n break\n }\n ma[a]=1;\n a*=2\n a%=m;\n }\n if _,ok:=ma[0];ok{\n fmt.Println(\"Yes\")\n } else{\n fmt.Println(\"No\")\n }\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "d7c7bab4ee2445ff2032f04e07f1c715", "src_uid": "f726133018e2149ec57e113860ec498a", "difficulty": 1400.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\tfmt.Printf(\"%d\", (n - 1)*(n - 1)*2 + 2*n - 1);\n\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "fb2541ca6f0bf46c638d81ee7c778922", "src_uid": "758d342c1badde6d0b4db81285be780c", "difficulty": 800.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\n\tvar input io.Reader = bufio.NewReader(os.Stdin)\n\n\tvar n int\n\n\tfmt.Fscan(input, &n)\n\n\tfmt.Println(2*n*(n-1) + 1)\n\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "3c4c569d320e4a4ddd01c1cd5c3991a2", "src_uid": "758d342c1badde6d0b4db81285be780c", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n int\n fmt.Scanf(\"%d\", &n)\n ans := 1\n x := 4\n for i := 2; i <= n; i++ {\n ans += x\n x += 4\n }\n fmt.Println(ans)\n}\n\n\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "65f704e4b7d03bbd76c666ae99bd2572", "src_uid": "758d342c1badde6d0b4db81285be780c", "difficulty": 800.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\tans := 1\n\tfor i := 1 ; i <= n ; i++ {\n\t\tans += i * 2\n\t\tans += 2 * ( i - 2 )\n\t}\n\n\tfmt.Println ( ans )\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "8dddd68b4348992029bc9e39af4cc3c0", "src_uid": "758d342c1badde6d0b4db81285be780c", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var x int\n fmt.Scan(&x)\n fmt.Println(x * x + (x - 1) * (x - 1))\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "ec23139e54df6fa0cfbe24b0fbd1b3a7", "src_uid": "758d342c1badde6d0b4db81285be780c", "difficulty": 800.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\tvar input io.Reader = bufio.NewReader(os.Stdin)\n\n\tvar n int\n\tvar a [105]int\n\tvar d [105]int\n\n\tfmt.Fscan(input, &n)\n\n\td[1] = 1\n\ta[1] = 0\n\n\tfor i := 2; i <= n; i++ {\n\t\ta[i] = a[i-1] + 4\n\t\td[i] = a[i] + d[i-1]\n\t}\n\n\tfmt.Println(d[n])\n\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "cb17bf8c513e33af4e5dfa768bd2164c", "src_uid": "758d342c1badde6d0b4db81285be780c", "difficulty": 800.0} {"lang": "Go", "source_code": "// Author: sighduck\n// URL: https://codeforces.com/contest/1180/problem/A\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Solve(n int) int {\n\treturn 2*n*n - 2*n + 1\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar n int\n\tfmt.Fscanf(reader, \"%d\\n\", &n)\n\n\tfmt.Fprintf(writer, \"%d\\n\", Solve(n))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "396a3dfd327581e2f7901632352ad7a9", "src_uid": "758d342c1badde6d0b4db81285be780c", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\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\nfunc main(){\n\tvar n int\n\tfmt.Scanln(&n)\n\tfmt.Println(2 * n * (n - 1) + 1)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "a8f479030bc5738b45685f30b94f3d43", "src_uid": "758d342c1badde6d0b4db81285be780c", "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\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar n int\n\tvar a [105]int\n\tvar d [105]int\n\n\tfmt.Fscanf(reader, \"%d\\n\", &n)\n\n\td[1] = 1\n\ta[1] = 0\n\n\tfor i := 2; i <= n; i++ {\n\t\ta[i] = a[i-1] + 4\n\t\td[i] = a[i] + d[i-1]\n\t}\n\n\tfmt.Fprintf(writer, \"%d\\n\", d[n])\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "7b15ce298661697cbe14264732f8a4e3", "src_uid": "758d342c1badde6d0b4db81285be780c", "difficulty": 800.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}\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": "d0a555f6b23830ddcc36eac12cc111fb", "src_uid": "e595a1d0c0e4bbcc99454d3148b4557b", "difficulty": 1000.0} {"lang": "Go", "source_code": "// hey project main.go\npackage main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var m, sum, try, x, y int\n fmt.Scan(&m)\n ar := make([]int, m)\n for i := 0; i < m; i++ {\n fmt.Scan(&ar[i])\n sum += ar[i]\n }\n fmt.Scan(&x, &y)\n //fmt.Print(sum, \"\\n\")\n for i := 0; i < m; i++ {\n try += ar[i]\n //fmt.Print(\"try%y:\", try%y)\n //fmt.Print(\"i:\", i, \"try:\", try, \"\\n\")\n\n if try%y >= x || (try%x <= y-x && try >= y) {\n if (sum-try)%y >= x || ((sum-try)%x <= y-x && (sum-try) >= y) {\n fmt.Print(i + 2)\n return\n }\n }\n }\n fmt.Print(0)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "bbed8bc2d563246678fcbc3d048b5285", "src_uid": "e595a1d0c0e4bbcc99454d3148b4557b", "difficulty": 1000.0} {"lang": "Go", "source_code": "// hey project main.go\npackage main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var m, sum, try, x, y int\n fmt.Scan(&m)\n ar := make([]int, m)\n for i := 0; i < m; i++ {\n fmt.Scan(&ar[i])\n sum += ar[i]\n }\n fmt.Scan(&x, &y)\n //fmt.Print(sum, \"\\n\")\n for i := 0; i < m; i++ {\n try += ar[i]\n //fmt.Print(\"try%y:\", try%y)\n //fmt.Print(\"i:\", i, \"try:\", try, \"\\n\")\n\n if try%y > x || (try%x <= y-x && try > y) {\n if (sum-try)%y > x || ((sum-try)%x <= y-x && (sum-try) > y) {\n fmt.Print(i + 2)\n return\n }\n }\n }\n fmt.Print(0)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "db0374e1dc82811f7ae98171b7005e37", "src_uid": "e595a1d0c0e4bbcc99454d3148b4557b", "difficulty": 1000.0} {"lang": "Go", "source_code": "// hey project main.go\npackage main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var m, sum, try, x, y int\n fmt.Scan(&m)\n ar := make([]int, m)\n for i := 0; i < m; i++ {\n fmt.Scan(&ar[i])\n sum += ar[i]\n }\n fmt.Scan(&x, &y)\n //fmt.Print(sum, \"\\n\")\n for i := 0; i < m; i++ {\n try += ar[i]\n //fmt.Print(\"try%y:\", try%y)\n //fmt.Print(\"i:\", i, \"try:\", try, \"\\n\")\n\n if try%y >= x || (try%x <= y-x && try >= y) {\n if (sum-try)%y > x || ((sum-try)%x <= y-x && (sum-try) >= y || (sum-try) == x) {\n fmt.Print(i + 2)\n return\n }\n }\n }\n fmt.Print(0)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "75b943208b52d7a9cce64a8e2891196a", "src_uid": "e595a1d0c0e4bbcc99454d3148b4557b", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var m,x,y int\n var c [105]int\n fmt.Scan(&m)\n group2 := 0\n for i := 1; i <= m; i++ {\n fmt.Scan(&c[i])\n group2 += c[i]\n }\n fmt.Scan(&x,&y)\n ans, group1 := 1, 0\n for ((group1 < x) || (group1 > y) || (group2 < x) || (group2 > y)) && (ans <= m) {\n group1 += c[ans]\n group2 -= c[ans]\n ans++\n }\n if ans <= m { fmt.Println(ans) } else { fmt.Println(0) }\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "96d2e25a3a5819d74fe960516a614b1b", "src_uid": "e595a1d0c0e4bbcc99454d3148b4557b", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var m,x,y int // membuat variabel m, x, dan y dengan tipe data int\n var c [105]int // membuat variabel c dengan tipe data array of int dengan ukuran 105\n fmt.Scan(&m) // menerima input nilai m\n group2 := 0 // membuat variabel group2 dengan tipe int dengan nilai awal 0\n for i := 1; i <= m; i++ { // looping sebanyak m kali\n fmt.Scan(&c[i]) // menerima input nilai c[i]\n group2 += c[i] // tambahkan nilai c[i] ke group2\n }\n fmt.Scan(&x,&y) // menerima input nilai x dan y\n ans, group1 := 1, 0 // membuat variabel ans tipe int dengan nilai awal 1 dan group1 tipe int dengan nilai awal 0\n for ((group1 < x) || (group1 > y) || (group2 < x) || (group2 > y)) && (ans <= m) { // jika group1,group2 < x dan group1,group2 > y dan ans <= m\n group1 += c[ans] // maka group1 ditambahkan dengan c[ans]\n group2 -= c[ans] // group2 dikurangi dengan c[ans]\n ans++ // ans ditambahkan dengan 1\n }\n if ans <= m { fmt.Println(ans) } else { fmt.Println(0) } // jika ans <= m, maka cetak output nilai dari ans. Jika tidak, cetak output nilai 0\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "bbe8c5af9ed04a81cd3313b7cc4edf56", "src_uid": "e595a1d0c0e4bbcc99454d3148b4557b", "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": "7576a110c81c779793ab68dd6a41a12a", "src_uid": "e595a1d0c0e4bbcc99454d3148b4557b", "difficulty": 1000.0} {"lang": "Go", "source_code": "// hey project main.go\npackage main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var m, sum, try, x, y int\n fmt.Scan(&m)\n ar := make([]int, m)\n for i := 0; i < m; i++ {\n fmt.Scan(&ar[i])\n sum += ar[i]\n }\n fmt.Scan(&x, &y)\n //fmt.Print(sum, \"\\n\")\n for i := 0; i < m; i++ {\n try += ar[i]\n //fmt.Print(\"try%y:\", try%y)\n //fmt.Print(\"i:\", i, \"try:\", try, \"\\n\")\n\n if try <= y && try >= x {\n if (sum-try) <= y && (sum-try) >= x {\n fmt.Print(i + 2)\n return\n }\n }\n }\n fmt.Print(0)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "554a545ac588ba7927a3fd916f09a559", "src_uid": "e595a1d0c0e4bbcc99454d3148b4557b", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar r, h float64\n\tfmt.Scan(&r, &h)\n\th, count := h-r*math.Floor(h/r), 2*int(h/r)\n\tif h+r >= r*(math.Sqrt(3)/2+1) {\n\t\tcount += 3\n\t} else if h >= r/2 {\n\t\tcount += 2\n\t} else {\n\t\tcount += 1\n\t}\n\tfmt.Println(count)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "b761e1f66db761d9f338c5be95747d70", "src_uid": "ae883bf16842c181ea4bd123dee12ef9", "difficulty": 1900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar r, h float64\n\tfmt.Scan(&r, &h)\n\th, count := h-r*math.Floor(h/r), 2*int(h/r)\n\tif h >= r*(math.Sqrt(3)+6)/4 {\n\t\tcount += 3\n\t} else if h >= r/2 {\n\t\tcount += 2\n\t} else {\n\t\tcount += 1\n\t}\n\tfmt.Println(count)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "0a9f9afd508c8755e82a298ca4e0c8ca", "src_uid": "ae883bf16842c181ea4bd123dee12ef9", "difficulty": 1900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i ...interface{}) error {\n\t_, err := fmt.Fscan(r, i...)\n\treturn err\n}\n\nfunc O(o ...interface{}) {\n\tfmt.Fprint(w, o...)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.goC\"); 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 s string\n\tfor I(&s) == nil {\n\t\tsolve(s)\n\t}\n}\n\nfunc solve(s string) {\n\tss := []byte(s)\n\tvk := []byte(\"VK\")\n\tmax := bytes.Count(ss, vk)\n\tfor i := range ss {\n\t\tif ss[i] == 'V' {\n\t\t\tss[i] = 'K'\n\t\t} else {\n\t\t\tss[i] = 'V'\n\t\t}\n\t\tmx := bytes.Count(ss, vk)\n\t\tif mx > max {\n\t\t\tmax = mx\n\t\t}\n\t\tif ss[i] == 'V' {\n\t\t\tss[i] = 'K'\n\t\t} else {\n\t\t\tss[i] = 'V'\n\t\t}\n\t}\n\tO(max, \"\\n\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "835baf5b9adf836b498ac45975e52dbd", "src_uid": "578bae0fe6634882227ac371ebb38fc9", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc vk(s string) int {\n\treturn strings.Count(s, \"VK\")\n}\n\nfunc main() {\n\tvar arr []byte\n\tvar c byte\n\tvar max int\n\tfor {\n\t\tfmt.Scanf(\"%c\", &c)\n\t\tif c == '\\n' {\n\t\t\tbreak\n\t\t}\n\t\tarr = append(arr, c)\n\t}\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i] == 'V' {\n\t\t\tarr[i] = 'K'\n\t\t\tif vk(string(arr)) > max {\n\t\t\t\tmax = vk(string(arr))\n\t\t\t}\n\t\t\tarr[i] = 'V'\n\t\t} else {\n\t\t\tarr[i] = 'V'\n\t\t\tif vk(string(arr)) > max {\n\t\t\t\tmax = vk(string(arr))\n\t\t\t}\n\t\t\tarr[i] = 'K'\n\t\t}\n\t}\n\tfmt.Println(max)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "b6a395373e299e7a18eec35a375a9974", "src_uid": "578bae0fe6634882227ac371ebb38fc9", "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 solve() {\n\tstr := readString()\n\ta := []byte(str)\n\tans := 0\n\tfor _, v := range []byte(\"VK\") {\n\t\tfor i := 0; i < len(a); i++ {\n\t\t\tprev := a[i]\n\t\t\ta[i] = v\n\t\t\tres := 0\n\t\t\tfor j := 0; j < len(a)-1; j++ {\n\t\t\t\tif a[j] == 'V' && a[j+1] == 'K' {\n\t\t\t\t\tres++\n\t\t\t\t\tj++\n\t\t\t\t}\n\t\t\t}\n\t\t\tans = max(ans, res)\n\t\t\ta[i] = prev\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\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}\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": false, "code_uid": "2c8e5fb40c2e0599263cee5716004165", "src_uid": "578bae0fe6634882227ac371ebb38fc9", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tw := bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\t\n\tvar n, a, b int\n\tfmt.Fscan(r, &n)\n\tk := make([]int, 0, n)\n\tsum := 0\n\tkoa := 0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscan(r, &a)\n\t\tif i == 0 {\n\t\t\tb = a\n\t\t\tkoa = a\n\t\t\tk = append(k, 1)\n\t\t}\n\t\tif i > 0 && b/2 >= a {\n\t\t\tkoa += a\n\t\t\tk = append(k, i+1)\n\t\t}\n\t\tsum += a\n\t}\n\tif koa >= sum/2 {\n\t\tfmt.Fprintln(w, len(k))\n\t\tfor i, e := range k {\n\t\t\tif i == 0 {\n\t\t\t\tfmt.Fprintf(w, \"%d\", e)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintf(w, \" %d\", e)\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfmt.Fprintln(w, 0)\n\t}\n\t\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "7812be6fb058697d9bd68a03c58bb893", "src_uid": "0a71fdaaf08c18396324ad762b7379d7", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tw := bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\t\n\tvar n, a, b int\n\tfmt.Fscan(r, &n)\n\tk := make([]int, 0, n)\n\tsum := 0\n\tkoa := 0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscan(r, &a)\n\t\tif i == 0 {\n\t\t\tb = a\n\t\t\tkoa = a\n\t\t\tk = append(k, 1)\n\t\t}\n\t\tif i > 0 && b/2 >= a {\n\t\t\tkoa += a\n\t\t\tk = append(k, i+1)\n\t\t}\n\t\tsum += a\n\t}\n\tif 2 * koa > sum {\n\t\tfmt.Fprintln(w, len(k))\n\t\tfor i, e := range k {\n\t\t\tif i == 0 {\n\t\t\t\tfmt.Fprintf(w, \"%d\", e)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintf(w, \" %d\", e)\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfmt.Fprintln(w, 0)\n\t}\n\t\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "82ce193ec30d89b83c151e3e52e48f40", "src_uid": "0a71fdaaf08c18396324ad762b7379d7", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"math/cmplx\"\n\t\"os\"\n)\n\nconst (\n\tEPS = 1e-8\n)\n\nvar (\n\treader = bufio.NewReader(os.Stdin)\n)\n\ntype Light struct {\n\tp complex128\n\ta float64\n}\n\ntype Line struct {\n\tp1, p2 complex128\n}\n\nfunc CrossProduct(a complex128, b complex128) float64 {\n\treturn real(a)*imag(b) - real(b)*imag(a)\n}\n\nfunc Roatate(x complex128, a float64) complex128 {\n\tr, t := cmplx.Polar(x)\n\treturn cmplx.Rect(r, t+a)\n}\n\nfunc Intersact(a Line, b Line) (intersaction complex128, isIntersact bool) {\n\ts1 := CrossProduct(a.p2-a.p1, b.p1-a.p1)\n\ts2 := CrossProduct(a.p2-a.p1, b.p2-a.p1)\n\tif math.Abs(s2-s1) >= EPS {\n\t\tisIntersact = true\n\t\tintersaction = complex(real(b.p1)*s2-real(b.p2)*s1, imag(b.p1)*s2-imag(b.p2)*s1) / complex(s2-s1, 0.0)\n\t}\n\treturn\n}\n\nfunc foo(l float64, lit Light, r float64) float64 {\n\tv1 := complex(l-real(lit.p), 0-imag(lit.p))\n\tv2 := Roatate(v1, lit.a)\n\tif imag(v2) > -EPS {\n\t\treturn r\n\t}\n\n\tp1 := complex(0.0, 0.0)\n\tp2 := complex(100.0, 0.0)\n\tinter, _ := Intersact(Line{lit.p, lit.p + v2}, Line{p1, p2})\n\treturn real(inter)\n}\n\nfunc main() {\n\tvar (\n\t\tn int\n\t\tl, r float64\n\t\tlits []Light\n\t)\n\n\tfmt.Fscan(reader, &n, &l, &r)\n\tfor i := 0; i < n; i++ {\n\t\tvar x, y, a float64\n\t\tfmt.Fscan(reader, &x, &y, &a)\n\t\tlits = append(lits, Light{complex(x, y), a * math.Pi / 180.0})\n\t}\n\n\tf := make([]float64, 1< f[k] {\n\t\t\t\t\tf[k] = cur\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Print(math.Min(f[(1<= EPS {\n\t\tisIntersact = true\n\t\tintersaction = complex((real(b.p1)*s2-real(b.p2)*s1)/s, (imag(b.p1)*s2-imag(b.p2)*s1)/s)\n\t}\n\treturn\n}\n\nfunc foo(l float64, lit Light, r float64) float64 {\n\tv1 := complex(l-real(lit.p), 0-imag(lit.p))\n\tv2 := Roatate(v1, lit.a)\n\tif imag(v2) > -EPS {\n\t\treturn r\n\t}\n\n\tp1 := complex(0.0, 0.0)\n\tp2 := complex(100.0, 0.0)\n\tinter, _ := Intersact(Line{lit.p, lit.p + v2}, Line{p1, p2})\n\treturn real(inter)\n}\n\nfunc main() {\n\tvar (\n\t\tn int\n\t\tl, r float64\n\t\tlits []Light\n\t)\n\n\tfmt.Fscan(reader, &n, &l, &r)\n\tfor i := 0; i < n; i++ {\n\t\tvar x, y, a float64\n\t\tfmt.Fscan(reader, &x, &y, &a)\n\t\tlits = append(lits, Light{complex(x, y), a * math.Pi / 180.0})\n\t}\n\n\tf := make([]float64, 1< f[k] {\n\t\t\t\t\tf[k] = cur\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Print(math.Min(f[(1<= EPS {\n\t\tisIntersact = true\n\t\tintersaction = complex(real(b.p1)*s2-real(b.p2)*s1, imag(b.p1)*s2-imag(b.p2)*s1) / complex(s2-s1, 0.0)\n\t}\n\treturn\n}\n\nfunc foo(l float64, lit Light, r float64) float64 {\n\tv1 := complex(l-real(lit.p), 0-imag(lit.p))\n\tv2 := Roatate(v1, lit.a)\n\tif imag(v2) > -EPS {\n\t\treturn r\n\t}\n\n\tp1 := complex(0.0, 0.0)\n\tp2 := complex(10.0, 0.0)\n\tinter, _ := Intersact(Line{lit.p, lit.p + v2}, Line{p1, p2})\n\treturn real(inter)\n}\n\nfunc main() {\n\tvar (\n\t\tn int\n\t\tl, r float64\n\t\tlits []Light\n\t)\n\n\tfmt.Fscan(reader, &n, &l, &r)\n\tfor i := 0; i < n; i++ {\n\t\tvar x, y, a float64\n\t\tfmt.Fscan(reader, &x, &y, &a)\n\t\tlits = append(lits, Light{complex(x, y), a * math.Pi / 180.0})\n\t}\n\n\tf := make([]float64, 1< f[k] {\n\t\t\t\t\tf[k] = cur\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Print(f[(1< 0 {\n\t\tif x % k != 0 {\n\t\t\td := x % k;\n\t\t\tx -= d\n\t\t\tres += A * d\n\t\t} else {\n\t\t\td := x / k;\n\t\t\tif B > (x - d) * A {\n\t\t\t\tx -= d\n\t\t\t\tres += A * d\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": "195713b2765015cbae6927a54fda114d", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "difficulty": 1400.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\tx--;\n\tfor x > 0 {\n\t\tif (k == 1) || (x % k != 0) {\n\t\t\td := x % k;\n\t\t\tx -= d;\n\t\t\tres += A * d\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": "444139f571147bb2514fd0a136d351e9", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "difficulty": 1400.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\tif k == 1 {\n\t\tres = (x - 1) * A\n\t\tx = 1\n\t}\n\tfor x > 1 {\n\t\tif x % k != 0 {\n\t\t\td := x % k;\n\t\t\tx -= d\n\t\t\tres += A * d\n\t\t\tif x == 0 {\n\t\t\t\tx = 1\n\t\t\t\tres -= A\n\t\t\t}\n\t\t} else {\n\t\t\td := x / k;\n\t\t\tif B > (x - d) * A {\n\t\t\t\tres += (x - d) * A\n\t\t\t} else {\n\t\t\t\tres += B\n\t\t\t}\n\t\t\tx = d\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "53b55482f625a85b19f3b1758815a46c", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"bufio\"\n\t\"os\"\n)\n\nconst (\n\tn = 1000000007\n)\n\nfunc sum(a, b int) int {\n\ts := a + b\n\tif s >= n {\n\t\treturn s - n\n\t}\n\treturn s\n}\n\nfunc mul(a, b int) int {\n\treturn a * b % n\n}\n\nfunc g0(a, b, h, w int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 1\n\t}\n\tvar s int\n\tfor x := h + 1; x <= a; x++ {\n\t\ts += g0(b, a - x, w, h)\n\t}\n\treturn s\n}\n\nfunc f0(a, b int) int {\n\tif a == 0 || b == 0 {\n\t\treturn 1\n\t}\n\tvar s int\n\tfor x := 1; x <= a; x++ {\n\t\ts += f0(b, a - x)\n\t}\n\treturn s\n}\n\nfunc power(a, n int) int {\n\tr := 1\n\tfor n > 0 {\n\t\tif (n & 1) != 0 {\n\t\t\tr = mul(r, a)\n\t\t}\n\t\tn /= 2\n\t\tif n > 0 {\n\t\t\ta = mul(a, a)\n\t\t}\n\t}\n\treturn r\n}\n\nfunc inv(a int) int {\n\treturn power(a, n - 2)\n}\n\nfunc cnk(n, k int) int {\n\tif k < 0 || k > n || n < 0 {\n\t\treturn 0\n\t}\n\tp, q := 1, 1\n\tfor i := 0; i < k; i++ {\n\t\tp = mul(p, n - i)\n\t\tq = mul(q, i + 1)\n\t}\n\treturn mul(p, inv(q))\n}\n\nfunc f1(a, b int) int {\n\treturn sum(cnk(a + b - 1, a), cnk(a + b - 1, 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 solve(a, b, h int) int {\n\tq := f1(a, b)\n\tp := 0\n\th += 1\n\tfor ka := 1; ka * h <= a; ka++ {\n\t\tfor kb := max(1, ka - 1); kb <= ka + 1 && kb <= b; kb++ {\n\t\t\tc0 := cnk(b + kb - 1, kb - 1)\n\t\t\tc1 := cnk(a - ka * h + ka - 1, ka - 1)\n\t\t\t// fmt.Printf(\"%d %d %d %d\\n\", ka, kb, c0, c1)\n\t\t\td := mul(c0, c1)\n\t\t\tif ka == kb {\n\t\t\t\tp = sum(p, d)\n\t\t\t}\n\t\t\tp = sum(p, d)\n\t\t}\n\t}\n\treturn mul(p, inv(q))\n}\n\nfunc main() {\n\tcin := NewParser(bufio.NewReaderSize(os.Stdin, 1<<16))\n\ta := cin.nextInt()\n\tb := cin.nextInt()\n\th := cin.nextInt()\n\tfmt.Printf(\"%d\\n\", solve(b, a, h))\n}\n\n// some io\n\ntype ParserReader struct {\n\tr io.ByteReader\n\terr error\n\tc byte\n}\n\nfunc NewParser(r io.ByteReader) *ParserReader {\n\treturn &ParserReader{r, nil, 0}\n}\n\nfunc (p *ParserReader) next() error {\n\tp.c, p.err = p.r.ReadByte()\n\treturn p.err\n}\n\nfunc isDigit(c byte) bool {\n\treturn '0' <= c && c <= '9'\n}\n\nfunc (p *ParserReader) nextUInt64() uint64 {\n\tfor !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar r uint64\n\tfor isDigit(p.c) && p.err == nil {\n\t\tr = r*10 + uint64(p.c - '0')\n\t\tp.next()\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextUInt() uint {\n\tfor !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar r uint\n\tfor isDigit(p.c) && p.err == nil {\n\t\tr = r*10 + uint(p.c - '0')\n\t\tp.next()\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextInt64() int64 {\n\tfor p.c != '-' && !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar sign bool\n\tif p.c == '-' {\n\t\tsign = true\n\t}\n\tr := int64(p.nextUInt64())\n\tif sign {\n\t\treturn -r\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextInt() int {\n\tfor p.c != '-' && !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar sign bool\n\tif p.c == '-' {\n\t\tsign = true\n\t}\n\tr := int(p.nextUInt())\n\tif sign {\n\t\treturn -r\n\t}\n\treturn r\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "be7689d3734366171da44df7c49e91c0", "src_uid": "a69f95db3fe677111cf0558271b40f39", "difficulty": 2300.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"bufio\"\n\t\"os\"\n)\n\nconst (\n\tn = 1000000007\n)\n\nfunc sum(a, b int) int {\n\ts := a + b\n\tif s >= n {\n\t\treturn s - n\n\t}\n\treturn s\n}\n\nfunc mul(a, b int) int {\n\treturn a * b % n\n}\n\nfunc g0(a, b, h, w int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 1\n\t}\n\tvar s int\n\tfor x := h + 1; x <= a; x++ {\n\t\ts += g0(b, a - x, w, h)\n\t}\n\treturn s\n}\n\nfunc f0(a, b int) int {\n\tif a == 0 || b == 0 {\n\t\treturn 1\n\t}\n\tvar s int\n\tfor x := 1; x <= a; x++ {\n\t\ts += f0(b, a - x)\n\t}\n\treturn s\n}\n\nfunc power(a, n int) int {\n\tr := 1\n\tfor n > 0 {\n\t\tif (n & 1) != 0 {\n\t\t\tr = mul(r, a)\n\t\t}\n\t\tn /= 2\n\t\tif n > 0 {\n\t\t\ta = mul(a, a)\n\t\t}\n\t}\n\treturn r\n}\n\nfunc inv(a int) int {\n\treturn power(a, n - 2)\n}\n\nvar facts []int\nvar ifacts []int\n\nfunc cnk(n, k int) int {\n\tif k < 0 || k > n || n < 0 {\n\t\treturn 0\n\t}\n\treturn mul(mul(facts[n], ifacts[k]), ifacts[n-k])\n}\n\nfunc f1(a, b int) int {\n\treturn sum(cnk(a + b - 1, a), cnk(a + b - 1, 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 solve(a, b, h int) int {\n\tq := f1(a, b)\n\tp := 0\n\th += 1\n\tfor ka := 1; ka * h <= a; ka++ {\n\t\tfor kb := max(1, ka - 1); kb <= ka + 1 && kb <= b; kb++ {\n\t\t\tc0 := cnk(b + kb - 1, kb - 1)\n\t\t\tc1 := cnk(a - ka * h + ka - 1, ka - 1)\n\t\t\t// fmt.Printf(\"%d %d %d %d\\n\", ka, kb, c0, c1)\n\t\t\td := mul(c0, c1)\n\t\t\tif ka == kb {\n\t\t\t\tp = sum(p, d)\n\t\t\t}\n\t\t\tp = sum(p, d)\n\t\t}\n\t}\n\treturn mul(p, inv(q))\n}\n\nfunc main() {\n\tm := 200100\n\tfacts = make([]int, m)\n\tifacts = make([]int, m)\n\tfacts[0] = 1\n\tfor i := 1; i < m; i++ {\n\t\tfacts[i] = mul(facts[i-1], i)\n\t}\n\tifacts[m-1] = inv(facts[m-1])\n\tfor i := m-2; i >= 0; i-- {\n\t\tifacts[i] = mul(ifacts[i+1], i+1)\n\t}\n\tcin := NewParser(bufio.NewReaderSize(os.Stdin, 1<<16))\n\ta := cin.nextInt()\n\tb := cin.nextInt()\n\th := cin.nextInt()\n\tfmt.Printf(\"%d\\n\", solve(b, a, h))\n}\n\n// some io\n\ntype ParserReader struct {\n\tr io.ByteReader\n\terr error\n\tc byte\n}\n\nfunc NewParser(r io.ByteReader) *ParserReader {\n\treturn &ParserReader{r, nil, 0}\n}\n\nfunc (p *ParserReader) next() error {\n\tp.c, p.err = p.r.ReadByte()\n\treturn p.err\n}\n\nfunc isDigit(c byte) bool {\n\treturn '0' <= c && c <= '9'\n}\n\nfunc (p *ParserReader) nextUInt64() uint64 {\n\tfor !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar r uint64\n\tfor isDigit(p.c) && p.err == nil {\n\t\tr = r*10 + uint64(p.c - '0')\n\t\tp.next()\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextUInt() uint {\n\tfor !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar r uint\n\tfor isDigit(p.c) && p.err == nil {\n\t\tr = r*10 + uint(p.c - '0')\n\t\tp.next()\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextInt64() int64 {\n\tfor p.c != '-' && !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar sign bool\n\tif p.c == '-' {\n\t\tsign = true\n\t}\n\tr := int64(p.nextUInt64())\n\tif sign {\n\t\treturn -r\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextInt() int {\n\tfor p.c != '-' && !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar sign bool\n\tif p.c == '-' {\n\t\tsign = true\n\t}\n\tr := int(p.nextUInt())\n\tif sign {\n\t\treturn -r\n\t}\n\treturn r\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "85aebf0f3064c6eab1cb6ddbcb21001a", "src_uid": "a69f95db3fe677111cf0558271b40f39", "difficulty": 2300.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"bufio\"\n\t\"os\"\n)\n\nconst (\n\tn = 1000000007\n)\n\nfunc sum(a, b int) int {\n\ts := a + b\n\tif s >= n {\n\t\treturn s - n\n\t}\n\treturn s\n}\n\nfunc mul(a, b int) int {\n\treturn a * b % n\n}\n\nfunc g0(a, b, h, w int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 1\n\t}\n\tvar s int\n\tfor x := h + 1; x <= a; x++ {\n\t\ts += g0(b, a - x, w, h)\n\t}\n\treturn s\n}\n\nfunc f0(a, b int) int {\n\tif a == 0 || b == 0 {\n\t\treturn 1\n\t}\n\tvar s int\n\tfor x := 1; x <= a; x++ {\n\t\ts += f0(b, a - x)\n\t}\n\treturn s\n}\n\nfunc power(a, n int) int {\n\tr := 1\n\tfor n > 0 {\n\t\tif (n & 1) != 0 {\n\t\t\tr = mul(r, a)\n\t\t}\n\t\tn /= 2\n\t\tif n > 0 {\n\t\t\ta = mul(a, a)\n\t\t}\n\t}\n\treturn r\n}\n\nfunc inv(a int) int {\n\treturn power(a, n - 2)\n}\n\nvar facts []int\nvar ifacts []int\n\nfunc cnk(n, k int) int {\n\tif k < 0 || k > n || n < 0 {\n\t\treturn 0\n\t}\n\treturn mul(mul(facts[n], ifacts[k]), ifacts[n-k])\n}\n\nfunc f1(a, b int) int {\n\treturn sum(cnk(a + b - 1, a), cnk(a + b - 1, 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 solve(a, b, h int) int {\n\tq := f1(a, b)\n\tp := 0\n\th += 1\n\tfor ka := 1; ka * h <= a; ka++ {\n\t\tfor kb := max(1, ka - 1); kb <= ka + 1 && kb <= b; kb++ {\n\t\t\tc0 := cnk(b - 1, kb - 1)\n\t\t\tc1 := cnk(a - ka * (h - 1) - 1, ka - 1)\n\t\t\t// fmt.Printf(\"%d %d %d %d\\n\", ka, kb, c0, c1)\n\t\t\td := mul(c0, c1)\n\t\t\tif ka == kb {\n\t\t\t\tp = sum(p, d)\n\t\t\t}\n\t\t\tp = sum(p, d)\n\t\t}\n\t}\n\treturn mul(p, inv(q))\n}\n\nfunc main() {\n\tm := 200100\n\tfacts = make([]int, m)\n\tifacts = make([]int, m)\n\tfacts[0] = 1\n\tfor i := 1; i < m; i++ {\n\t\tfacts[i] = mul(facts[i-1], i)\n\t}\n\tifacts[m-1] = inv(facts[m-1])\n\tfor i := m-2; i >= 0; i-- {\n\t\tifacts[i] = mul(ifacts[i+1], i+1)\n\t}\n\tcin := NewParser(bufio.NewReaderSize(os.Stdin, 1<<16))\n\ta := cin.nextInt()\n\tb := cin.nextInt()\n\th := cin.nextInt()\n\tfmt.Printf(\"%d\\n\", solve(b, a, h))\n}\n\n// some io\n\ntype ParserReader struct {\n\tr io.ByteReader\n\terr error\n\tc byte\n}\n\nfunc NewParser(r io.ByteReader) *ParserReader {\n\treturn &ParserReader{r, nil, 0}\n}\n\nfunc (p *ParserReader) next() error {\n\tp.c, p.err = p.r.ReadByte()\n\treturn p.err\n}\n\nfunc isDigit(c byte) bool {\n\treturn '0' <= c && c <= '9'\n}\n\nfunc (p *ParserReader) nextUInt64() uint64 {\n\tfor !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar r uint64\n\tfor isDigit(p.c) && p.err == nil {\n\t\tr = r*10 + uint64(p.c - '0')\n\t\tp.next()\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextUInt() uint {\n\tfor !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar r uint\n\tfor isDigit(p.c) && p.err == nil {\n\t\tr = r*10 + uint(p.c - '0')\n\t\tp.next()\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextInt64() int64 {\n\tfor p.c != '-' && !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar sign bool\n\tif p.c == '-' {\n\t\tsign = true\n\t}\n\tr := int64(p.nextUInt64())\n\tif sign {\n\t\treturn -r\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextInt() int {\n\tfor p.c != '-' && !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar sign bool\n\tif p.c == '-' {\n\t\tsign = true\n\t}\n\tr := int(p.nextUInt())\n\tif sign {\n\t\treturn -r\n\t}\n\treturn r\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "735cdc45be7a02365604795c3e6c9a45", "src_uid": "a69f95db3fe677111cf0558271b40f39", "difficulty": 2300.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"bufio\"\n\t\"os\"\n)\n\nconst (\n\tn = 1000000007\n)\n\nfunc sum(a, b int) int {\n\ts := a + b\n\tif s >= n {\n\t\treturn s - n\n\t}\n\treturn s\n}\n\nfunc mul(a, b int) int {\n\treturn int(int64(a) * int64(b) % n)\n}\n\nfunc g0(a, b, h, w int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 1\n\t}\n\tvar s int\n\tfor x := h + 1; x <= a; x++ {\n\t\ts += g0(b, a - x, w, h)\n\t}\n\treturn s\n}\n\nfunc f0(a, b int) int {\n\tif a == 0 || b == 0 {\n\t\treturn 1\n\t}\n\tvar s int\n\tfor x := 1; x <= a; x++ {\n\t\ts += f0(b, a - x)\n\t}\n\treturn s\n}\n\nfunc power(a, n int) int {\n\tr := 1\n\tfor n > 0 {\n\t\tif (n & 1) != 0 {\n\t\t\tr = mul(r, a)\n\t\t}\n\t\tn /= 2\n\t\tif n > 0 {\n\t\t\ta = mul(a, a)\n\t\t}\n\t}\n\treturn r\n}\n\nfunc inv(a int) int {\n\treturn power(a, n - 2)\n}\n\nvar facts []int\nvar ifacts []int\n\nfunc cnk(n, k int) int {\n\tif k < 0 || k > n || n < 0 {\n\t\treturn 0\n\t}\n\treturn mul(mul(facts[n], ifacts[k]), ifacts[n-k])\n}\n\nfunc f1(a, b int) int {\n\treturn sum(cnk(a + b - 1, a), cnk(a + b - 1, 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 solve(a, b, h int) int {\n\tq := f1(a, b)\n\th += 1\n\tif a == 0 {\n\t\treturn 1\n\t}\n\tif b == 0 {\n\t\tif a >= h {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}\n\tp := 0\n\tfor ka := 1; ka * h <= a; ka++ {\n\t\tfor kb := max(1, ka - 1); kb <= ka + 1 && kb <= b; kb++ {\n\t\t\tc0 := cnk(b - 1, kb - 1)\n\t\t\tc1 := cnk(a - ka * (h - 1) - 1, ka - 1)\n\t\t\t// fmt.Printf(\"%d %d %d %d\\n\", ka, kb, c0, c1)\n\t\t\td := mul(c0, c1)\n\t\t\tif ka == kb {\n\t\t\t\tp = sum(p, d)\n\t\t\t}\n\t\t\tp = sum(p, d)\n\t\t}\n\t}\n\treturn mul(p, inv(q))\n}\n\nfunc main() {\n\tm := 200100\n\tfacts = make([]int, m)\n\tifacts = make([]int, m)\n\tfacts[0] = 1\n\tfor i := 1; i < m; i++ {\n\t\tfacts[i] = mul(facts[i-1], i)\n\t}\n\tifacts[m-1] = inv(facts[m-1])\n\tfor i := m-2; i >= 0; i-- {\n\t\tifacts[i] = mul(ifacts[i+1], i+1)\n\t}\n\tcin := NewParser(bufio.NewReaderSize(os.Stdin, 1<<16))\n\ta := cin.nextInt()\n\tb := cin.nextInt()\n\th := cin.nextInt()\n\tfmt.Printf(\"%d\\n\", solve(b, a, h))\n}\n\n// some io\n\ntype ParserReader struct {\n\tr io.ByteReader\n\terr error\n\tc byte\n}\n\nfunc NewParser(r io.ByteReader) *ParserReader {\n\treturn &ParserReader{r, nil, 0}\n}\n\nfunc (p *ParserReader) next() error {\n\tp.c, p.err = p.r.ReadByte()\n\treturn p.err\n}\n\nfunc isDigit(c byte) bool {\n\treturn '0' <= c && c <= '9'\n}\n\nfunc (p *ParserReader) nextUInt64() uint64 {\n\tfor !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar r uint64\n\tfor isDigit(p.c) && p.err == nil {\n\t\tr = r*10 + uint64(p.c - '0')\n\t\tp.next()\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextUInt() uint {\n\tfor !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar r uint\n\tfor isDigit(p.c) && p.err == nil {\n\t\tr = r*10 + uint(p.c - '0')\n\t\tp.next()\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextInt64() int64 {\n\tfor p.c != '-' && !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar sign bool\n\tif p.c == '-' {\n\t\tsign = true\n\t}\n\tr := int64(p.nextUInt64())\n\tif sign {\n\t\treturn -r\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextInt() int {\n\tfor p.c != '-' && !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar sign bool\n\tif p.c == '-' {\n\t\tsign = true\n\t}\n\tr := int(p.nextUInt())\n\tif sign {\n\t\treturn -r\n\t}\n\treturn r\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "98094e958956f656238f9698ae71eb1a", "src_uid": "a69f95db3fe677111cf0558271b40f39", "difficulty": 2300.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"io/ioutil\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tbs, _ := ioutil.ReadAll(os.Stdin)\n\treader := bytes.NewBuffer(bs)\n\tvar a1,b1,c1,a2,b2,c2 int\n\tfmt.Fscanf(reader, \"%d %d %d\\n\", &a1, &b1, &c1)\n\tfmt.Fscanf(reader, \"%d %d %d\", &a2, &b2, &c2)\n\n\tif a1 * b2 - a2 * b1 != 0 {\n\t\tfmt.Printf(\"1\")\n\t} else if a1 * c2 - a2 * c1 == 0 {\n\t\tfmt.Printf(\"-1\")\n\t} else {\n\t\tfmt.Printf(\"0\")\n\t}\n\treturn\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "04567068fab0d1e266b022a8f17a6163", "src_uid": "c8e869cb17550e888733551c749f2e1a", "difficulty": 2000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"io/ioutil\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tbs, _ := ioutil.ReadAll(os.Stdin)\n\treader := bytes.NewBuffer(bs)\n\tvar a1,b1,c1,a2,b2,c2 int\n\tfmt.Fscanf(reader, \"%d %d %d\\n\", &a1, &b1, &c1)\n\tfmt.Fscanf(reader, \"%d %d %d\", &a2, &b2, &c2)\n\n\tif a1 * b2 - a2 * b1 != 0 {\n\t\tfmt.Printf(\"1\")\n\t} else if a1 * c2 - a2 * c1 == 0 && b1 * c2 - b2 * c1 == 0{\n\t\tif a1 == 0 && a2 == 0 && b1 == 0 && b2 == 0 && (c1 != 0 || c2 != 0) {\n\t\t\tfmt.Printf(\"0\")\n\t\t} else {\n\t\t\tfmt.Printf(\"-1\")\n\t\t}\n\t} else {\n\t\tfmt.Printf(\"0\")\n\t}\n\treturn\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "cef11e0c2b6ec4d0a020f45b53b9f060", "src_uid": "c8e869cb17550e888733551c749f2e1a", "difficulty": 2000.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 gcd(a, b int) int {\n sign := 1\n if a < 0 {\n a = -a\n sign = -sign\n }\n if b < 0 {\n b = -b\n sign = -sign\n }\n for b != 0 {\n a, b = b, a%b\n }\n return sign*a\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 result := 0\n a1, b1, c1 := getI(), getI(), getI()\n a2, b2, c2 := getI(), getI(), getI()\n g1, g2 := gcd(a1, b1), gcd(a2, b2)\n a1, b1, a2, b2 = a1/g1, b1/g1, a2/g2, b2/g2\n if a1 == a2 && b1 == b2 {\n if c1 == c2 {\n result = -1\n }\n } else {\n result = 1\n }\n\n writer.WriteString(fmt.Sprintf(\"%d\\n\", result))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "3488c288f073153ec5bdbd5e44f18b74", "src_uid": "c8e869cb17550e888733551c749f2e1a", "difficulty": 2000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF1085B(_r io.Reader, _w io.Writer) {\n\tvar n, k int\n\tFscan(_r, &n, &k)\n\tans := int(2e9)\n\tfor i := k - 1; i > 0; i-- {\n\t\tif n%i == 0 {\n\t\t\tif v := n/i*k + i; v < ans {\n\t\t\t\tans = v\n\t\t\t}\n\t\t}\n\t}\n\tFprint(_w, ans)\n}\n\nfunc main() { CF1085B(os.Stdin, os.Stdout) }\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "3e6df1a67aa7e15eb25d3b01e6bedb30", "src_uid": "ed0ebc1e484fcaea875355b5b7944c57", "difficulty": 1100.0} {"lang": "Go", "source_code": "// Find all the positive integers that smaller than k that divides n, can calc the result from there.\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tn, k, best := 0, 0, math.MaxInt32\n\tfmt.Scan(&n, &k)\n\n\tfor modRes := 1; modRes < k; modRes++ {\n\t\tif n%modRes != 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tdivRes := n / modRes\n\t\tpotentialNum := divRes*k + modRes\n\n\t\tif potentialNum < best {\n\t\t\tbest = potentialNum\n\t\t}\n\t}\n\n\tfmt.Println(best)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "941b6fcb06d6f2c6305bc644c43ade38", "src_uid": "ed0ebc1e484fcaea875355b5b7944c57", "difficulty": 1100.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, k := 0, 0\n\tfmt.Fscanf(in, \"%d %d\\n\", &n, &k)\n\tans := -1\n\tfor i := 1; i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\ta := i\n\t\t\tb := n / i\n\t\t\tif b >= k {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tx := a*k + b\n\t\t\tif x < ans || ans == -1 {\n\t\t\t\tans = x\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Fprintf(out, \"%d\\n\", ans)\n\treturn\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "32f792540f388270f7610ac944dca95b", "src_uid": "ed0ebc1e484fcaea875355b5b7944c57", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m, k int64\n\tfmt.Scanf(\"%d %d %d\\n\", &n, &m, &k)\n\n\tlo, hi := int64(0), n*m\n\tlargest := int64(0)\n\tfor lo <= hi {\n\t\tmid := (lo + hi) / 2\n\n\t\tcount := int64(0)\n\t\tfor i := int64(1); i <= n; i++ {\n\t\t\tx := min(m, mid/i)\n\t\t\tcount += x\n\t\t}\n\n\t\tif count < k {\n\t\t\tlargest = mid\n\t\t\tlo = mid + 1\n\t\t} else {\n\t\t\thi = mid - 1\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", largest+1)\n}\n\nfunc min(a, b int64) int64 {\n\tif a <= b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "163d673fb3fa032af97fc749ef5f8fcd", "src_uid": "13a918eca30799b240ceb9de47507a26", "difficulty": 1800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar s string\n\tvar i int\n\n\tfmt.Scanf(\"%d\", &i)\n\tfor i := 1; i < 1001; i++ {\n\t\ts += strconv.Itoa(i)\n\t}\n\tfmt.Println(string(s[i-1]))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "b0d466a6be69bc24791b088c77ca8f72", "src_uid": "2d46e34839261eda822f0c23c6e19121", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n )\n\nfunc splitToDigits(n int) []int {\n var a []int = make([]int, 0)\n for n > 0 {\n a = append(a, n%10)\n n = n/10\n }\n return a\n}\n\nfunc main() {\n var n int\n fmt.Scanf(\"%v\\n\", &n)\n pos := 0\n for q := 1; q <= n; q++ {\n a := splitToDigits(q)\n pos += len(a)\n //fmt.Printf(\"%v %v\\n\", pos, a)\n if pos == n {\n fmt.Printf(\"%v\", a[0])\n return\n } else if pos > n {\n for i := 0; i < len(a); i++ {\n pos -= 1\n if pos == n-1 {\n fmt.Printf(\"%v\", a[i])\n return\n }\n }\n }\n }\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "da97cb5396d0041f71d28639c4a959ef", "src_uid": "2d46e34839261eda822f0c23c6e19121", "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 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\ts := \"\"\n\tfor i := 1; i < 1001; i++ {\n\t\ts += strconv.Itoa(i)\n\t}\n\tfor I(&n, \"\\n\") == nil {\n\t\tO(string(s[n-1]), \"\\n\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "768833c2ddaf3e286f861325aba2114a", "src_uid": "2d46e34839261eda822f0c23c6e19121", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\nimport \"strconv\"\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n str := \"0\"\n for i:=1; i<=n; i++{\n s := strconv.Itoa(i)\n str += s\n }\n fmt.Print(str[n])\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "76390c7cfd3fbe090a2a9273226d715f", "src_uid": "2d46e34839261eda822f0c23c6e19121", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\nimport \"strconv\"\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n str := \"0\"\n for i:=1; i<=n; i++{\n s := strconv.Itoa(i)\n str += s\n }\n fmt.Println(str)\n fmt.Printf(\"%d\", str[n])\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "7143d6b2850d43c1ce16f5c31ebb9f37", "src_uid": "2d46e34839261eda822f0c23c6e19121", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\nimport \"strconv\"\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n str := \"0\"\n for i:=1; i<=n; i++{\n s, _ := strconv.Itoa(i)\n str += s\n }\n fmt.Print(str[n])\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "312742b808c4282211be3ecc7113ccfa", "src_uid": "2d46e34839261eda822f0c23c6e19121", "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\tvar n, i uint\n\tinput := bufio.NewScanner(os.Stdin)\n\t//input.Split(bufio.ScanWords)\n\tscanInt := func() int {\n\t\tinput.Scan()\n\t\tnumber, _ := strconv.Atoi(input.Text())\n\t\treturn number\n\t}\n\tn = uint(scanInt())\n\taa := make([]int, n)\n\tfor i = 0; i < n; i++ {\n\t\taa[i] = scanInt()\n\t}\n\tfor b := 0; b < (1 << n); b++ {\n\t\tsum := 0\n\t\tfor i = 0; i < n; i++ {\n\t\t\tif b & (1 << i) != 0 {\n\t\t\t\tsum += aa[i]\n\t\t\t\t} else { sum -= aa[i] }\n\t\t}\n\t\tif sum % 360 == 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "4604cb296fc8a80f333c3845fd039316", "src_uid": "01b50fcba4185ceb1eb8e4ba04a0cc10", "difficulty": 1200.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 CF1097B(_r io.Reader, out io.Writer) {\n\tin := bufio.NewReader(_r)\n\tvar n int\n\tFscan(in, &n)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\tFscan(in, &a[i])\n\t}\n\tf := func(sub int) (res int) {\n\t\tfor i, v := range a {\n\t\t\tif sub>>i&1 == 0 {\n\t\t\t\tres += v\n\t\t\t} else {\n\t\t\t\tres -= v\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\tfor sub := 0; sub < 1<>uint(j))&1 == 1 {\n\t\t\t\tsum += a[j]\n\t\t\t} else {\n\t\t\t\tsum -= a[j]\n\t\t\t}\n\t\t}\n\t\tif sum%360 == 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\n\tfmt.Println(\"NO\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "118321cfc752706a59ffd771f08a6c22", "src_uid": "01b50fcba4185ceb1eb8e4ba04a0cc10", "difficulty": 1200.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\t\"strings\"\n)\n\nconst (\n\tBIG = 1024 * 1024 * 10\n)\n\nfunc readLine(r *bufio.Reader) string {\n\tbytes, _, err := r.ReadLine()\n\tif err != nil {\n\t\tlog.Fatalln(\"Failed to read line\")\n\t}\n\n\treturn string(bytes)\n}\n\nfunc readInts(r *bufio.Reader) []int {\n\telems := strings.Fields(readLine(r))\n\n\tret := make([]int, len(elems))\n\tfor i, el := range elems {\n\t\ttmp, err := strconv.ParseInt(el, 10, 64)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Failed to parse number %v\", el)\n\t\t}\n\t\tret[i] = int(tmp)\n\t}\n\n\treturn ret\n}\n\nfunc main() {\n\tr := bufio.NewReaderSize(os.Stdin, BIG)\n\n\tn := readInts(r)[0]\n\n\tais := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tais[i] = readInts(r)[0]\n\t}\n\n\tcoll := make(map[int]bool)\n\tcoll[0] = true\n\tfor _, ai := range ais {\n\t\tnColl := make(map[int]bool)\n\t\tfor el, _ := range coll {\n\t\t\tnColl[el-ai] = true\n\t\t\tnColl[el+ai] = true\n\t\t}\n\t\tcoll = nColl\n\t}\n\tfor el, _ := range coll {\n\t\tif el%360 == 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "55d0c6709d4d3e091e5aaa3fc2fffa88", "src_uid": "01b50fcba4185ceb1eb8e4ba04a0cc10", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar r, x, y, xp, yp, steps int\n\n\tfmt.Scan(&r, &x, &y, &xp, &yp)\n\n\tdistanceSquare := (xp-x)*(xp-x) + (yp-y)*(yp-y)\n\n\tif distanceSquare%((2*r)*(2*r)) == 0 {\n\t\tsteps = int(math.Sqrt(float64(distanceSquare))) / (2 * r)\n\t} else {\n\t\tsteps = (int(math.Sqrt(float64(distanceSquare))) + 2*r) / (2 * r)\n\t}\n\n\tfmt.Println(steps)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "02b9d082d0c0bebf976c45d7141106e5", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar r, x, y, xp, yp int\n\n\tfmt.Scan(&r, &x, &y, &xp, &yp)\n\n\tfmt.Println((int(math.Ceil(math.Sqrt(float64(\n\t\t(xp-x)*(xp-x)+(yp-y)*(yp-y))))) + r*2 - 1) / (r * 2))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "aab626598aa7937607de5aa23afba6a8", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar r, x, y, xp, yp, steps int\n\n\tfmt.Scan(&r, &x, &y, &xp, &yp)\n\n\tdistanceSquare := (xp-x)*(xp-x) + (yp-y)*(yp-y)\n\n\tsteps = (int(math.Ceil(math.Sqrt(float64(distanceSquare)))) + 2*r - 1) / (2 * r)\n\n\tfmt.Println(steps)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "9525b5a15ee75c4e387e80d6bcd89440", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n \"math\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\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 r, x1, y1, x2, y2 := getI(), getI(), getI(), getI(), getI()\n d := math.Sqrt(float64((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)))\n result := int(math.Ceil(d / float64(2*r)))\n writer.WriteString(fmt.Sprintf(\"%d\\n\", result))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "2af7a4323c1991f37c7a9ebed43c0c32", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar r, x, y, nx, ny int64\n\tfmt.Scanf(\"%d %d %d %d %d\", &r, &x, &y, &nx, &ny)\n\ts := (x-nx)*(x-nx) + (y-ny)*(y-ny)\n\tr *= 2\n\tvar i int64\n\tfor i = 0; i*i*r*r < s; i++ {\n\n\t}\n\tfmt.Println(i)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "7bc74738b73351faef806406a8534a7b", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\tm \"math\"\n)\n\nfunc main() {\n\tvar r, x, y, x_dash, y_dash int\n\tif _, err := fmt.Scanf(\"%d %d %d %d %d\\n\",\n\t\t&r, &x, &y, &x_dash, &y_dash); err != nil {\n\t\treturn\n\t}\n\n\tvar distance = m.Sqrt(m.Abs(float64(x-x_dash))*m.Abs(float64(x-x_dash)) +\n\t\tm.Abs(float64(y-y_dash))*m.Abs(float64(y-y_dash)))\n\tvar moves = int(distance / (float64(2 * r)))\n\tif distance-float64(moves*r*2) > 0 {\n\t\tmoves++\n\t}\n\n\tfmt.Printf(\"%d\\n\", moves)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "f5c54c730cf4583b5a07d2e21b14a6b3", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"math\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tr, x1, y1, x2, y2 := nextInt(), int64(nextInt()), int64(nextInt()), int64(nextInt()), int64(nextInt())\n\tsteps := 0\n\n\tx1 -= x2\n\ty1 -= y2\n\n\tdis := math.Sqrt(float64(x1 * x1 + y1 * y1))\n\n\tfor dis > 0 {\n\t\tdis -= float64(r * 2)\n\t\tsteps++\n\t}\n\n\tprintln(steps)\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, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "698492ba19de26fec1769fbe23fbb4ee", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar r, x0, y0, x1, y1 float64\n\tfmt.Scan(&r, &x0, &y0, &x1, &y1)\n\td := math.Hypot(x0-x1, y0-y1)\n\tr += 1e-10\n\tfmt.Println(math.Ceil(d / (2 * r)))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "c60169497667928464cf732e1c747701", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"math\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ReadString() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc ReadFloat64() float64 {\n f64, _ := strconv.ParseFloat(ReadString(), 64)\n return f64\n}\n\nfunc ReadInt64() int64 {\n i64, _ := strconv.ParseInt(ReadString(), 10, 0)\n return i64\n}\n\nfunc ReadInt() int {\n return int(ReadInt64())\n}\n\nfunc main() {\n defer writer.Flush()\n scanner.Split(bufio.ScanWords)\n r, x1, y1, x2, y2 := ReadInt64(), ReadInt64(), ReadInt64(), ReadInt64(), ReadInt64()\n r *= 2\n len := (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)\n sqrt_len := math.Sqrt(float64(len))\n ans := int64(sqrt_len) / r\n sqrt_len -= float64(ans * r)\n for sqrt_len > 1E-8 {\n sqrt_len -= float64(r)\n ans++\n }\n fmt.Fprintln(writer, ans)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "6c48c2cc50a50865757a5e18c9afc0a2", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\txs := make([]int, n*2)\n\tys := make([]int, n*2)\n\tarea := 0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&xs[2*i], &ys[2*i], &xs[2*i+1], &ys[2*i+1])\n\t\tarea += (xs[2*i+1] - xs[2*i]) * (ys[2*i+1] - ys[2*i])\n\t}\n\tsort.Ints(xs)\n\tsort.Ints(ys)\n\tsquareArea := (xs[2*n-1] - xs[0]) * (ys[2*n-1] - ys[0])\n\tif squareArea == area {\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": "820adc6d824162944590e35c5ee51d88", "src_uid": "f63fc2d97fd88273241fce206cc217f2", "difficulty": 1500.0} {"lang": "Go", "source_code": "\npackage main\nimport (\n \"fmt\"\n )\nfunc main(){\n var n int\n fmt.Scan(&n)\n\tfmt.Println(con(n))\n}\n\nfunc con(n int) int {\n\tr := n & (1 << 5)\n\tr += (n & (1 << 4)) >> 2\n\tr += (n & (1 << 3)) >> 3\n\tr += (n & (1 << 2)) << 1\n\tr += n & (1 << 1)\n\tr += (n & 1) << 4\n\treturn r\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "3a916a0629ba2df8c2907759b4480bf4", "src_uid": "db5e54f466e1f3d69a51ea0b346e667c", "difficulty": null} {"lang": "Go", "source_code": "package main\nimport (\n \"fmt\"\n )\nfunc main(){\n var n int\n fmt.Scan(&n)\n\tfmt.Println(con1(n))\n}\nfunc con1(n int) int{\n\tr := n&(1<<5)\n\tr += (n&(1<<4))>>4\n\tr += (n&(1<<3))>>1\n\tr += (n&(1<<2))<<2\n\tr += (n&(1<<1))\n\tr += (n&1)<<3\n\treturn r\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "6702cb281d5026eccc4dd5f90b5261e8", "src_uid": "db5e54f466e1f3d69a51ea0b346e667c", "difficulty": null} {"lang": "Go", "source_code": "package main\nimport (\n \"fmt\"\n )\nfunc main(){\n var n, r int\n fmt.Scan(&n)\n r += (n&(1<<5))>>4\n r += (n&(1<<4))>>2\n \tr += (n&(1<<3))>>3\n\tr += (n&(1<<2))<<1\n\tr += (n&(1<<1))<<4\n\tr += (n&1)<<4\n\tfmt.Println(r)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "798ab7245c0f3eccb603bfc3aee25308", "src_uid": "db5e54f466e1f3d69a51ea0b346e667c", "difficulty": null} {"lang": "Go", "source_code": "package main\nimport (\"fmt\");\nfunc main(){\n var x int;\n fmt.Scan(&x);\n ans := x & (1 << 5);\n ans += (x & (1 << 3) ) >> 1;\n\tans += (x & (1 << 4) ) >> 4;\n\tans += (x & (1 << 2) ) << 1;\n\tans += x & (1 << 1);\n\tans += (x & 1) << 4;\n\tfmt.Println(ans);\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "e9e7556739a4eaf9da993b521239b5a1", "src_uid": "db5e54f466e1f3d69a51ea0b346e667c", "difficulty": null} {"lang": "Go", "source_code": "package main\nimport (\n \"fmt\"\n )\nfunc main(){\n var a int\n fmt.Scan(&a)\n\tfmt.Println(fun(a))\n}\n \nfunc fun(a int) int {\n\tres := a & (1 << 5)\n\tres += (a & (1 << 4)) >> 4\n\tres += (a & (1 << 3)) >> 1\n\tres += (a & (1 << 2)) << 1\n\tres += a & (1 << 1)\n\tres += (a & 1) << 4\n\treturn res\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "3e1d766fae43577434a4c242f9c090f5", "src_uid": "db5e54f466e1f3d69a51ea0b346e667c", "difficulty": null} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, ans uint\n\tfmt.Scanf(\"%d\", &a)\n\tin3 := (a & 0x8) != 0\n\tin2 := (a & 0x4) != 0\n\tin1 := (a & 0x2) != 0\n\tin0 := (a & 0x1) != 0\n\n\tout3 := !in3\n\tout2 := out3 != in2\n\tout1 := in1 != (out3 && out2)\n\tout0 := in0 != (out3 && out2 && out1)\n\n\tif out3 {\n\t\tans += 8\n\t}\n\tif out2 {\n\t\tans += 4\n\t}\n\tif out1 {\n\t\tans += 2\n\t}\n\tif out0 {\n\t\tans += 1\n\t}\n\tfmt.Printf(\"%d\", ans)\n\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "0ce15f205baf9e24227b60cc98f94210", "src_uid": "879ac20ae5d3e7f1002afe907d9887df", "difficulty": null} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\nvar input io.Reader\n\ntype qu struct {\n\tpos, old int\n}\n\nfunc main() {\n\tvar (\n\t\trecipe string\n\t\tnb, ns, nc int64\n\t\tpb, ps, pc int64\n\t\tcb, cs, cc int64\n\t\trub int64\n\t)\n\tinput = bufio.NewReader(os.Stdin)\n\tfmt.Fscanln(input, &recipe)\n\tfmt.Fscan(input, &nb, &ns, &nc)\n\tfmt.Fscan(input, &pb, &ps, &pc)\n\tfmt.Fscan(input, &rub)\n\n\tfor i := 0; i < len(recipe); i++ {\n\t\tswitch recipe[i] {\n\t\tcase 'B': cb++\n\t\tcase 'S': cs++\n\t\tcase 'C': cc++\n\t\t}\n\t}\n\tl, r := int64(0), int64(1e12 + 1000)\n\tfor l < r {\n\t\tmid := l + (r - l) / 2\n\t\tcost := mid*(nn(cb*pb - nb*pb) + nn(cs*ps - ns*ps) + nn(cc*pc - nc*pc))\n\t\tif cost <= rub {\n\t\t\tl = mid + 1\n\t\t} else {\n\t\t\tr = mid\n\t\t}\n\t}\n\n\tfmt.Println(r - 1)\n}\n\nfunc nn(z int64) int64 {\n\tif z < 0 {\n\t\treturn 0\n\t}\n\treturn z\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "e6f4f04b4584d7db84dc2ec3f548f217", "src_uid": "8126a4232188ae7de8e5a7aedea1a97e", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\nvar input io.Reader\n\ntype qu struct {\n\tpos, old int\n}\n\nfunc main() {\n\tvar (\n\t\trecipe string\n\t\tnb, ns, nc int64\n\t\tpb, ps, pc int64\n\t\tcb, cs, cc int64\n\t\trub int64\n\t)\n\tinput = bufio.NewReader(os.Stdin)\n\tfmt.Fscanln(input, &recipe)\n\tfmt.Fscan(input, &nb, &ns, &nc)\n\tfmt.Fscan(input, &pb, &ps, &pc)\n\tfmt.Fscan(input, &rub)\n\n\tfor i := 0; i < len(recipe); i++ {\n\t\tswitch recipe[i] {\n\t\tcase 'B': cb++\n\t\tcase 'S': cs++\n\t\tcase 'C': cc++\n\t\t}\n\t}\n\tl, r := int64(0), int64(1e12 + 1000)\n\tfor l < r {\n\t\tmid := l + (r - l) / 2\n\t\tvar b, s, c int64 \n\t\tif cb > 0 { b = mid*cb*pb - nb*pb }\n\t\tif cs > 0 { s = mid*cs*ps - ns*ps }\n\t\tif cc > 0 { c = mid*cc*pc - nc*pc }\n\t\tcost := b + s + c\n\t\tif cost <= rub {\n\t\t\tl = mid + 1\n\t\t} else {\n\t\t\tr = mid\n\t\t}\n\t}\n\n\tfmt.Println(r - 1)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "26cb4bfb36bdfd71c5931577846f8d4e", "src_uid": "8126a4232188ae7de8e5a7aedea1a97e", "difficulty": 1600.0} {"lang": "Go", "source_code": "// Author: sighduck\n// URL: https://codeforces.com/problemset/problem/371/C\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nconst MaxBurgers = int64(1e12)\n\nfunc max(x, y int64) int64 {\n\tif x >= y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc p(burgers, cb, cs, cc, nb, ns, nc, pb, ps, pc int64) int64 {\n\treturn max(0, cb*burgers-nb)*pb + max(0, cs*burgers-ns)*ps + max(0, cc*burgers-nc)*pc\n}\n\nfunc _Solve(left, right, cb, cs, cc, nb, ns, nc, pb, ps, pc, rubles int64) int64 {\n\tif !(left < right) {\n\t\treturn left\n\t}\n\tm := (left + right + 1) / 2\n\tcost := p(m, cb, cs, cc, nb, ns, nc, pb, ps, pc)\n\tif cost <= rubles {\n\t\treturn _Solve(m, right, cb, cs, cc, nb, ns, nc, pb, ps, pc, rubles)\n\t}\n\treturn _Solve(left, m-1, cb, cs, cc, nb, ns, nc, pb, ps, pc, rubles)\n}\n\nfunc Solve(s string, nb, ns, nc, pb, ps, pc, r int64) int64 {\n\tcb := int64(strings.Count(s, \"B\"))\n\tcs := int64(strings.Count(s, \"S\"))\n\tcc := int64(strings.Count(s, \"C\"))\n\treturn _Solve(0, MaxBurgers, cb, cs, cc, nb, ns, nc, pb, ps, pc, r)\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar s string\n\tfmt.Fscanf(reader, \"%s\\n\", &s)\n\tvar nb, ns, nc int64\n\tfmt.Fscanf(reader, \"%d %d %d\\n\", &nb, &ns, &nc)\n\tvar pb, ps, pc int64\n\tfmt.Fscanf(reader, \"%d %d %d\\n\", &pb, &ps, &pc)\n\tvar r int64\n\tfmt.Fscanf(reader, \"%d\\n\", &r)\n\n\tfmt.Fprintf(writer, \"%d\\n\", Solve(s, nb, ns, nc, pb, ps, pc, r))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "e4a16838fe5cc5db2f270e325136769e", "src_uid": "8126a4232188ae7de8e5a7aedea1a97e", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\nvar input io.Reader\n\ntype qu struct {\n\tpos, old int\n}\n\nfunc main() {\n\tvar (\n\t\trecipe string\n\t\tnb, ns, nc int64\n\t\tpb, ps, pc int64\n\t\tcb, cs, cc int64\n\t\trub int64\n\t)\n\tinput = bufio.NewReader(os.Stdin)\n\tfmt.Fscanln(input, &recipe)\n\tfmt.Fscan(input, &nb, &ns, &nc)\n\tfmt.Fscan(input, &pb, &ps, &pc)\n\tfmt.Fscan(input, &rub)\n\n\tfor i := 0; i < len(recipe); i++ {\n\t\tswitch recipe[i] {\n\t\tcase 'B': cb++\n\t\tcase 'S': cs++\n\t\tcase 'C': cc++\n\t\t}\n\t}\n\tdiscont := int64(0)\n\tif cb > 0 {\n\t\tdiscont += nb*pb\n\t}\n\tif cs > 0 {\n\t\tdiscont += ns*ps\n\t}\n\tif cc > 0 {\n\t\tdiscont += nc*pc\n\t}\n\tl, r := int64(0), int64(1e12 + 1000)\n\tfor l < r {\n\t\tmid := l + (r - l) / 2\n\t\tcost := mid*(cb*pb + cs*ps + cc*pc)\n\t\tif cost - discont <= rub {\n\t\t\tl = mid + 1\n\t\t} else {\n\t\t\tr = mid\n\t\t}\n\t}\n\n\tfmt.Println(r - 1)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "86cd64fb2ce48e48a41ddd160e91c8a0", "src_uid": "8126a4232188ae7de8e5a7aedea1a97e", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nvar input io.Reader\n\ntype qu struct {\n\tpos, old int\n}\n\nfunc main() {\n\tvar (\n\t\trecipe string\n\t\tnb, ns, nc int64\n\t\tpb, ps, pc int64\n\t\tcb, cs, cc int64\n\t\trub int64\n\t)\n\tinput = bufio.NewReader(os.Stdin)\n\tfmt.Fscanln(input, &recipe)\n\tfmt.Fscan(input, &nb, &ns, &nc)\n\tfmt.Fscan(input, &pb, &ps, &pc)\n\tfmt.Fscan(input, &rub)\n\n\tfor i := 0; i < len(recipe); i++ {\n\t\tswitch recipe[i] {\n\t\tcase 'B':\n\t\t\tcb++\n\t\tcase 'S':\n\t\t\tcs++\n\t\tcase 'C':\n\t\t\tcc++\n\t\t}\n\t}\n\tl, r := int64(0), int64(1e12+1000)\n\tfor l < r {\n\t\tmid := l + (r-l)/2\n\t\tvar b, s, c int64\n\t\tif cb > 0 {\n\t\t\tb = nn(mid*cb*pb - nb*pb)\n\t\t}\n\t\tif cs > 0 {\n\t\t\ts = nn(mid*cs*ps - ns*ps)\n\t\t}\n\t\tif cc > 0 {\n\t\t\tc = nn(mid*cc*pc - nc*pc)\n\t\t}\n\t\tcost := b + s + c\n\t\tif cost <= rub {\n\t\t\tl = mid + 1\n\t\t} else {\n\t\t\tr = mid\n\t\t}\n\t}\n\n\tfmt.Println(r - 1)\n}\n\nfunc nn(x int64) int64 {\n\tif x < 0 {\n\t\treturn 0\n\t}\n\treturn x\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "5874b289a4e46bc24dab4a477b6f7ae1", "src_uid": "8126a4232188ae7de8e5a7aedea1a97e", "difficulty": 1600.0} {"lang": "Go", "source_code": "// Author: sighduck\n// URL: https://codeforces.com/problemset/problem/371/C\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nconst MaxBurgers = int64(1e13)\n\nfunc max(x, y int64) int64 {\n\tif x >= y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc p(burgers, cb, cs, cc, nb, ns, nc, pb, ps, pc int64) int64 {\n\treturn max(0, cb*burgers-nb)*pb + max(0, cs*burgers-ns)*ps + max(0, cc*burgers-nc)*pc\n}\n\nfunc _Solve(left, right, cb, cs, cc, nb, ns, nc, pb, ps, pc, rubles int64) int64 {\n\tif !(left < right) {\n\t\treturn left\n\t}\n\tm := (left + right + 1) / 2\n\tcost := p(m, cb, cs, cc, nb, ns, nc, pb, ps, pc)\n\tif cost <= rubles {\n\t\treturn _Solve(m, right, cb, cs, cc, nb, ns, nc, pb, ps, pc, rubles)\n\t}\n\treturn _Solve(left, m-1, cb, cs, cc, nb, ns, nc, pb, ps, pc, rubles)\n}\n\nfunc Solve(s string, nb, ns, nc, pb, ps, pc, r int64) int64 {\n\tcb := int64(strings.Count(s, \"B\"))\n\tcs := int64(strings.Count(s, \"S\"))\n\tcc := int64(strings.Count(s, \"C\"))\n\treturn _Solve(0, MaxBurgers, cb, cs, cc, nb, ns, nc, pb, ps, pc, r)\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar s string\n\tfmt.Fscanf(reader, \"%s\\n\", &s)\n\tvar nb, ns, nc int64\n\tfmt.Fscanf(reader, \"%d %d %d\\n\", &nb, &ns, &nc)\n\tvar pb, ps, pc int64\n\tfmt.Fscanf(reader, \"%d %d %d\\n\", &pb, &ps, &pc)\n\tvar r int64\n\tfmt.Fscanf(reader, \"%d\\n\", &r)\n\n\tfmt.Fprintf(writer, \"%d\\n\", Solve(s, nb, ns, nc, pb, ps, pc, r))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "5baf1e81e5f4e9317eac2b2745fbbbf1", "src_uid": "8126a4232188ae7de8e5a7aedea1a97e", "difficulty": 1600.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 _, m, a, b := getI(), getI(), getI(), getI()\n a--\n b--\n p, q := a%m, b%m\n result := 3\n if a/m == b/m || (p == 0 && q == m-1) {\n result = 1\n } else if a/m + 1 == b/m || p == 0 || q == m-1 {\n result = 2\n }\n writer.WriteString(fmt.Sprintf(\"%d\\n\", result))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "4881d618b29acfb49b8945c186a8fb61", "src_uid": "f256235c0b2815aae85a6f9435c69dac", "difficulty": 1700.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, m, a, b := getI(), getI(), getI(), getI()\n a--\n b--\n p, q := a%m, b%m\n result := 3\n if a/m == b/m || (p == 0 && (q == m-1 || b == n-1)) {\n result = 1\n } else if a/m + 1 == b/m || p == 0 || q == m-1 || b == n-1 {\n result = 2\n }\n writer.WriteString(fmt.Sprintf(\"%d\\n\", result))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "1dbf373173d7dbd9f7958e4298980b1c", "src_uid": "f256235c0b2815aae85a6f9435c69dac", "difficulty": 1700.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, m, a, b := getI(), getI(), getI(), getI()\n a--\n b--\n p, q := a%m, b%m\n result := 3\n if a/m == b/m || (p == 0 && (q == m-1 || b == n-1)) {\n result = 1\n } else if a/m + 1 == b/m || p == 0 || q == m-1 || b == n-1 || p == q+1 {\n result = 2\n }\n writer.WriteString(fmt.Sprintf(\"%d\\n\", result))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "28dae6105053e0467899cf2ccea04aa1", "src_uid": "f256235c0b2815aae85a6f9435c69dac", "difficulty": 1700.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 res []int\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Scan()\n\tn, _ := strconv.Atoi(scanner.Text())\n\tscanner.Scan()\n\tk, _ := strconv.Atoi(scanner.Text())\n\n\tsolve(n, k)\n\tif len(res) == 0 {\n\t\tfmt.Println(-1)\n\t\tos.Exit(0)\n\t}\n\tcheck := 1\n\tfor _, el := range res {\n\t\tcheck *= el\n\t}\n\tif check != n {\n\t\tfmt.Println(-1)\n\t\tos.Exit(0)\n\t}\n\tfor i, el := range res {\n\t\tif i == len(res)-1 {\n\t\t\tfmt.Printf(\"%d\\n\", el)\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Printf(\"%d \", el)\n\t}\n}\n\nfunc solve(n, k int) {\n\tif n == 1 {\n\t\treturn\n\t}\n\tif k == 1 {\n\t\tres = append(res, n)\n\t\treturn\n\t}\n\tfor i := 2; i <= int(math.Sqrt(float64(n)))+1; i++ {\n\t\tif n%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tsolve(n/i, k-1)\n\t\t\treturn\n\t\t}\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "19d85237c93b2f8431713bc4f4af70de", "src_uid": "bd0bc809d52e0a17da07ccfd450a4d79", "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)\n\nvar res []int\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Scan()\n\tn, _ := strconv.Atoi(scanner.Text())\n\tscanner.Scan()\n\tk, _ := strconv.Atoi(scanner.Text())\n\n\tsolve(n, k)\n\tif len(res) == 0 {\n\t\tfmt.Println(-1)\n\t\tos.Exit(0)\n\t}\n\tfor i, el := range res {\n\t\tif i == len(res)-1 {\n\t\t\tfmt.Printf(\"%d\\n\", el)\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Printf(\"%d \", el)\n\t}\n}\n\nfunc solve(n, k int) {\n\tif k == 1 {\n\t\tres = append(res, n)\n\t\treturn\n\t}\n\tfor i := 2; i <= int(math.Sqrt(float64(n)))+1; i++ {\n\t\tif n%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tsolve(n/i, k-1)\n\t\t\treturn\n\t\t}\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "3a505a18f99f1083b909fa35ce254445", "src_uid": "bd0bc809d52e0a17da07ccfd450a4d79", "difficulty": 1100.0} {"lang": "Go", "source_code": "// http://acm.timus.ru/problem.aspx?space=1&num=1741\npackage main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n\n// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)\n\nconst (\n\tMOD = 1e9 + 7\n)\n\ntype (\n\n)\n\nfunc main () {\n\tvar (\n\t\tn, k int\n\t)\n\n\t//f, _ := os.Open(\"input.txt\")\n\t//input := bufio.NewReader(f)\n\tinput := bufio.NewReader(os.Stdin)\n\tfmt.Fscanln(input, &n, &k)\n\n\tfactors := make([]int, 0, 100000 + 1)\n\n\tfor i := 2; i < n; i++ {\n\t\tfor n % i == 0 {\n\t\t\tfactors = append(factors, i)\n\t\t\tn /= i\n\t\t}\n\t}\n\n\tif len(factors) < k {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\tfor i := 0; i < k - 1; i++ {\n\t\tfmt.Println(factors[i])\n\t}\n\n\tif k < len(factors) {\n\t\tlast := 1\n\t\tfor i := k - 1; i < len(factors); i++ {\n\t\t\tlast *= factors[i]\n\t\t}\n\n\t\tfmt.Println(last)\n\t}\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "fcdccd1b38a619dd509f63c7dab5096d", "src_uid": "bd0bc809d52e0a17da07ccfd450a4d79", "difficulty": 1100.0} {"lang": "Go", "source_code": "// http://acm.timus.ru/problem.aspx?space=1&num=1741\npackage main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n\n// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)\n\nconst (\n\tMOD = 1e9 + 7\n)\n\ntype (\n\n)\n\nfunc main () {\n\tvar (\n\t\tn, k int\n\t)\n\n\t//f, _ := os.Open(\"input.txt\")\n\t//input := bufio.NewReader(f)\n\tinput := bufio.NewReader(os.Stdin)\n\tfmt.Fscanln(input, &n, &k)\n\n\tfactors := make([]int, 0, 100000 + 1)\n\n\tfor i := 2; i < n; i++ {\n\t\tfor n % i == 0 {\n\t\t\tfactors = append(factors, i)\n\t\t\tn /= i\n\t\t}\n\t}\n\n\tif n != 1 {\n\t\tfactors = append(factors, n)\n\t}\n\n\tif len(factors) < k {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\tfor i := 0; i < k - 1; i++ {\n\t\tfmt.Println(factors[i])\n\t}\n\n\tif k - 1 < len(factors) {\n\t\tlast := 1\n\t\tfor i := k - 1; i < len(factors); i++ {\n\t\t\tlast *= factors[i]\n\t\t}\n\n\t\tfmt.Println(last)\n\t}\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "0ece1c058f53cce67acc7911af0c6cb8", "src_uid": "bd0bc809d52e0a17da07ccfd450a4d79", "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 solve() {\n\tn := readInt()\n\tk := readInt()\n\ta := make([]int, k)\n\tif k == 1 {\n\t\ta[0] = n\n\t\tk = 0\n\t}\n\tfor i := 2; i <= n && k > 1; i++ {\n\t\tfor n%i == 0 {\n\t\t\tk--\n\t\t\tn /= i\n\t\t\ta[k] = i\n\t\t\tif k == 1 {\n\t\t\t\tif n != 1 {\n\t\t\t\t\ta[0] = n\n\t\t\t\t\tk--\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif k == 0 {\n\t\tfor i := 0; i < len(a); i++ {\n\t\t\tif i > 0 {\n\t\t\t\tfmt.Print(\" \")\n\t\t\t}\n\t\t\tfmt.Print(a[i])\n\t\t}\n\t} else {\n\t\tfmt.Println(-1)\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}\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": false, "code_uid": "d73226f051f4ebe4bc9482cdb2b507f2", "src_uid": "bd0bc809d52e0a17da07ccfd450a4d79", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m, p int\n\tfmt.Scan(&n, &m, &p)\n\n\tp--\n\tvar l = p / (2 * m)\n\tp %= 2 * m\n\tvar s = p & 1\n\tp >>= 1\n\n\tif s == 0 {\n\t\tfmt.Println(l+1, p+1, \"L\")\n\t} else {\n\t\tfmt.Println(l+1, p+1, \"R\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "b648cdd14a97ac4d4085fa2d8d03180e", "src_uid": "d6929926b44c2d5b1a8e6b7f965ca1bb", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m, k int\n\tif _, err := fmt.Scanf(\"%d %d %d\\n\", &n, &m, &k); err != nil {\n\t\treturn\n\t}\n\n\tlane := (k-1)/(2*m) + 1\n\tlane_start := (lane-1)*2*m + 1\n\tdesk := (k-lane_start)/2 + 1\n\tvar place string\n\tif (k-lane_start)%2 == 0 {\n\t\tplace = \"L\"\n\t} else {\n\t\tplace = \"R\"\n\t}\n\n\tfmt.Println(lane, desk, place)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "66581cf25ec0bd9942a1046d5e1f40c8", "src_uid": "d6929926b44c2d5b1a8e6b7f965ca1bb", "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\treadInt()\n\tm := readInt()\n\tk := readInt() - 1\n\n\tcolumn := (k) / (m * 2)\n\trow := (k % (m * 2)) / 2\n\trow1 := (k % (m * 2)) % 2\n\tfmt.Printf(\"%d \", column+1)\n\tfmt.Printf(\"%d \", row+1)\n\tif row1 == 0 {\n\t\tfmt.Println(\"L\")\n\t} else {\n\t\tfmt.Println(\"R\")\n\t}\n}\n\nfunc getStats(str string) map[byte]int {\n\tstat := map[byte]int{}\n\tfor _, v := range str {\n\t\tstat[byte(v)]++\n\t}\n\treturn stat\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 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": false, "code_uid": "2305d866dbac2ca750468de1467e7c7e", "src_uid": "d6929926b44c2d5b1a8e6b7f965ca1bb", "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 = 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 + 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": "72227111a1dafd32a324514171a1e01e", "src_uid": "af07223819aeb5bd6ded4340c472b2b6", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar Arr [105] int\n\tvar N,w,b int\n\tfmt.Scanf(\"%d %d %d \\n\",&N,&w,&b)\n\tfor i:=1; i ri {\n\t\t\tbreak\n\t\t} else if i == ri {\n\t\t\tif c[i] == 2 {\n\t\t\t\tans += min_price\n\t\t\t}\n\t\t} else {\n\t\t\tif c[i] != 2 && c[ri] != 2 {\n\t\t\t\tif c[i] != c[ri] {\n\t\t\t\t\tans = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else if c[i] == 2 && c[ri] != 2 {\n\t\t\t\tif c[ri] == 0 {\n\t\t\t\t\tans += a\n\t\t\t\t} else {\n\t\t\t\t\tans += b\n\t\t\t\t}\n\t\t\t} else if c[ri] == 2 && c[i] != 2 {\n\t\t\t\tif c[i] == 0 {\n\t\t\t\t\tans += a\n\t\t\t\t} else {\n\t\t\t\t\tans += b\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tans += (min_price * 2)\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "595f0e562ddb7b22bb8c8c9e5c0d0f30", "src_uid": "af07223819aeb5bd6ded4340c472b2b6", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"io\"\n\t\"strings\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"os\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tr := bufio.NewReaderSize(os.Stdin, 1024*1024)\n\tdims := readInts(r, 3)\n\tn := dims[0]\n\tprices := [2]int{dims[1], dims[2]}\n\n\tif n == 0 {\n\t\tfmt.Print(0)\n\t\treturn\n\t}\n\n\tminP := 0\n\tif prices[0] < prices[1] {\n\t\tminP = prices[0]\n\t} else {\n\t\tminP = prices[1]\n\t}\n\n\tcolors := readInts(r, n)\n\n\texp := 0\n\tfor i := 0; i <= (len(colors) - 1) / 2; i++ {\n\t\tcol := colors[i]\n\t\tcontI := len(colors) - 1 - i\n\t\tcontCol := colors[contI]\n\t\tif col == 2 && contCol == 2 {\n\t\t\texp += minP\n\t\t\tif i != contI {\n\t\t\t\texp += minP\n\t\t\t}\n\t\t} else if col == 2 {\n\t\t\texp += prices[contCol]\n\t\t} else if contCol == 2 {\n\t\t\texp += prices[col]\n\t\t} else if contCol != col {\n\t\t\texp = -1\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Print(exp)\n}\n\nfunc readInts(reader *bufio.Reader, n int) []int {\n\ttmpInts := strings.Split(readLine(reader), \" \")\n\n\tvar result []int\n\tfor i := 0; i < n; i++ {\n\t\ttmpInt, err := strconv.ParseInt(tmpInts[i], 10, 64)\n\t\tcheckError(err)\n\t\tresult = append(result, int(tmpInt))\n\t}\n\treturn result\n}\n\nfunc readString(reader *bufio.Reader, l int) string {\n\tsTemp := readLine(reader)\n\tif len(sTemp) < l {\n\t\tl = len(sTemp)\n\t}\n\treturn sTemp[:l]\n}\n\nfunc readLine(reader *bufio.Reader) string {\n\tstr, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\n\treturn strings.TrimRight(string(str), \"\\r\\n\")\n}\n\nfunc checkError(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "f4fab46ce6f3851cd7140a18d48a8ce4", "src_uid": "af07223819aeb5bd6ded4340c472b2b6", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF16C(in io.Reader, out io.Writer) {\n\tgcd := func(a, b int) int {\n\t\tfor a != 0 {\n\t\t\ta, b = b%a, a\n\t\t}\n\t\treturn b\n\t}\n\tvar a, b, x, y int\n\tFscan(in, &a, &b, &x, &y)\n\tg := gcd(x, y)\n\tx /= g\n\ty /= g\n\tk := a / x\n\tif b/y < k {\n\t\tk = b / y\n\t}\n\tif k > 0 {\n\t\tFprint(out, x*k, y*k)\n\t} else {\n\t\tFprint(out, 0, 0)\n\t}\n}\n\nfunc main() { CF16C(os.Stdin, os.Stdout) }\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "fa007cf18b866ab0cfa6861e68db1bfd", "src_uid": "97999cd7c6de79a4e39f56a41ff59e7a", "difficulty": 1800.0} {"lang": "Go", "source_code": "// https://codeforces.com/contest/16/problem/C\npackage main\n\nimport (\n\t\"fmt\"\n)\n\n// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)\n\nfunc main() {\n\tvar (\n\t\ta, b, x, y int64\n\t)\n\n\tfmt.Scan(&a, &b, &x, &y)\n\tg := gcd(x, y)\n\tx /= g\n\ty /= g\n\n\tl := int64(1)\n\tr := int64(2e9)\n\tfor l < r - 1 {\n\t\tmid := (l + (r - l) / 2)\n\t\ta1, b1 := x*mid, y*mid\n\t\tif a1 <= a && b1 <= b {\n\t\t\tl = mid\n\t\t} else {\n\t\t\tr = mid\n\t\t}\n\t}\n\tr--\n\tif x*r <= a && y*r <= b {\n\t\tfmt.Println(x*r, y*r)\n\t} else {\n\t\tfmt.Println(0, 0)\n\t}\n}\n\nfunc gcd(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t} \n\treturn gcd(b, a % b)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "5030b98cfc9f19fb1259c7db536e7e23", "src_uid": "97999cd7c6de79a4e39f56a41ff59e7a", "difficulty": 1800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scanf(\"%d %d\\n\", &n, &k)\n\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tfor {\n\t\tl := len(a)\n\t\tif l == 0 || (a[0] > k && a[l-1] > k) {\n\t\t\tbreak\n\t\t}\n\n\t\tif a[0] <= k {\n\t\t\ta = a[1:]\n\t\t}\n\n\t\tl = len(a)\n\t\tif l > 0 && a[l-1] <= k {\n\t\t\ta = a[:l-1]\n\t\t}\n\t}\n\n\tfmt.Println(n - len(a))\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "5d0c39cec9d3eca45e2dc9893c857bb7", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "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\tN := io.NextInt()\n\tK := io.NextInt()\n\tA := io.NextIntArray(N)\n\n\tcnt := 0\n\tfor len(A) > 0 && A[0] <= K {\n\t\tcnt++\n\t\tA = A[1:]\n\t}\n\tfor len(A) > 0 && A[len(A)-1] <= K {\n\t\tcnt++\n\t\tA = A[:len(A)-1]\n\t}\n\tio.Println(cnt)\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": "182567f7173c449d894ef40ad36eb303", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bytes\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\nfunc main() {\n\tbs, _ := ioutil.ReadAll(os.Stdin)\n\treader := bytes.NewBuffer(bs)\n\n\tvar n, k int\n\tfmt.Fscanf(reader, \"%d %d\\n\", &n, &k)\n\ta := make([]int, n)\n\tfor i := 0;i < n;i ++ {\n\t\tfmt.Fscanf(reader, \"%d \", &a[i])\n\t}\n\tvar left, right int\n\tfor ;left < n && a[left] <= k;left ++ {\n\n\t}\n\tfor ;n - right - 1 > left && a[n - right - 1] <= k; right ++ {\n\n\t}\n\tfmt.Printf(\"%d\", left + right)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "6c4357353aa9b24f66e88336b71edec0", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "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\tN, K := sc.NextInt(), sc.NextInt()\n\tA := sc.NextIntArray()\n\n\ti := 0\n\tfor ; i < N; i++ {\n\t\tif A[i] > K {\n\t\t\tbreak\n\t\t}\n\t}\n\tj := N - 1\n\tfor ; j > i; j-- {\n\t\tif A[j] > K {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(i + N - 1 - j)\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": "fc6daf2e8e6fd3341372067741fc84e3", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "difficulty": 800.0} {"lang": "Go", "source_code": "// cf999a project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, s int\n\tfmt.Scan(&n, &s)\n\tm := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&m[i])\n\t}\n\tc := 0\n\tl, r := 0, n-1\n\tfor i := 0; i < n && l <= r; i++ {\n\n\t\tif m[l] <= s {\n\t\t\tc++\n\t\t\tl++\n\t\t}\n\t\tif m[r] <= s && l < r {\n\t\t\tc++\n\t\t\tr--\n\t\t}\n\n\t}\n\tfmt.Println(c)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "e4ba8bda0883fac5799517688534bfb3", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "difficulty": 800.0} {"lang": "Go", "source_code": "//Nishant Arora\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n\nfunc main() {\n\t\n\n\tin := bufio.NewReader(os.Stdin)\n\tvar n,k,p int\n\tans := 0\n \tfmt.Fscanf(in, \"%d\", &n)\t\n \tfmt.Fscanf(in, \"%d\\n\", &k)\n// \tfmt.Println(n)\n// \tfmt.Println(k)\n \tvar arr [105]int\n \tfor i := 0; i < n; i++ {\n\t \tfmt.Fscanf(in, \"%d\", &arr[i])\n\t \t// fmt.Println(arr[i])\n\n \t}\n \tfor i := 0; i < n; i++ {\n \t\tif(arr[i] <= k) {\n \t\t\tans++\n \t\t\tp = i\n \t\t} else {\n \t\t\tp = i\n \t\t\tbreak\n \t\t}\n \t}\n// \tfmt.Println(ans)\n // fmt.Println(p)\n \tfor i := n-1 ; i > p ; i-- {\n \t\tif(arr[i] <= k) {\n \t\t\tans++\n \t\t} else {\n \t\t\tbreak\n \t\t}\n \t}\t\n\n \tfmt.Println(ans)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "9dde808fccf9aaa21a9b359f0bc0f00e", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k, l int\n\tfmt.Scan(&n, &k)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\tfor len(a) > 0 && a[0] <= k {\n\t\tl++\n\t\ta = a[1:]\n\t}\n\tfor len(a) > 0 && a[len(a)-1] <= k {\n\t\ta = a[0 : len(a)-1]\n\t\tl++\n\t}\n\tfmt.Println(l)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "0961e2e5b642fd07d526763a7c308ee1", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\tex := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&ex[i])\n\t}\n\tans := 0\n\tfor i, j := 0, n-1; i <= j && (ex[i] <= k || ex[j] <= k) ; {\n\t\tif ex[i] <= k {\n\t\t\ti++\n\t\t\tans++\n\t\t\tcontinue\n\t\t}\n\t\tif ex[j] <= k {\n\t\t\tans++\n\t\t\tj--\n\t\t}\n\t}\n\tfmt.Print(ans)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "43ca2a1172732bda932eaf2f28d9180a", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar k int\n\tfmt.Scan(&n, &k)\n\tvar data = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&data[i])\n\t}\n\n\tvar cnt = 0\n\tfor i := 0; i < n; i++ {\n\t\tif data[i] > k {\n\t\t\tbreak\n\t\t} else {\n\t\t\tcnt++\n\t\t}\n\n\t}\n\n\tfor i := n - 1; i >= 0; i-- {\n\t\tif data[i] > k {\n\t\t\tbreak\n\t\t} else {\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tif cnt > n {\n\t\tcnt /= 2\n\t}\n\tfmt.Println(cnt)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "701fda7fae141cd31015b25d3e322a92", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n,&k)\n\ta := make([]int,n)\n\tfor i:=0;i=0;i-- {\n\t\t\tif a[i]<=k {\n\t\t\t\tr++\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Print(r)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "25d534d56ff72106aee57cde473dde56", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "difficulty": 800.0} {"lang": "Go", "source_code": "// cf999a project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, s int\n\tfmt.Scan(&n, &s)\n\tm := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&m[i])\n\t}\n\tc := 0\n\tl, r := 0, n-1\n\tfor i := 0; i < n && l < r; i++ {\n\n\t\tif m[l] <= s {\n\t\t\tc++\n\t\t\tl++\n\t\t}\n\t\tif m[r] <= s && l < r {\n\t\t\tc++\n\t\t\tr--\n\t\t}\n\n\t}\n\tfmt.Println(c)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "778641d46d6d3aef0a2d5bb14afe3f6d", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "difficulty": 800.0} {"lang": "Go", "source_code": "// cf999a project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, s int\n\tfmt.Scan(&n, &s)\n\tm := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&m[i])\n\t}\n\tc := 0\n\tl, r := 0, n-1\n\tfor i := 0; i < n && l < r; i++ {\n\n\t\tif m[l] <= s {\n\t\t\tc++\n\t\t\tl++\n\t\t}\n\t\tif m[r] <= s {\n\t\t\tc++\n\t\t\tr--\n\t\t}\n\n\t}\n\tfmt.Println(c)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "6028bba30ac7dbb4d516b4dbb198dc9a", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "difficulty": 800.0} {"lang": "Go", "source_code": "// cf999a project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, s int\n\tfmt.Scan(&n, &s)\n\tm := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&m[i])\n\t}\n\tc := 0\n\tl, r := 0, n-1\n\tfor i := 0; i < n && l <= r; i++ {\n\n\t\tif m[l] <= s {\n\t\t\tc++\n\t\t\tl++\n\t\t}\n\t\tif m[r] <= s {\n\t\t\tc++\n\t\t\tr--\n\t\t}\n\n\t}\n\tfmt.Println(c)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "e399745e242c8b3083985570e415243a", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc cube(x int) int64 {\n\treturn int64(x) * int64(x) * int64(x)\n}\n\nfunc foo(n int64) int64 {\n\tvar ans int64\n\tfor k := 2; ; k++ {\n\t\tx := n / cube(k)\n\t\tif x == 0 {\n\t\t\tbreak\n\t\t}\n\t\tans += x\n\t}\n\treturn ans\n}\n\n// najmniejszy argument, dla ktorego f(arg) zwraca prawde\n// funkcja logiczna powinna byc niemalejaca\nfunc bin_search(f func(int64) bool, lo, up, eps int64) int64 {\n\tup++\n\tcnt := up - lo\n\tvar mid, step int64\n\tfor cnt >= eps {\n\t\tstep = cnt / 2\n\t\tmid = lo + step\n\t\tif !f(mid) {\n\t\t\tlo = mid + eps\n\t\t\tcnt -= step + eps\n\t\t} else {\n\t\t\tcnt = step\n\t\t}\n\t}\n\treturn lo\n}\n\nfunc main() {\n\tm := int64(getInt())\n\tmx := int64(4949100894494448)\n\tx := func(n int64) bool {\n\t\treturn foo(n) >= m\n\t}\n\n\tp := bin_search(x, 1, mx, 1)\n\n\tif foo(p) != m {\n\t\tp = -1\n\t}\n\n\tfmt.Println(p)\n}\n\ntype Input struct {\n\t*bufio.Scanner\n}\n\nvar globalInput = wrapStdin()\n\nfunc wrapStdin() Input {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\treturn Input{Scanner: sc}\n}\nfunc getInt() int {\n\tglobalInput.Scan()\n\tx, _ := strconv.Atoi(globalInput.Text())\n\treturn x\n}\nfunc getIntOk() (int, bool) {\n\tok := globalInput.Scan()\n\tx, _ := strconv.Atoi(globalInput.Text())\n\treturn x, ok\n}\nfunc getNint(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tv[i] = getInt()\n\t}\n\treturn v\n}\nfunc getVint(v []int) bool {\n\tvar ok bool\n\tfor i := 0; i < len(v); i++ {\n\t\tv[i], ok = getIntOk()\n\t}\n\treturn ok\n}\nfunc getWord() string {\n\tglobalInput.Scan()\n\treturn globalInput.Text()\n}\nfunc getWordOk() (string, bool) {\n\tok := globalInput.Scan()\n\treturn globalInput.Text(), ok\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc min64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc minStr(a, b string) string {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc maxStr(a, b string) string {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc remin(a *int, b int) bool {\n\tif b < *a {\n\t\t*a = b\n\t\treturn true\n\t}\n\treturn false\n}\nfunc remax(a *int, b int) bool {\n\tif b > *a {\n\t\t*a = b\n\t\treturn true\n\t}\n\treturn false\n}\nfunc remin64(a *int64, b int64) bool {\n\tif b < *a {\n\t\t*a = b\n\t\treturn true\n\t}\n\treturn false\n}\nfunc remax64(a *int64, b int64) bool {\n\tif b > *a {\n\t\t*a = b\n\t\treturn true\n\t}\n\treturn false\n}\nfunc reminStr(a *string, b string) bool {\n\tif b < *a {\n\t\t*a = b\n\t\treturn true\n\t}\n\treturn false\n}\nfunc remaxStr(a *string, b string) bool {\n\tif b > *a {\n\t\t*a = b\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\nfunc abs64(x int64) int64 {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\ntype (\n\tFLess func(i, j int) bool\n\tFSwap func(i, j int)\n\twrapSort struct {\n\t\tLength int\n\t\tFLess\n\t\tFSwap\n\t}\n)\n\nfunc (w *wrapSort) Len() int { return w.Length }\nfunc (w *wrapSort) Less(i, j int) bool { return w.FLess(i, j) }\nfunc (w *wrapSort) Swap(i, j int) { w.FSwap(i, j) }\nfunc wsort(length int, fless func(i, j int) bool, fswap func(i, j int)) {\n\tsort.Sort(&wrapSort{length, fless, fswap})\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "28d1547cb790b3c86a76dd03295bf66f", "src_uid": "602deaad5c66e264997249457d555129", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc getCnt(n int64) int64 {\n var sum int64\n for k:= int64(2); k*k*k <= n; k++ {\n sum += n/(k*k*k)\n }\n return sum\n}\n\nfunc main() {\n var m int64\n fmt.Scan(&m)\n\n var lo, hi int64\n lo = 1\n hi = 100000000000\n for lo+1 < hi {\n mid := (lo+hi)/2\n sum := int64(0)\n for k:= int64(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": false, "code_uid": "57f75652fd80a08d6d231e46b0ea370a", "src_uid": "602deaad5c66e264997249457d555129", "difficulty": 1700.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": "3e2e4c79e661f63bf0f56d2034388209", "src_uid": "602deaad5c66e264997249457d555129", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc getCnt(n int64) int64 {\n var sum int64\n for k:= int64(2); k*k*k <= n; k++ {\n sum += n/(k*k*k)\n }\n return sum\n}\n\nfunc main() {\n var m int64\n fmt.Scan(&m)\n\n var lo, hi int64\n lo = 1\n hi = 9223372036854775807\n for lo+1 < hi {\n mid := (lo+hi)/2\n sum := int64(0)\n for k:= int64(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": false, "code_uid": "6be70979d629e31109a6145949c1e77b", "src_uid": "602deaad5c66e264997249457d555129", "difficulty": 1700.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 CF106C(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tmax := func(a, b int) int {\n\t\tif a > b {\n\t\t\treturn a\n\t\t}\n\t\treturn b\n\t}\n\n\tvar maxW, n, a, b int\n\tFscan(in, &maxW, &n)\n\tn++\n\tweights := make([]int, n)\n\tvalues := make([]int, n)\n\tstocks := make([]int, n)\n\tFscan(in, &weights[0], &values[0])\n\tstocks[0] = maxW / weights[0]\n\tfor i := 1; i < n; i++ {\n\t\tFscan(in, &a, &b, &weights[i], &values[i])\n\t\tstocks[i] = a / b\n\t}\n\n\tdp := make([][]int, n+1)\n\tfor i := range dp {\n\t\tdp[i] = make([]int, maxW+1)\n\t}\n\tfor i, vi := range values {\n\t\twi := weights[i]\n\t\tfor j := range dp[i] {\n\t\t\tfor k := 0; k <= stocks[i] && k*wi <= j; k++ {\n\t\t\t\tdp[i+1][j] = max(dp[i+1][j], dp[i][j-k*wi]+vi*k)\n\t\t\t}\n\t\t}\n\t}\n\tFprint(_w, dp[n][maxW])\n}\n\nfunc main() { CF106C(os.Stdin, os.Stdout) }\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "f1015ea8d47a7c8ddc1912b5e831e9f8", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "difficulty": 1700.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 CF106C(_r io.Reader, out io.Writer) {\n\tin := bufio.NewReader(_r)\n\tmin := func(a, b int) int {\n\t\tif a < b {\n\t\t\treturn a\n\t\t}\n\t\treturn b\n\t}\n\tmax := func(a, b int) int {\n\t\tif a > b {\n\t\t\treturn a\n\t\t}\n\t\treturn b\n\t}\n\n\tvar maxW, n, a, b int\n\tFscan(in, &maxW, &n)\n\tn++\n\tweights := make([]int, n)\n\tvalues := make([]int, n)\n\tstocks := make([]int, n)\n\tFscan(in, &weights[0], &values[0])\n\tstocks[0] = maxW / weights[0]\n\tfor i := 1; i < n; i++ {\n\t\tFscan(in, &a, &b, &weights[i], &values[i])\n\t\tstocks[i] = a / b\n\t}\n\n\tdp := make([]int, maxW+1)\n\tfor i, v := range values {\n\t\tnum, w := stocks[i], weights[i]\n\t\tfor k := 1; num > 0; k <<= 1 {\n\t\t\tK := min(k, num)\n\t\t\tfor j := maxW; j >= K*w; j-- {\n\t\t\t\tdp[j] = max(dp[j], dp[j-K*w]+K*v)\n\t\t\t}\n\t\t\tnum -= K\n\t\t}\n\t}\n\tFprint(out, dp[maxW])\n}\n\nfunc main() { CF106C(os.Stdin, os.Stdout) }\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "b58f1f0cbdbc83a11ffd71ad0a8ab2bd", "src_uid": "4e166b8b44427b1227e0f811161d3a6f", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nvar mmap = make(map[uint8][]string)\n\nfunc recur(str string, l int) int {\n\tif l == 0 {\n\t\treturn 1\n\t}\n\tif l < 0 {\n\t\treturn 0\n\t}\n\tret := 0\n\tfor _, s := range mmap[str[0]] {\n\t\tret += recur(s+str[1:], l-1)\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tvar n, q int\n\tfmt.Scanf(\"%d %d\\n\", &n, &q)\n\tfor i := 0; i < q; i++ {\n\t\tvar k, v string\n\t\tfmt.Scanf(\"%s %s\\n\", &k, &v)\n\t\tks := v[0]\n\t\tmmap[ks] = append(mmap[ks], k)\n\t}\n\tfmt.Print(recur(\"a\", n-1))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "129dd900c24e3eb0ff99b62a086c0118", "src_uid": "c42abec29bfd17de3f43385fa6bea534", "difficulty": 1300.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"os\"\n\t\"fmt\"\n)\n\nfunc winpos(table [][]byte, startx, starty, deltax, deltay int) bool {\n\tif startx + 4*deltax >= 10 || starty + 4*deltay >= 10 {\n\t\treturn false\n\t}\n\t\n\tok := true\n\tx, y := startx, starty\n\ti := 0\n\tfor ok && i < 5 {\n\t\tif table[x][y]!='X' {\n\t\t\tok = false\n\t\t\tbreak ;\n\t\t}\n\t\t\n\t\tx+=deltax\n\t\ty+=deltay\n\t\t\n\t\ti++\n\t}\n\t\n\treturn ok\n}\n\nfunc win(table [][]byte) bool {\n\tfor i := 0; i < 10; i++ {\n\t\tfor j := 0;j < 10; j++ {\n\t\t\tif winpos(table, i, j, 0, 1) || winpos(table, i, j, 1, 0) || winpos(table, i, j, 1, 1) {\n\t\t\t\treturn true \n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn false\n}\n\nfunc main() {\n\ttable := make([][]byte, 10)\n\tfor i := 0; i < 10; i++ {\n\t\tfmt.Scanf(\"%s\", &table[i])\n\t}\n\t\n\tfor i := 0; i < 10; i++ {\n\t\tfor j := 0;j < 10; j++ {\n\t\t\tif table[i][j]=='.' {\n\t\t\t\ttable[i][j]='X'\n\t\t\t\tif win(table) {\n\t\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\t\tos.Exit(0)\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttable[i][j]='.'\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfmt.Println(\"NO\")\n\tos.Exit(0)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "1eb471aa33defdbfe506465e4bd1c87f", "src_uid": "d5541028a2753c758322c440bdbf9ec6", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"os\"\n\t\"fmt\"\n\t\"bufio\"\n)\n\nfunc winpos(table [][]byte, sx, sy, dx, dy int) bool {\n\tx, y := sx, sy\n\ti := 0\n\tfor i < 5 {\n\t if x>=10 || y>=10 {\n\t return false\n\t }\n\t \n\t\tif table[x][y]!='X' {\n\t\t\treturn false\n\t\t}\n\t\t\n\t\tx += dx\n\t\ty += dy\n\t\t\n\t\ti++\n\t}\n\t\n\treturn true\n}\n\nfunc win(table [][]byte) bool {\n\tfor i := 0; i < 10; i++ {\n\t\tfor j := 0;j < 10; j++ {\n\t\t\tif winpos(table, i, j, 0, 1) || winpos(table, i, j, 1, 0) || winpos(table, i, j, 1, 1) {\n\t\t\t\treturn true \n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn false\n}\n\nfunc main() {\n stdin := bufio.NewReader(os.Stdin)\n\ttable := make([][]byte, 10)\n\tfor i := 0; i < 10; i++ {\n\t\ttable[i], _, _ = stdin.ReadLine()\n\t\t\n\t}\n\t\n\tfor i := 0; i < 10; i++ {\n\t\tfor j := 0;j < 10; j++ {\n\t\t\tif table[i][j]=='.' {\n\t\t\t\ttable[i][j]='X'\n\t\t\t\tif win(table) {\n\t\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\t\tos.Exit(0)\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttable[i][j]='.'\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfmt.Println(\"NO\")\n\tos.Exit(0)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "21306f99f84d6490b33449c4c3bd7b5a", "src_uid": "d5541028a2753c758322c440bdbf9ec6", "difficulty": 1600.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\tn := len(coef)\n\tfor i := 0; i < n; i++ {\n\t\tc := coef[i]\n\t\tif c == -1 {\n\t\t\tfor j := i + 1; j < n; 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\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\ti--\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": "123fbfd1bac43c19e8094cdb0cbd1d66", "src_uid": "a74adcf0314692f8ac95f54d165d9582", "difficulty": 1900.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\tn := len(coef)\n\tfor i := 0; i < n-1; {\n\t\tc := coef[i]\n\t\tif c == -1 {\n\t\t\tfor j := i + 1; j < n-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\ti++\n\t\t} else if 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}\n\tFprint(out, \"YES\")\n}\n\nfunc main() {\n\tSol552C(os.Stdin, os.Stdout)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "7e0deb6f437cec55e8a9a035862f1dc0", "src_uid": "a74adcf0314692f8ac95f54d165d9582", "difficulty": 1900.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\tn := len(coef)\n\tfor i := 0; i < n; {\n\t\tc := coef[i]\n\t\tif c == -1 {\n\t\t\tfor j := i + 1; j < n; 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\ti++\n\t\t} else if 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}\n\tFprint(out, \"YES\")\n}\n\nfunc main() {\n\tSol552C(os.Stdin, os.Stdout)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "c414b3d28669d2a190bb79d4385af390", "src_uid": "a74adcf0314692f8ac95f54d165d9582", "difficulty": 1900.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc check(x int64, a int64, b int64, y int64) bool {\n if a == 0 {\n return x == y\n } else {\n var c = a/b\n return x == y || \n check(x-c,c,b,y) || \n check(x,c,b,y) || \n check(x+c,c,b,y)\n }\n} \n\nfunc main() {\n \n var w,m int64\n fmt.Scanf(\"%v %v\\n\", &w, &m)\n \n if w <= 3 { \n fmt.Printf(\"YES\\n\")\n } else {\n var i,x,c int64 = 1,1,0\n for x < m && c <= 100 {\n i *= w\n x += i\n c++\n }\n if check(i,i,w,m) {\n fmt.Printf(\"YES\\n\") \n } else {\n fmt.Printf(\"NO\\n\")\n }\n }\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "634391c321badef348d26b4821d9aeec", "src_uid": "a74adcf0314692f8ac95f54d165d9582", "difficulty": 1900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"os\"\n)\n\nvar in = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\n\tdefer out.Flush()\n\tin.Split(bufio.ScanWords)\n\tvar w, m = NextInt64(), NextInt64()\n\tif w == 2 {\n\t\tfmt.Fprintln(out, \"YES\")\n\t\treturn\n\t}\n\ta := make([]int64, 0)\n\tvar p int64 = 1\n\tfor p <= m {\n\t\ta = append(a, p)\n\t\tp *= w\n\t}\n\n\t// fmt.Fprintln(out, a)\n\n\tvar n int = len(a)\n\tfor mask := 0; mask < (1 << uint(n)); mask++ {\n\t\tvar s int64 = m;\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif ((mask >> uint(i)) & 1) > 0 {\n\t\t\t\ts += a[i]\n\t\t\t}\n\t\t}\n\n\t\tvar j uint = 0\n\t\tvar ok bool = true\n\t\tfor s > 0 {\n\t\t\tvar rem int64 = s % w\n\t\t\ts /= w\n\t\t\tif rem != 0 && rem != 1 {\n\t\t\t\tok = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif rem == 1 && ((mask >> uint(j)) & 1) > 0 {\n\t\t\t\tok = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tj++\n\t\t}\n\t\tif ok {\n\t\t\tfmt.Fprintln(out, \"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Fprintln(out, \"NO\")\n}\n\nfunc Next() string{\n\tif !in.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn in.Text()\n}\n\nfunc NextInt() int{\n\tret, _ := strconv.Atoi(Next())\n\treturn ret\n}\n\nfunc NextInt64() int64 {\n\tret, _ := strconv.ParseInt(Next(), 10, 64)\n\treturn ret\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "fb717b00344773c69b47889f0f0e1af3", "src_uid": "a74adcf0314692f8ac95f54d165d9582", "difficulty": 1900.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 == w-1 {\n\t\t\tc = -1\n\t\t}\n\t\tcoef = append(coef, c)\n\t}\n\tn := len(coef)\n\tfor i := 0; i < n; i++ {\n\t\tc := coef[i]\n\t\tif c == -1 {\n\t\t\tfor j := i + 1; j < n; 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\tif c < w-1 {\n\t\t\t\tFprint(out, \"NO\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcoef[i] = -1\n\t\t\ti--\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": "01bdd05fd4a86431ad4f680703b0dda8", "src_uid": "a74adcf0314692f8ac95f54d165d9582", "difficulty": 1900.0} {"lang": "Go", "source_code": "package main\n\nimport(\n\t\"fmt\"\n\t// \"sort\"\n\t// \"math\"\n\t// \"strconv\"\n\t// \"strings\"\n\t\"os\"\n\t\"bufio\"\n)\n\nfunc min(a,b int) int{\n\tif ab{\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc toInt(buf []byte) (o int) {\n\tfor _, v := range buf {\n\t\to = o*10 + int(v-'0')\n\t}\n\treturn\n}\n\ntype pair struct {\n\tfirst int\n\tsecond int\n}\n\ntype pairs []pair\n\nfunc (a pairs) Len() int {return len(a)}\nfunc (a pairs) Swap(i,j int) {a[i], a[j] = a[j], a[i]}\nfunc (a pairs) Less(i,j int) bool {\n\treturn a[i].first < a[j].first\n\tif a[i].first > a[j].first {\n\t\treturn false\n\t}\n\treturn a[i].second <= a[j].second\n}\n\n\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\t//in, _ := os.Open(\"a.txt\")\n\tvar n int64\n\tvar allNines = true\n\tfmt.Fscanf(in, \"%d\", &n)\n\tif n < 5 {\n\t\tfmt.Println(n * (n - 1) / 2)\n\t\tos.Exit(0)\n\t}\n\tsum := n + n - 1\n\tcnt := 0\n\tfor ; sum > 0; sum /= 10 {\n\t\tx := sum % 10\n\t\tif x != 9 {\n\t\t\tallNines = false\n\t\t}\n\t\tcnt++\n\t}\n\tif allNines {\n\t\tfmt.Println(1)\n\t\tos.Exit(0)\n\t}\n\tnumOfNines := cnt - 1\n\tvar deg int64 = 1\n\tfor i := 1;i <= numOfNines; i++ {\n\t\tdeg = deg * 10\n\t}\n\tmd := n % deg\n\tright := md\n\tmid := deg / 2 - 1\n\tless := n / deg\n\tmore := less + 1\n\tif right == 0 {\n\t\tfmt.Println(less * less * (mid + 1))\n\t\tos.Exit(0)\n\t}\n\tvar ans int64\n\tif right != deg - 1 {\n\t\tans = less * less\n\t} else {\n\t\tans = less * more\n\t}\n\tif right <= mid {\n\t\tans += right * more * less\n\t\tans += (mid - right) * less * less\n\t} else {\n\t\textra := right - mid - 1\n\t\tans += extra * more * more\n\t\tans += (mid - extra) * more * less\n\t}\n\tfmt.Println(ans)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "d2a3b8c6a285c9a34a67443be70d9a84", "src_uid": "c20744c44269ae0779c5f549afd2e3f2", "difficulty": 1800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n//a,b <=n && a+b==x\nfunc count(n, x int64) (ans int64) {\n\tif n >= x {\n\t\tn = x - 1\n\t}\n\tans = n - x/2\n\tif x%2 == 0 {\n\t\tans++\n\t}\n\tif ans < 0 {\n\t\tans = 0\n\t}\n\treturn\n}\n\nfunc main() {\n\tvar n int64\n\tfmt.Scan(&n)\n\tif n < 5 {\n\t\tfmt.Println(n * (n - 1) / 2)\n\t\treturn\n\t}\n\tvar ans int64\n\tvar max9 int64 = 9\n\tfor max9 < n {\n\t\tmax9 = max9*10 + 9\n\t}\n\tif max9/2+1 <= n {\n\t\tfmt.Println(count(n, max9))\n\t\treturn\n\t}\n\tsmax9 := fmt.Sprint(max9)\n\tfor i := 0; i < len(smax9); i++ {\n\t\ttmp := []byte(smax9)\n\t\tfor j := 0; j < 9; j++ {\n\t\t\ttmp[i] = byte(j) + '0'\n\t\t\tx, _ := strconv.ParseInt(string(tmp), 10, 64)\n\t\t\tans += count(n, x)\n\t\t\tfmt.Println(count(n, x), x)\n\t\t\ttmp[i] = '9'\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "c1e70023512e1222bb8bca712c36d84d", "src_uid": "c20744c44269ae0779c5f549afd2e3f2", "difficulty": 1800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n//a,b <=n && a+b==x\nfunc count(n, x int64) (ans int64) {\n\tif n >= x {\n\t\tn = x - 1\n\t}\n\tans = n - x/2\n\tif x%2 == 0 {\n\t\tans++\n\t}\n\tif ans < 0 {\n\t\tans = 0\n\t}\n\treturn\n}\n\nfunc main() {\n\tvar n int64\n\tfmt.Scan(&n)\n\tvar ans int64\n\tvar max9 int64 = 9\n\tfor max9 < n {\n\t\tmax9 = max9*10 + 9\n\t}\n\tif max9/2+1 <= n {\n\t\tfmt.Println(count(n, max9))\n\t\treturn\n\t}\n\tsmax9 := fmt.Sprint(max9)\n\tfor i := 0; i < len(smax9); i++ {\n\t\ttmp := []byte(smax9)\n\t\tfor j := 0; j < 9; j++ {\n\t\t\ttmp[i] = byte(j) + '0'\n\t\t\tx, _ := strconv.ParseInt(string(tmp), 10, 64)\n\t\t\tans += count(n, x)\n\t\t\t//fmt.Println(count(n, x), x)\n\t\t\ttmp[i] = '9'\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "0999af807f5a39f6ef6d1fe90e1acb37", "src_uid": "c20744c44269ae0779c5f549afd2e3f2", "difficulty": 1800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n//a,b <=n && a+b==x\nfunc count(n, x int64) (ans int64) {\n\tif n >= x {\n\t\tn = x - 1\n\t}\n\tans = n - x/2\n\tif x%2 == 0 {\n\t\tans++\n\t}\n\tif ans < 0 {\n\t\tans = 0\n\t}\n\treturn\n}\n\nfunc main() {\n\tvar n int64\n\tfmt.Scan(&n)\n\tif n < 5 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tvar ans int64\n\tvar max9 int64 = 9\n\tfor max9 < n {\n\t\tmax9 = max9*10 + 9\n\t}\n\tif max9/2+1 <= n {\n\t\tfmt.Println(count(n, max9))\n\t\treturn\n\t}\n\tsmax9 := fmt.Sprint(max9)\n\tfor i := 0; i < len(smax9); i++ {\n\t\ttmp := []byte(smax9)\n\t\tfor j := 0; j < 9; j++ {\n\t\t\ttmp[i] = byte(j) + '0'\n\t\t\tx, _ := strconv.ParseInt(string(tmp), 10, 64)\n\t\t\tans += count(n, x)\n\t\t\t//fmt.Println(count(n, x), x)\n\t\t\ttmp[i] = '9'\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "ea011580b8b74edfb6421b72ef63f9d4", "src_uid": "c20744c44269ae0779c5f549afd2e3f2", "difficulty": 1800.0} {"lang": "Go", "source_code": "package main\n\nimport(\n\t\"fmt\"\n\t// \"sort\"\n\t// \"math\"\n\t// \"strconv\"\n\t// \"strings\"\n\t\"os\"\n\t\"bufio\"\n)\n\nfunc min(a,b int) int{\n\tif ab{\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc toInt(buf []byte) (o int) {\n\tfor _, v := range buf {\n\t\to = o*10 + int(v-'0')\n\t}\n\treturn\n}\n\ntype pair struct {\n\tfirst int\n\tsecond int\n}\n\ntype pairs []pair\n\nfunc (a pairs) Len() int {return len(a)}\nfunc (a pairs) Swap(i,j int) {a[i], a[j] = a[j], a[i]}\nfunc (a pairs) Less(i,j int) bool {\n\treturn a[i].first < a[j].first\n\tif a[i].first > a[j].first {\n\t\treturn false\n\t}\n\treturn a[i].second <= a[j].second\n}\n\n\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\t//in, _ := os.Open(\"a.txt\")\n\tvar n int64\n\tvar allNines = true\n\tfmt.Fscanf(in, \"%d\", &n)\n\tsum := n + n - 1\n\tcnt := 0\n\tfor ; sum > 0; sum /= 10 {\n\t\tx := sum % 10\n\t\tif x != 9 {\n\t\t\tallNines = false\n\t\t}\n\t\tcnt++\n\t}\n\tif allNines {\n\t\tfmt.Println(1)\n\t\tos.Exit(0)\n\t}\n\tnumOfNines := cnt - 1\n\tvar deg int64 = 1\n\tfor i := 1;i <= numOfNines; i++ {\n\t\tdeg = deg * 10\n\t}\n\tmd := n % deg\n\tright := md\n\tmid := deg / 2 - 1\n\tless := n / deg\n\tmore := less + 1\n\tif right == 0 {\n\t\tfmt.Println(less * less * (mid + 1))\n\t\tos.Exit(0)\n\t}\n\tvar ans int64\n\tif right != deg - 1 {\n\t\tans = less * less\n\t} else {\n\t\tans = less * more\n\t}\n\tif right <= mid {\n\t\tans += right * more * less\n\t\tans += (mid - right) * less * less\n\t} else {\n\t\textra := right - mid\n\t\tans += extra * more * more\n\t\tans += (mid - extra) * more * less\n\t}\n\tif n == deg - 1 {\n\t\tans--\n\t}\n\tfmt.Println(ans)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "da133a0cc04e76615c6ea2360f30e240", "src_uid": "c20744c44269ae0779c5f549afd2e3f2", "difficulty": 1800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n//a,b <=n && a+b==x\nfunc count(n, x int64) (ans int64) {\n\tif n >= x {\n\t\tn = x - 1\n\t}\n\tans = n - x/2\n\tif x%2 == 0 {\n\t\tans++\n\t}\n\tif ans < 0 {\n\t\tans = 0\n\t}\n\treturn\n}\n\nfunc main() {\n\tvar n int64\n\tfmt.Scan(&n)\n\tif n < 5 {\n\t\tfmt.Println(n * (n - 1) / 2)\n\t\treturn\n\t}\n\tvar ans int64\n\tvar max9 int64 = 9\n\tfor max9 < n {\n\t\tmax9 = max9*10 + 9\n\t}\n\tif max9/2+1 <= n {\n\t\tfmt.Println(count(n, max9))\n\t\treturn\n\t}\n\tsmax9 := fmt.Sprint(max9)\n\t//for i := 0; i < len(smax9); i++ {\n\ttmp := []byte(smax9)\n\tfor j := 0; j < 9; j++ {\n\t\ttmp[0] = byte(j) + '0'\n\t\tx, _ := strconv.ParseInt(string(tmp), 10, 64)\n\t\tans += count(n, x)\n\t\t//fmt.Println(count(n, x), x)\n\t\ttmp[0] = '9'\n\t}\n\t//}\n\tfmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "220f0ac50b14279a532dacafeeb2dc30", "src_uid": "c20744c44269ae0779c5f549afd2e3f2", "difficulty": 1800.0} {"lang": "Go", "source_code": "package main\n\nimport(\n\t\"fmt\"\n\t// \"sort\"\n\t// \"math\"\n\t// \"strconv\"\n\t// \"strings\"\n\t\"os\"\n\t\"bufio\"\n)\n\nfunc min(a,b int) int{\n\tif ab{\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc toInt(buf []byte) (o int) {\n\tfor _, v := range buf {\n\t\to = o*10 + int(v-'0')\n\t}\n\treturn\n}\n\ntype pair struct {\n\tfirst int\n\tsecond int\n}\n\ntype pairs []pair\n\nfunc (a pairs) Len() int {return len(a)}\nfunc (a pairs) Swap(i,j int) {a[i], a[j] = a[j], a[i]}\nfunc (a pairs) Less(i,j int) bool {\n\treturn a[i].first < a[j].first\n\tif a[i].first > a[j].first {\n\t\treturn false\n\t}\n\treturn a[i].second <= a[j].second\n}\n\n\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\t//in, _ := os.Open(\"a.txt\")\n\tvar n int64\n\tvar allNines = true\n\tfmt.Fscanf(in, \"%d\", &n)\n\tif n < 5 {\n\t\tfmt.Println(n * (n - 1) / 2)\n\t\tos.Exit(0)\n\t}\n\tsum := n + n - 1\n\tcnt := 0\n\tfor ; sum > 0; sum /= 10 {\n\t\tx := sum % 10\n\t\tif x != 9 {\n\t\t\tallNines = false\n\t\t}\n\t\tcnt++\n\t}\n\tif allNines {\n\t\tfmt.Println(1)\n\t\tos.Exit(0)\n\t}\n\tnumOfNines := cnt - 1\n\tvar deg int64 = 1\n\tfor i := 1;i <= numOfNines; i++ {\n\t\tdeg = deg * 10\n\t}\n\tmd := n % deg\n\tright := md\n\tmid := deg / 2 - 1\n\tless := n / deg\n\tmore := less + 1\n\tif right == 0 {\n\t\tfmt.Println(less * less * (mid + 1))\n\t\tos.Exit(0)\n\t}\n\tvar ans int64\n\tif right != deg - 1 {\n\t\tans = less * less\n\t} else {\n\t\tans = less * more\n\t}\n\tif right <= mid {\n\t\tans += right * more * less\n\t\tans += (mid - right) * less * less\n\t} else {\n\t\textra := right - mid\n\t\tif right == deg - 1 {\n\t\t\textra--\n\t\t}\n\t\tans += extra * more * more\n\t\tans += (mid - extra) * more * less\n\t}\n\tfmt.Println(ans)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "7a66c0646acade87ac3737816a357fc1", "src_uid": "c20744c44269ae0779c5f549afd2e3f2", "difficulty": 1800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nconst maxn = 51\n\nfunc main() {\n\tvar n, k int64\n\tfmt.Scan(&n, &k)\n\tfib := make([]int64, maxn)\n\tfib[0], fib[1] = 1, 1\n\tfor i := int64(2); i < maxn; i++ {\n\t\tfib[i] = fib[i-1] + fib[i-2]\n\t}\n\tsum := int64(1)\n\tfor i := int64(1); i <= n; i++ {\n\t\tif n-i >= 0 && sum+fib[n-i] <= k {\n\t\t\tsum += fib[n-i]\n\t\t\tfmt.Printf(\"%d %d \", i+1, i)\n\t\t\ti++\n\t\t} else {\n\t\t\tfmt.Printf(\"%d \", i)\n\t\t}\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "85ff768f04abcfb9ae86617b17d61ccb", "src_uid": "e03c6d3bb8cf9119530668765691a346", "difficulty": 1900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\nfunc gcd(a, b int64) int64 {\n\tif a % b == 0 {\n\t\treturn b\n\t} else {\n\t\treturn gcd(b , a % b)\n\t}\n}\n\nfunc main() {\n\tbs, _ := ioutil.ReadAll(os.Stdin)\n\treader := bytes.NewBuffer(bs)\n\n\tvar la, ra, ta, lb, rb, tb int64\n\tfmt.Fscanf(reader, \"%d %d %d\\n\", &la, &ra, &ta)\n\tfmt.Fscanf(reader, \"%d %d %d\", &lb, &rb, &tb)\n\n\tfactor := gcd(ta, tb)\n\n\tvar ans1, ans2 int64\n\n\t// Bob first, Alice after\n\t// (la - lb) + (ka * ta) - (kb * tb) = diff > 0\n\tdiff1 := (la - lb) % factor\n\tif diff1 < 0 {\n\t\tdiff1 += factor\n\t}\n\tif rb - lb + 1 < diff1 {\n\t\tans1 = 0\n\t} else if rb - lb + 1 > diff1 + (ra - la + 1) {\n\t\tans1 = ra - la + 1\n\t} else {\n\t\tans1 = rb - lb + 1 - diff1\n\t}\n\n\tdiff2 := (lb - la) % factor\n\tif diff2 < 0 {\n\t\tdiff2 += factor\n\t}\n\tif ra - la + 1 < diff2 {\n\t\tans2 = 0\n\t} else if ra - la + 1 > diff2 + (rb - lb + 1) {\n\t\tans2 = rb - lb + 1\n\t} else {\n\t\tans2 = ra - la + 1 - diff2\n\t}\n\tif ans1 > ans2 {\n\t\tfmt.Printf(\"%d\", ans1)\n\t} else {\n\t\tfmt.Printf(\"%d\", ans2)\n\t}\n\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "4fbb40709e01ab28cdc13398151b4909", "src_uid": "faa75751c05c3ff919ddd148c6784910", "difficulty": 1900.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 Sol118D(reader io.Reader, writer io.Writer) {\n\tin := bufio.NewReader(reader)\n\tout := bufio.NewWriter(writer)\n\tdefer out.Flush()\n\n\tvar n1, n2, k1, k2 int\n\tFscan(in, &n1, &n2, &k1, &k2)\n\n\tconst mod = 1e8\n\tcache := map[string]int{}\n\tvar f func(left1, left2, c1, c2 int) int\n\tf = func(left1, left2, c1, c2 int) (sum int) {\n\t\tif left1 == 0 {\n\t\t\tif left2+c2 <= k2 {\n\t\t\t\treturn 1\n\t\t\t}\n\t\t\treturn 0\n\t\t}\n\t\tif left2 == 0 {\n\t\t\tif left1+c1 <= k1 {\n\t\t\t\treturn 1\n\t\t\t}\n\t\t\treturn 0\n\t\t}\n\t\thash := Sprintf(\"%d;%d;%d;%d\", left1, left2, c1, c2)\n\t\tif val, ok := cache[hash]; ok {\n\t\t\treturn val\n\t\t}\n\t\tif c1 < k1 {\n\t\t\tsum += f(left1-1, left2, c1+1, 0)\n\t\t}\n\t\tif c2 < k2 {\n\t\t\tsum += f(left1, left2-1, 0, c2+1)\n\t\t}\n\t\tsum %= mod\n\t\tcache[hash] = sum\n\t\treturn\n\t}\n\tFprintln(out, f(n1, n2, 0, 0))\n}\n\nfunc main() {\n\tSol118D(os.Stdin, os.Stdout)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "384b77f0df4ebd258022249199448f36", "src_uid": "63aabef26fe008e4c6fc9336eb038289", "difficulty": 1700.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 Sol118D(reader io.Reader, writer io.Writer) {\n\tin := bufio.NewReader(reader)\n\tout := bufio.NewWriter(writer)\n\tdefer out.Flush()\n\n\tvar n1, n2, k1, k2 int\n\tFscan(in, &n1, &n2, &k1, &k2)\n\n\tconst mod = int64(1e8)\n\tcache := make(map[string]int64, 1e6)\n\tvar f func(left1, left2, c1, c2 int) int64\n\tf = func(left1, left2, c1, c2 int) (sum int64) {\n\t\tif left1 == 0 {\n\t\t\tif left2+c2 <= k2 {\n\t\t\t\treturn 1\n\t\t\t}\n\t\t\treturn 0\n\t\t}\n\t\tif left2 == 0 {\n\t\t\tif left1+c1 <= k1 {\n\t\t\t\treturn 1\n\t\t\t}\n\t\t\treturn 0\n\t\t}\n\t\thash := Sprintf(\"%d;%d;%d;%d\", left1, left2, c1, c2)\n\t\tif val, ok := cache[hash]; ok {\n\t\t\treturn val\n\t\t}\n\t\tif c1 < k1 {\n\t\t\tsum += f(left1-1, left2, c1+1, 0)\n\t\t}\n\t\tif c2 < k2 {\n\t\t\tsum += f(left1, left2-1, 0, c2+1)\n\t\t}\n\t\tsum %= mod\n\t\tcache[hash] = sum\n\t\treturn\n\t}\n\tFprintln(out, f(n1, n2, 0, 0))\n}\n\nfunc main() {\n\tSol118D(os.Stdin, os.Stdout)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "f594bf3d9ba50202e7e7ea2e32ccfc5a", "src_uid": "63aabef26fe008e4c6fc9336eb038289", "difficulty": 1700.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 Sol118D(reader io.Reader, writer io.Writer) {\n\tin := bufio.NewReader(reader)\n\tout := bufio.NewWriter(writer)\n\tdefer out.Flush()\n\n\tvar n1, n2, k1, k2 int\n\tFscan(in, &n1, &n2, &k1, &k2)\n\n\tconst mod = int64(1e8)\n\tcache := map[string]int64{}\n\tvar f func(left1, left2, c1, c2 int) int64\n\tf = func(left1, left2, c1, c2 int) (sum int64) {\n\t\tif left1 == 0 {\n\t\t\tif left2+c2 <= k2 {\n\t\t\t\treturn 1\n\t\t\t}\n\t\t\treturn 0\n\t\t}\n\t\tif left2 == 0 {\n\t\t\tif left1+c1 <= k1 {\n\t\t\t\treturn 1\n\t\t\t}\n\t\t\treturn 0\n\t\t}\n\t\thash := Sprintf(\"%d;%d;%d;%d\", left1, left2, c1, c2)\n\t\tif val, ok := cache[hash]; ok {\n\t\t\treturn val\n\t\t}\n\t\tif c1 < k1 {\n\t\t\tsum += f(left1-1, left2, c1+1, 0)\n\t\t}\n\t\tif c2 < k2 {\n\t\t\tsum += f(left1, left2-1, 0, c2+1)\n\t\t}\n\t\tsum %= mod\n\t\tcache[hash] = sum\n\t\treturn\n\t}\n\tFprintln(out, f(n1, n2, 0, 0))\n}\n\nfunc main() {\n\tSol118D(os.Stdin, os.Stdout)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "2a5c89b3b5a78dfab7e762b032896870", "src_uid": "63aabef26fe008e4c6fc9336eb038289", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"sort\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nconst mod int64 = 1e9 + 7\nfunc A(n, m int) int64 {\n\tif m > n { return 0 }\n\tx := int64(1)\n\tfor i := 0; i < m; i++ {\n\t\tx = x * int64(n-i) % mod\n\t}\n\treturn x\n}\nfunc main() {\n\tvar n, x, p, l, g int\n\tScan(&n, &x, &p)\n\tsort.Search(n, func(m int) bool {\n\t\tif m < p {l++} else if m > p {g++}\n\t\treturn m > p\n\t})\n\tm:=n-1-l-g\n\tPrint(A(x-1,l)*A(n-x,g)%mod*A(m,m)%mod)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "a134e121ffffcebc4f8b43ecc8a99895", "src_uid": "24e2f10463f440affccc2755f4462d8a", "difficulty": 1500.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 run(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\tconst mod int64 = 1e9 + 7 // todo\n\n\tf := func(n, m int) int64 {\n\n\t\tif m > n {\n\t\t\treturn 0\n\t\t}\n\t\tans := int64(1)\n\t\tfor c := 0; c < m; c++ {\n\t\t\tans = ans * int64(n-c) % mod\n\t\t}\n\t\treturn ans\n\t}\n\n\tvar n, x, pos int\n\tFscan(in, &n, &x, &pos)\n\tif n == 1 {\n\t\t// todo\n\t}\n\n\tcntLess, cntGr := 0, 0\n\tsort.Search(n, func(mid int) bool {\n\t\tif mid < pos {\n\t\t\tcntLess++\n\t\t} else if mid > pos {\n\t\t\tcntGr++\n\t\t}\n\t\treturn mid > pos\n\t})\n\n\t//Println(cntLess, cntGr)\n\n\tans := int64(1)\n\tright := f(n-x, cntGr)\n\tleft := f(x-1, cntLess)\n\n\tans = ans * right % mod\n\tans = ans * left % mod\n\n\tother := n - 1 - cntLess - cntGr\n\tfo := f(other, other)\n\tans = ans * fo % mod\n\n\tFprint(out, ans)\n\n}\n\nfunc main() { run(os.Stdin, os.Stdout) }\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "ce7d66c304b39151bffe24444174ec8e", "src_uid": "24e2f10463f440affccc2755f4462d8a", "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\nvar rw = NewFastIO(os.Stdin, os.Stdout)\n\nconst mod = 1e9 + 7\n\nfunc main() {\n\tdefer rw.Flush()\n\tn, x, pos := rw.NextInt(), rw.NextInt(), rw.NextInt()\n\tlo, hi := 0, n\n\tsmol, bigg := int64(x-1), int64(n-x)\n\tvar ans int64 = 1\n\tfor lo < hi {\n\t\tmd := (lo + hi) / 2\n\t\tif md == pos {\n\t\t\tlo = md + 1\n\t\t} else if md < pos {\n\t\t\tlo = md + 1\n\t\t\tans *= smol\n\t\t\tans %= mod\n\t\t\tsmol--\n\t\t} else {\n\t\t\thi = md\n\t\t\tans *= bigg\n\t\t\tans %= mod\n\t\t\tbigg--\n\t\t}\n\t}\n\tsmol += bigg\n\tfor smol > 0 {\n\t\tans *= smol\n\t\tans %= mod\n\t\tsmol--\n\t}\n\trw.Println(ans)\n}\n\nfunc tCase() {\n\n}\n\ntype FastIO struct {\n\t*bufio.Writer\n\tr io.Reader\n\tbuf [8192]byte\n\ti, n int\n}\n\nfunc NewFastIO(r io.Reader, w io.Writer) *FastIO {\n\treturn &FastIO{r: r, Writer: bufio.NewWriter(w)}\n}\n\nfunc (f *FastIO) readC() byte {\n\tif f.i == f.n {\n\t\tf.n, _ = f.r.Read(f.buf[:])\n\t\tif f.n == 0 {\n\t\t\tpanic(\"EOF\")\n\t\t}\n\t\tf.i = 0\n\t}\n\tf.i++\n\treturn f.buf[f.i-1]\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, c)\n\t}\n\treturn string(s)\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}\nfunc (f *FastIO) NextInt64() int64 {\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 := int64(0)\n\tfor ; '0' <= c && c <= '9'; c = f.readC() {\n\t\tn = n*10 + int64(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}\nfunc (f *FastIO) NextInt64s(n int) []int64 {\n\ta := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = f.NextInt64()\n\t}\n\treturn a\n}\n\nfunc (f *FastIO) Println(a ...interface{}) {\n\tfmt.Fprintln(f, a...)\n}\n\nfunc (f *FastIO) Print(a ...interface{}) {\n\tfmt.Fprint(f, a...)\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}\nfunc (f *FastIO) PrintlnInts(a ...int) {\n\tf.PrintInts(a...)\n\tf.Println()\n}\nfunc (f *FastIO) PrintInt64s(a ...int64) {\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}\nfunc (f *FastIO) PrintlnInt64s(a ...int64) {\n\tf.PrintInt64s(a...)\n\tf.Println()\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "c294bc89faf11664693c308c117ea4de", "src_uid": "24e2f10463f440affccc2755f4462d8a", "difficulty": 1500.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc calc(m, l, x, n int64) int64 {\n\tif l > x-1 {\n\t\treturn 0\n\t}\n\tif m > n-x {\n\t\treturn 0\n\t}\n\tres := int64(1)\n\tmagic := int64(1000000007)\n\tfor i := int64(0); i < l; i++ {\n\t\tres = (res * (x - i - 1)) % magic\n\t}\n\tfor i := int64(0); i < m; i++ {\n\t\tres = (res * (n - x - i)) % magic\n\t}\n\tfor i := int64(1); i <= n-m-l-1; i++ {\n\t\tres = (res * i) % magic\n\t}\n\treturn res\n}\n\nfunc main() {\n\tio := bufio.NewReader(os.Stdin)\n\n\tvar n, x, pos int64\n\n\tfmt.Fscan(io, &n, &x, &pos)\n\n\tm := int64(0)\n\tl := int64(0)\n\n\tleft := int64(0)\n\tright := n\n\tmedian := int64(0)\n\tfor left < right {\n\t\tmedian = (left + right) / 2\n\t\tif median > pos {\n\t\t\tright = median\n\t\t\tm++\n\t\t} else if median < pos {\n\t\t\tleft = median + 1\n\t\t\tl++\n\t\t} else if median == pos {\n\t\t\tleft = median + 1\n\t\t}\n\t}\n\n\tfmt.Print(calc(m, l, x, n))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "fa8537fc68014f6192f80b6a390c2016", "src_uid": "24e2f10463f440affccc2755f4462d8a", "difficulty": 1500.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc calc(m, l, x, n int) int {\n\tif l > x-1 {\n\t\treturn 0\n\t}\n\tif m > n-x {\n\t\treturn 0\n\t}\n\tres := 1\n\tmagic := 1000000007\n\tfor i := 0; i < l; i++ {\n\t\tres = (res * (x - i - 1)) % magic\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tres = (res * (n - x - i)) % magic\n\t}\n\tfor i := 1; i <= n-m-l-1; i++ {\n\t\tres = (res * i) % magic\n\t}\n\treturn res\n}\n\nfunc main() {\n\tio := bufio.NewReader(os.Stdin)\n\n\tvar n, x, pos int\n\n\tfmt.Fscan(io, &n, &x, &pos)\n\n\tm := 0\n\tl := 0\n\n\tleft := 0\n\tright := n\n\tmedian := 0\n\tfor left < right {\n\t\tmedian = (left + right) / 2\n\t\tif median > pos {\n\t\t\tright = median\n\t\t\tm++\n\t\t} else if median < pos {\n\t\t\tleft = median + 1\n\t\t\tl++\n\t\t} else if median == pos {\n\t\t\tleft = median + 1\n\t\t}\n\t}\n\n\tfmt.Print(calc(m, l, x, n))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "727891fcce2b8944e17a37bf8487b282", "src_uid": "24e2f10463f440affccc2755f4462d8a", "difficulty": 1500.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nvar a []int = []int{0, 2, 3, 4, 5, 6, 8, 12, 30, 32, 33, 34, 35, 36, 38, 40, 42, 43, 44, 45, 46, 48, 50, 52, 53, 54, 55, 56, 58, 60, 62, 63, 64, 65, 66, 68, 80, 82, 83, 84, 85, 86, 88}\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == n {\n\t\t\tfmt.Printf(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Printf(\"NO\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "8223b5d8d93a9b8f4287ccdb18c9938e", "src_uid": "821529a4644b74483bcdf80fc318d1f8", "difficulty": null} {"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\tdivs := []int{130816, 32640, 8128, 2016, 496, 120, 28, 6, 1}\n\tn := readInt()\n\tfor _, k := range divs {\n\t\tif n%k == 0 {\n\t\t\tfmt.Println(k)\n\t\t\treturn\n\t\t}\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 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", "lang_cluster": "Go", "compilation_error": false, "code_uid": "db3527191a292c584c9b51b4450a2125", "src_uid": "339246a1be81aefe19290de0d1aead84", "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\n//a\u306eb\u4e57\u3092\u3057\u307e\u3059 O(log b)\nfunc pow(a int, b int) int {\n\ttotal := 1\n\ttmp := a\n\tfor b > 0 {\n\t\tif b%2 == 1 {\n\t\t\ttotal *= tmp\n\t\t}\n\t\tb /= 2\n\t\ttmp *= tmp\n\t}\n\treturn total\n}\n\nfunc main() {\n\tsc := NewScanner()\n\tN := sc.NextInt()\n\tmx := 0\n\tfor k := uint(1); ; k++ {\n\t\tl := ((1 << k) - 1) * (1 << (k - 1))\n\t\tif l > N {\n\t\t\tbreak\n\t\t}\n\t\tif N%l == 0 {\n\t\t\tmx = l\n\t\t}\n\t}\n\tfmt.Println(mx)\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": "6f45db948c594582e375b748780048fd", "src_uid": "339246a1be81aefe19290de0d1aead84", "difficulty": 1000.0} {"lang": "Go", "source_code": "\npackage main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar a [9]int64\nvar helper SHelper\n\nfunc main() {\n\thelper.Init()\n\n\tfor k := uint64(1); k <= 8; k++ {\n\t\tl := (1 << k) - 1 // shift count type int64, must be unsigned integer\t\t\n\t\tr := 1 << (k - 1)\n\t\tv := l * r\n\t\ta[k] = int64(v)\n\t}\n\n\tn := helper.ReadInt64()\n\tfor k := int64(8); k >= 1; k-- {\n\t\tif n >= a[k] && n % a[k] == 0 {\n\t\t\tfmt.Println(a[k])\n\t\t\treturn\n\t\t}\n\t}\n}\n\ntype SHelper struct {\n\tfile *os.File\n\tscanner *bufio.Scanner\n}\n\nfunc (this *SHelper) Init() {\n\tthis.file = os.Stdin\n\tthis.scanner = bufio.NewScanner(this.file)\n\tthis.scanner.Split(bufio.ScanWords)\n}\n\nfunc (this *SHelper) ReadInt64() int64 {\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 n\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "7c6d586b8cf2211afbc573796529ced3", "src_uid": "339246a1be81aefe19290de0d1aead84", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t//\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tinp := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tis, err := inp.ReadString('\\n')\n\tif err != nil {\n\t\tout.WriteString(\"-1\")\n\t\tout.Flush()\n\t\treturn\n\t}\n\tis = strings.TrimRight(is, \"\\n\\r\\t \")\n\tl1 := strings.Split(is, \" \")\n\tif len(l1) != 2 {\n\t\tout.WriteString(\"-1\")\n\t\tout.Flush()\n\t\treturn\n\t}\n\tn, err := strconv.Atoi(l1[0])\n\tif err != nil {\n\t\tout.WriteString(\"-1\")\n\t\tout.Flush()\n\t\treturn\n\t}\n\tw, err := strconv.Atoi(l1[1])\n\tif err != nil {\n\t\tout.WriteString(\"-1\")\n\t\tout.Flush()\n\t\treturn\n\t}\n\tis, err = inp.ReadString('\\n')\n\tif err != nil {\n\t\tout.WriteString(\"-1\")\n\t\tout.Flush()\n\t\treturn\n\t}\n\tis = strings.TrimRight(is, \"\\n\\r\\t \")\n\tl2 := strings.Split(is, \" \")\n\tif len(l2) != n {\n\t\tout.WriteString(\"-1\")\n\t\tout.Flush()\n\t\treturn\n\t}\n\tavol := make([]int, n)\n\tafact := make([]int, n)\n\tminv := 0\n\tfor i := 0; i < n; i++ {\n\t\tavol[i], err = strconv.Atoi(l2[i])\n\t\tif err != nil {\n\t\t\tout.WriteString(\"-1\")\n\t\t\tout.Flush()\n\t\t\treturn\n\t\t}\n\t\tcv := (avol[i] + 1) / 2\n\t\tif cv < minv {\n\t\t\tcv = minv\n\t\t} else {\n\t\t\tminv = cv\n\t\t}\n\t\tafact[i] = cv\n\t\tw -= cv\n\t\tif w <= 0 {\n\t\t\tout.WriteString(\"-1\")\n\t\t\tout.Flush()\n\t\t\treturn\n\t\t}\n\t}\n\tmaxv := avol[n-1]\n\tfor i := n - 1; i >= 0; i-- {\n\t\tadd := 0\n\t\tif avol[i] > maxv {\n\t\t\tadd = maxv - afact[i]\n\t\t} else {\n\t\t\tadd = avol[i] - afact[i]\n\t\t\tmaxv = avol[i]\n\t\t}\n\t\tif add < w {\n\t\t\tafact[i] += w\n\t\t\tbreak\n\t\t} else {\n\t\t\tafact[i] += add\n\t\t\tw -= add\n\t\t}\n\t}\n\n\tif w > 0 {\n\t\tout.WriteString(\"-1\")\n\t\tout.Flush()\n\t} else {\n\t\tfor _, v := range afact {\n\t\t\tout.WriteString(strconv.Itoa(v))\n\t\t}\n\t}\n\tout.Flush()\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "9a90945327f63d16b5e11540b911f241", "src_uid": "5d3bb9e03f4c5c8ecb6233bd5f90f3a3", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t//\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype fs struct {\n\tdata []int\n\tindex []int\n}\n\nfunc (a *fs) Len() int {\n\treturn len(a.data)\n}\n\nfunc (a *fs) Less(i, j int) bool {\n\treturn a.data[i] > a.data[j]\n}\n\nfunc (a *fs) Swap(i, j int) {\n\tt := a.index[i]\n\ta.index[i] = a.index[j]\n\ta.index[j] = t\n}\n\nfunc main() {\n\tinp := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tis, err := inp.ReadString('\\n')\n\tif err != nil {\n\t\tout.WriteString(\"-1\")\n\t\tout.Flush()\n\t\treturn\n\t}\n\tis = strings.TrimRight(is, \"\\n\\r\\t \")\n\tl1 := strings.Split(is, \" \")\n\tif len(l1) != 2 {\n\t\tout.WriteString(\"-1\")\n\t\tout.Flush()\n\t\treturn\n\t}\n\tn, err := strconv.Atoi(l1[0])\n\tif err != nil {\n\t\tout.WriteString(\"-1\")\n\t\tout.Flush()\n\t\treturn\n\t}\n\tw, err := strconv.Atoi(l1[1])\n\tif err != nil {\n\t\tout.WriteString(\"-1\")\n\t\tout.Flush()\n\t\treturn\n\t}\n\tis, err = inp.ReadString('\\n')\n\tif err != nil {\n\t\tout.WriteString(\"-1\")\n\t\tout.Flush()\n\t\treturn\n\t}\n\tis = strings.TrimRight(is, \"\\n\\r\\t \")\n\tl2 := strings.Split(is, \" \")\n\tif len(l2) != n {\n\t\tout.WriteString(\"-1\")\n\t\tout.Flush()\n\t\treturn\n\t}\n\n\tavol := make([]int, n)\n\tafact := make([]int, n)\n\tindex := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tavol[i], err = strconv.Atoi(l2[i])\n\t\tif err != nil {\n\t\t\tout.WriteString(\"-1\")\n\t\t\tout.Flush()\n\t\t\treturn\n\t\t}\n\t\tafact[i] = (avol[i] + 1) / 2\n\t\tw -= afact[i]\n\t\tif w < 0 {\n\t\t\tout.WriteString(\"-1\")\n\t\t\tout.Flush()\n\t\t\treturn\n\t\t}\n\t\tindex[i] = i\n\t}\n\n\t//fmt.Printf(\"%v\\n\", afact)\n\tfss := fs{\n\t\tdata: avol,\n\t\tindex: index,\n\t}\n\tsort.Sort(&fss)\n\t//fmt.Printf(\"%v\\n\", fss.index)\n\n\tfor _, idx := range fss.index {\n\t\tadd := avol[idx] - afact[idx]\n\t\tif w < add {\n\t\t\tadd = w\n\t\t}\n\t\tafact[idx] += add\n\t\tw -= add\n\t}\n\n\tif w > 0 {\n\t\tout.WriteString(\"-1\")\n\t\tout.Flush()\n\t} else {\n\t\tfor _, v := range afact {\n\t\t\tout.WriteString(strconv.Itoa(v))\n\t\t\tout.WriteString(\" \")\n\t\t}\n\t}\n\tout.Flush()\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "8c60c4823e3dec2df5db0ef47ca3ffdc", "src_uid": "5d3bb9e03f4c5c8ecb6233bd5f90f3a3", "difficulty": 1400.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\tinp := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tis, err := inp.ReadString('\\n')\n\tif err != nil {\n\t\tout.WriteString(\"-1\")\n\t\tout.Flush()\n\t\treturn\n\t}\n\tis = strings.TrimRight(is, \"\\n\\r\\t \")\n\tl1 := strings.Split(is, \" \")\n\tif len(l1) != 2 {\n\t\tout.WriteString(\"-1\")\n\t\tout.Flush()\n\t\treturn\n\t}\n\tn, err := strconv.Atoi(l1[0])\n\tif err != nil {\n\t\tout.WriteString(\"-1\")\n\t\tout.Flush()\n\t\treturn\n\t}\n\tw, err := strconv.Atoi(l1[1])\n\tif err != nil {\n\t\tout.WriteString(\"-1\")\n\t\tout.Flush()\n\t\treturn\n\t}\n\tis, err = inp.ReadString('\\n')\n\tif err != nil {\n\t\tout.WriteString(\"-1\")\n\t\tout.Flush()\n\t\treturn\n\t}\n\tis = strings.TrimRight(is, \"\\n\\r\\t \")\n\tl2 := strings.Split(is, \" \")\n\tif len(l2) != n {\n\t\tout.WriteString(\"-1\")\n\t\tout.Flush()\n\t\treturn\n\t}\n\n\tavol := make([]int, n)\n\tafact := make([]int, n)\n\tminv := 0\n\tfor i := 0; i < n; i++ {\n\t\tavol[i], err = strconv.Atoi(l2[i])\n\t\tif err != nil {\n\t\t\tout.WriteString(\"-1\")\n\t\t\tout.Flush()\n\t\t\treturn\n\t\t}\n\t\tcv := (avol[i] + 1) / 2\n\t\tif cv < minv {\n\t\t\tcv = minv\n\t\t} else {\n\t\t\tminv = cv\n\t\t}\n\t\tafact[i] = cv\n\t\tw -= cv\n\t\tif w <= 0 {\n\t\t\tout.WriteString(\"-1\")\n\t\t\tout.Flush()\n\t\t\treturn\n\t\t}\n\t}\n\tmaxv := avol[n-1]\n\tfor i := n - 1; i >= 0; i-- {\n\t\tadd := 0\n\t\tif avol[i] > maxv {\n\t\t\tadd = maxv - afact[i]\n\t\t} else {\n\t\t\tadd = avol[i] - afact[i]\n\t\t\tmaxv = avol[i]\n\t\t}\n\t\tif add >= w {\n\t\t\tafact[i] += w\n\t\t\tw = 0\n\t\t\tbreak\n\t\t} else {\n\t\t\tafact[i] += add\n\t\t\tw -= add\n\t\t}\n\t\tfmt.Println(i, avol[i], afact[i], w)\n\t}\n\n\tif w > 0 {\n\t\tout.WriteString(\"-1\")\n\t\tout.Flush()\n\t} else {\n\t\tfor _, v := range afact {\n\t\t\tout.WriteString(strconv.Itoa(v))\n\t\t\tout.WriteString(\" \")\n\t\t}\n\t}\n\tout.Flush()\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "a4d40ccad92818a0302987b02691f204", "src_uid": "5d3bb9e03f4c5c8ecb6233bd5f90f3a3", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar R0, R1 string\n\nfunc solve(S string) {\n\tvar pos [26]int\n\tfor i := 0; i < 26; i++ {\n\t\tpos[i] = -1\n\t}\n\tfor i, c := range S {\n\t\tidx := int(c) - int('A')\n\t\tif pos[idx] == -1 {\n\t\t\tpos[idx] = i\n\t\t\tcontinue\n\t\t}\n\t\tx := i - pos[idx] - 1\n\t\tif x == 0 {\n\t\t\tfmt.Println(\"Impossible\")\n\t\t\treturn\n\t\t}\n\t\tfor j := 0; j < 27; j++ {\n\t\t\tif i == j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif j <= pos[idx]+x/2 {\n\t\t\t\tR1 += string(S[j])\n\t\t\t} else {\n\t\t\t\tR0 = string(S[j]) + R0\n\t\t\t}\n\t\t}\n\t\tfor len(R0) > len(R1) {\n\t\t\tR1 = string(R0[0]) + R1\n\t\t\tR0 = R0[1:]\n\t\t}\n\t\tfor len(R1) > len(R0) {\n\t\t\tR0 = string(R1[0]) + R0\n\t\t\tR1 = R1[1:]\n\t\t}\n\t\tfmt.Println(R0)\n\t\tfmt.Println(R1)\n\t\tbreak\n\t}\n}\nfunc main() {\n\tfsc := NewFastScanner()\n\tS := fsc.Next()\n\tsolve(S)\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1024)\n\treturn &FastScanner{r: rdr}\n}\nfunc (s *FastScanner) 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 *FastScanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *FastScanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *FastScanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *FastScanner) 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\nfunc IntMax(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Int64Max(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Float64Max(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc IntMin(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Int64Min(a, b int64) int64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Float64Min(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "15cb2473473f2da655c4417e613ce413", "src_uid": "56c5ea443dec7a732802b16aed5b934d", "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//\"math\"\n)\n\nfunc solve() {\n s, cur, was := readString(), []int{}, make(map[rune]bool)\n for _, ch := range s {\n if !was[ch] {\n cur = append(cur, int(ch))\n was[ch] = true\n }\n }\n\n var d [5][16]int\n for t := 0; t < 13*2; t++ {\n for j := 0; j < 13; j++ {\n d[1][j+1] = cur[j]\n d[2][13-j] = cur[j+13]\n }\n\n\n curI, curJ, found := t/13 + 2, t%13 + 2, true\n for _, ch := range s {\n ok := false\n for _, di := range []int{-1, 0, 1} {\n for _, dj := range []int{-1, 0, 1} {\n posI, posJ := curI+di, curJ+dj\n if !ok && (di != 0 || dj != 0) && int(ch) == d[posI][posJ] {\n curI, curJ, ok = posI, posJ, true\n }\n }\n }\n if !ok {\n found = false\n }\n }\n\n if found {\n for i := 0; i < 2; i++ {\n for j := 0; j < 13; j++ {\n fmt.Print(string(d[i+1][j+1]))\n }\n fmt.Println()\n }\n\n return\n }\n cur = append(cur[len(cur)-1:], cur[:len(cur)-1]...)\n }\n\n fmt.Println(\"Impossible\")\n}\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// Math\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc min(x, y int) int {\n\treturn x + y - max(x, y)\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 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 readArray(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt()\n\t}\n\treturn res\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "24c39c10cbf894b64de03faf45cc4741", "src_uid": "56c5ea443dec7a732802b16aed5b934d", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar R0, R1 string\n\nfunc solve(S string) {\n\tvar pos [26]int\n\tfor i := 0; i < 26; i++ {\n\t\tpos[i] = -1\n\t}\n\tfor i, c := range S {\n\t\tidx := int(c) - int('A')\n\t\tif pos[idx] == -1 {\n\t\t\tpos[idx] = i\n\t\t\tcontinue\n\t\t}\n\t\tx := i - pos[idx] - 1\n\t\tif x == 0 {\n\t\t\tfmt.Println(\"Impossible\")\n\t\t\treturn\n\t\t}\n\t\tfor j := 0; j < 27; j++ {\n\t\t\tif i == j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif j <= pos[idx]+x/2 {\n\t\t\t\tR1 += string(S[j])\n\t\t\t} else {\n\t\t\t\tR0 = string(S[j]) + R0\n\t\t\t}\n\t\t}\n\t\tfmt.Println(R0)\n\t\tfmt.Println(R1)\n\t\tbreak\n\t}\n}\nfunc main() {\n\tfsc := NewFastScanner()\n\tS := fsc.Next()\n\tsolve(S)\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1024)\n\treturn &FastScanner{r: rdr}\n}\nfunc (s *FastScanner) 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 *FastScanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *FastScanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *FastScanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *FastScanner) 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\nfunc IntMax(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Int64Max(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Float64Max(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc IntMin(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Int64Min(a, b int64) int64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc Float64Min(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "fc29cf6112c8038396fe1241844c12ab", "src_uid": "56c5ea443dec7a732802b16aed5b934d", "difficulty": 1600.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\n\tvar (\n\t\tsize int\n\t\tballSize map[int]bool = make(map[int]bool)\n\t)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &size)\n\t\tballSize[size] = true\n\t}\n\n\tvar ok1, ok2 bool\n\tfor size, _ = range ballSize {\n\t\t_, ok1 = ballSize[size+1]\n\t\t_, ok2 = ballSize[size+2]\n\t\tif ok1 && ok2 {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "d63bb0c2a5205f57b5c59056d79350b8", "src_uid": "d6c876a84c7b92141710be5d76536eab", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\", &a, &b)\n\tif a == 9 && b == 1 {\n\t\tfmt.Printf(\"9 10\\n\")\n\t} else if a == b {\n\t\tfmt.Printf(\"%d1 %d2\", a, b)\n\t} else if a+1 == b {\n\t\tfmt.Printf(\"%d %d\", a, b)\n\t} else {\n\t\tfmt.Printf(\"-1\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "7b193386d51606c5b816877461b7e2aa", "src_uid": "3eff6f044c028146bea5f0dfd2870d23", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\\n\", &a, &b)\n\n\tif a == b {\n\t\tfmt.Printf(\"%d0 %d1\", a, b)\n\t} else if a == b-1 {\n\t\tfmt.Printf(\"%d9 %d0\", a, b)\n\t} else if a == 9 && b == 1 {\n\t\tfmt.Println(\"9 10\")\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "663c5b7ce618f1938a8d440c2ccb5cf5", "src_uid": "3eff6f044c028146bea5f0dfd2870d23", "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\n\treader := bufio.NewReader(os.Stdin)\n\tvar a, b int\n\n\tfmt.Fscanf(reader, \"%d %d\\n\", &a, &b)\n\tif a == 9 && b == 1 {\n\t\tfmt.Println(9, 10)\n\t\treturn\n\t}\n\tif b-a > 1 || a > b {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\tif a == b {\n\t\tfmt.Println(a*10, b*10+1)\n\t} else {\n\t\tfmt.Println(b*100-1, b*100)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "07ecf691f9c384bad9102bbde13e6576", "src_uid": "3eff6f044c028146bea5f0dfd2870d23", "difficulty": 900.0} {"lang": "Go", "source_code": "package 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/*********** 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\t// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\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\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/*********** DP sub-functions ***********/\n\n// ChMin accepts a pointer of integer and a target value.\n// If target value is SMALLER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMin(updatedValue *int, target int) bool {\n\tif *updatedValue > target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n// ChMax accepts a pointer of integer and a target value.\n// If target value is LARGER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMax(updatedValue *int, target int) bool {\n\tif *updatedValue < target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n// NthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc NthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\n}\n\n// OnBit returns the integer that has nth ON bit.\n// If an argument has nth ON bit, OnBit returns the argument.\nfunc OnBit(num, nth int) int {\n\treturn num | (1 << uint(nth))\n}\n\n// OffBit returns the integer that has nth OFF bit.\n// If an argument has nth OFF bit, OffBit returns the argument.\nfunc OffBit(num, nth int) int {\n\treturn num & ^(1 << uint(nth))\n}\n\n// PopCount returns the number of ON bit of an argument.\nfunc PopCount(num int) int {\n\tres := 0\n\n\tfor i := 0; i < 70; i++ {\n\t\tif ((num >> uint(i)) & 1) == 1 {\n\t\t\tres++\n\t\t}\n\t}\n\n\treturn res\n}\n\n/*********** Arithmetic ***********/\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Sum returns multiple integers sum.\nfunc Sum(integers ...int) int {\n\ts := 0\n\n\tfor _, i := range integers {\n\t\ts += i\n\t}\n\n\treturn s\n}\n\n// PowInt is integer version of math.Pow\n// PowInt calculate a power by Binary Power (\u4e8c\u5206\u7d2f\u4e57\u6cd5(O(log e))).\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalfE := e / 2\n\t\thalf := PowInt(a, halfE)\n\t\treturn half * half\n\t}\n\n\treturn a * PowInt(a, e-1)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// Gcd returns the Greatest Common Divisor of two natural numbers.\n// Gcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Gcd uses the Euclidean Algorithm.\nfunc Gcd(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\n\t// Euclidean Algorithm\n\tfor b > 0 {\n\t\tdiv := a % b\n\t\ta, b = b, div\n\t}\n\n\treturn a\n}\n\n// Lcm returns the Least Common Multiple of two natural numbers.\n// Lcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Lcd uses the Euclidean Algorithm indirectly.\nfunc Lcm(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\n\t// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2\n\t// a' and b' are relatively prime numbers\n\t// gcd consists of prime numbers, that are included in a and b\n\tgcd := Gcd(a, b)\n\n\t// not (a * b / gcd), because of reducing a probability of overflow\n\treturn (a / gcd) * b\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\t// str := 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/********** 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 MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\nconst INF_INT64 = math.MaxInt64\nconst INF_BIT60 = 1 << 60\n\nvar da, db int\n\nfunc main() {\n\tda, db = ReadInt2()\n\n\tif da == 9 && db == 1 {\n\t\tfmt.Println(9, 10)\n\t\treturn\n\t}\n\n\tif da > db {\n\t\tfmt.Println(-1)\n\t} else if da == db {\n\t\ta := da * 10\n\t\tb := a + 1\n\t\tfmt.Println(a, b)\n\t} else {\n\t\tif db-da == 1 {\n\t\t\ta := da*10 + 9\n\t\t\tb := a + 1\n\t\t\tfmt.Println(a, b)\n\t\t} else {\n\t\t\tfmt.Println(-1)\n\t\t}\n\t}\n}\n\n// MOD\u306f\u3068\u3063\u305f\u304b\uff1f\n// \u9077\u79fb\u3060\u3051\u3058\u3083\u306a\u304f\u3066\u6700\u5f8c\u306e\u6700\u5f8c\u3067\u3061\u3083\u3093\u3068\u53d6\u308c\u3088\uff1f\n\n/*******************************************************************/\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "af7b370f15d12fd638090c73e8e56d8c", "src_uid": "3eff6f044c028146bea5f0dfd2870d23", "difficulty": 900.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\ta := readi()\n\tb := readi()\n\tif b-a == 1 {\n\t\tprintln(a, b)\n\t\treturn\n\t}\n\tif b == a {\n\t\tprintf(\"%d0 %d1\\n\", a, b)\n\t\treturn\n\t}\n\t// 1x + 1 = 9y\n\tif a < b {\n\t\tprintln(-1)\n\t\treturn\n\t}\n\t// 9x +1 = 1y\n\tif a == 9 && b == 1 {\n\t\tprintln(9, 10)\n\t\treturn\n\t}\n\tprintln(-1)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "a109641ac894b8e92b98b39c55dc1157", "src_uid": "3eff6f044c028146bea5f0dfd2870d23", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanln(&a, &b)\n\tif a == 9 && b == 1 {\n\t\tfmt.Println(\"99 100\")\n\t} else if a > b || b-a >= 2 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(solution(a, b))\n\t}\n}\n\nfunc solution(x, y int) (int, int) {\n\tif x == y {\n\t\treturn x * 10, y*10 + 1\n\t}\n\treturn x*10 + 9, y * 10\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "24ed66315717bbc35894bade2c93533e", "src_uid": "3eff6f044c028146bea5f0dfd2870d23", "difficulty": 900.0} {"lang": "Go", "source_code": "package 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/*********** 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\t// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\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\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/*********** DP sub-functions ***********/\n\n// ChMin accepts a pointer of integer and a target value.\n// If target value is SMALLER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMin(updatedValue *int, target int) bool {\n\tif *updatedValue > target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n// ChMax accepts a pointer of integer and a target value.\n// If target value is LARGER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMax(updatedValue *int, target int) bool {\n\tif *updatedValue < target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n// NthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc NthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\n}\n\n// OnBit returns the integer that has nth ON bit.\n// If an argument has nth ON bit, OnBit returns the argument.\nfunc OnBit(num, nth int) int {\n\treturn num | (1 << uint(nth))\n}\n\n// OffBit returns the integer that has nth OFF bit.\n// If an argument has nth OFF bit, OffBit returns the argument.\nfunc OffBit(num, nth int) int {\n\treturn num & ^(1 << uint(nth))\n}\n\n// PopCount returns the number of ON bit of an argument.\nfunc PopCount(num int) int {\n\tres := 0\n\n\tfor i := 0; i < 70; i++ {\n\t\tif ((num >> uint(i)) & 1) == 1 {\n\t\t\tres++\n\t\t}\n\t}\n\n\treturn res\n}\n\n/*********** Arithmetic ***********/\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Sum returns multiple integers sum.\nfunc Sum(integers ...int) int {\n\ts := 0\n\n\tfor _, i := range integers {\n\t\ts += i\n\t}\n\n\treturn s\n}\n\n// PowInt is integer version of math.Pow\n// PowInt calculate a power by Binary Power (\u4e8c\u5206\u7d2f\u4e57\u6cd5(O(log e))).\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalfE := e / 2\n\t\thalf := PowInt(a, halfE)\n\t\treturn half * half\n\t}\n\n\treturn a * PowInt(a, e-1)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// Gcd returns the Greatest Common Divisor of two natural numbers.\n// Gcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Gcd uses the Euclidean Algorithm.\nfunc Gcd(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\n\t// Euclidean Algorithm\n\tfor b > 0 {\n\t\tdiv := a % b\n\t\ta, b = b, div\n\t}\n\n\treturn a\n}\n\n// Lcm returns the Least Common Multiple of two natural numbers.\n// Lcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Lcd uses the Euclidean Algorithm indirectly.\nfunc Lcm(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\n\t// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2\n\t// a' and b' are relatively prime numbers\n\t// gcd consists of prime numbers, that are included in a and b\n\tgcd := Gcd(a, b)\n\n\t// not (a * b / gcd), because of reducing a probability of overflow\n\treturn (a / gcd) * b\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\t// str := 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/********** 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 MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\nconst INF_INT64 = math.MaxInt64\nconst INF_BIT60 = 1 << 60\n\nvar da, db int\n\nfunc main() {\n\tda, db = ReadInt2()\n\n\tif da > db {\n\t\tfmt.Println(-1)\n\t} else if da == db {\n\t\ta := da * 10\n\t\tb := a + 1\n\t\tfmt.Println(a, b)\n\t} else {\n\t\tif db-da == 1 {\n\t\t\ta := da*10 + 9\n\t\t\tb := a + 1\n\t\t\tfmt.Println(a, b)\n\t\t} else {\n\t\t\tfmt.Println(-1)\n\t\t}\n\t}\n}\n\n// MOD\u306f\u3068\u3063\u305f\u304b\uff1f\n// \u9077\u79fb\u3060\u3051\u3058\u3083\u306a\u304f\u3066\u6700\u5f8c\u306e\u6700\u5f8c\u3067\u3061\u3083\u3093\u3068\u53d6\u308c\u3088\uff1f\n\n/*******************************************************************/\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "d5878d798c668855815b7e577612e56a", "src_uid": "3eff6f044c028146bea5f0dfd2870d23", "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\n\treader := bufio.NewReader(os.Stdin)\n\tvar a, b int\n\n\tfmt.Fscanf(reader, \"%d %d\\n\", &a, &b)\n\tif b-a > 1 || a > b {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\tif a == 9 && b == 1 {\n\t\tfmt.Println(9, 10)\n\t\treturn\n\t}\n\n\tif a == b {\n\t\tfmt.Println(a*10, b*10+1)\n\t} else {\n\t\tfmt.Println(b*100-1, b*100)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "63d218682ba249c9b2a5f6c1dd8684e7", "src_uid": "3eff6f044c028146bea5f0dfd2870d23", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar da, db int\n\tif _, err := fmt.Scanf(\"%d %d\", &da, &db); err != nil {\n\t\tpanic(err)\n\t}\n\n\tif db == da {\n\t\tfmt.Printf(\"%d0 %d1\\n\", da, db)\n\t} else if da == 9 && db == 0 {\n\t\tfmt.Println(\"9 10\")\n\t} else if db == da+1 {\n\t\tfmt.Printf(\"%d9 %d0\\n\", da, db)\n\t} else {\n\t\tfmt.Println(\"-1\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "eea9ee06052a8f01455949c6a6d3a5fd", "src_uid": "3eff6f044c028146bea5f0dfd2870d23", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\\n\", &a, &b)\n\n\tif a == b {\n\t\tfmt.Printf(\"%d0 %d1\", a, b)\n\t} else if a == b-1 {\n\t\tfmt.Printf(\"%d9 %d0\", a, b)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "1322decd84abc2b66103badfe25348b4", "src_uid": "3eff6f044c028146bea5f0dfd2870d23", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, x, y int\n\tfmt.Scanln(&a, &b)\n\n\tx, y = solution(a, b)\n\n\tif (x == 0) && (y == 0) {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(x, y)\n\t}\n}\n\nfunc solution(x, y int) (int, int) {\n\tif x == y {\n\t\treturn x * 10, y*10 + 1\n\t}\n\tif y == x+1 {\n\t\treturn x*10 + 9, y * 10\n\t}\n\treturn 0, 0\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "8698d0ae947ce7b3e87423c108dc0240", "src_uid": "3eff6f044c028146bea5f0dfd2870d23", "difficulty": 900.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\nvar (\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\ts := next()\n\tt := \"CODEFORCES\"\n\tidx := 0\n\tr, l := \"\", \"\"\n\n\tfor i := 0; i < len(t); i++ {\n\t\tr, l = t[:i], t[i:]\n\n\t\tidx = strings.Index(s, r)\n\n\t\tif idx >= 0 && strings.Index(s[idx+1:], l) >= 0 {\n\t\t\tprintln(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tprintln(\"NO\")\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n\nfunc print(a ...interface{}) {\n\tfmt.Fprint(writer, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\tfmt.Fprintf(writer, format, a...)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "95b1af3b6dc63b7d6f6423fc4568bb3c", "src_uid": "bda4b15827c94b526643dfefc4bc36e7", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tsize := len(s)\n\textra := size - len(\"CODEFORCES\")\n\tif extra < 0 {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tfor i := 0; i < size-extra; i++ {\n\t\tx := s[:i] + s[i+extra:]\n\t\tif x == \"CODEFORCES\" {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "ba2543abeecc20cc41bc81201d201364", "src_uid": "bda4b15827c94b526643dfefc4bc36e7", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tword := \"CODEFORCES\"\n\n\tvar s string\n\tfmt.Scanf(\"%s\", &s)\n\n\tif strings.HasSuffix(s, word) {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\ti := 0\n\tfor ; i < len(s) && i < len(word); i++ {\n\t\tif s[i] != word[i] {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif strings.HasSuffix(s, word[i:]) {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\n\tfmt.Println(\"NO\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "f17ff15ad4f475fddff3af2856ace7be", "src_uid": "bda4b15827c94b526643dfefc4bc36e7", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tword := \"CODEFORCES\"\n\n\tvar s string\n\tfmt.Scanf(\"%s\", &s)\n\n\ti := 0\n\tfor ; i < len(s) && i < len(word); i++ {\n\t\tif s[i] != word[i] {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif strings.HasSuffix(s, word[i:]) {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\n\tfmt.Println(\"NO\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "8a97f29c1c0198bc419fae13e083d244", "src_uid": "bda4b15827c94b526643dfefc4bc36e7", "difficulty": 1400.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\nvar (\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\ts := next()\n\tt := \"CODEFORCES\"\n\n\tfor i := 0; i <= len(t); i++ {\n\t\tif strings.HasPrefix(s, t[:i]) && strings.HasSuffix(s, t[i:]) {\n\t\t\tprintln(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tprintln(\"NO\")\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n\nfunc print(a ...interface{}) {\n\tfmt.Fprint(writer, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\tfmt.Fprintf(writer, format, a...)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "95db374317e79475fd2a077c67a845c5", "src_uid": "bda4b15827c94b526643dfefc4bc36e7", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tsize := len(s)\n\textra := size - len(\"CODEFORCES\")\n\tif extra < 0 {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tfor i := 0; i <= size-extra; i++ {\n\t\tx := s[:i] + s[i+extra:]\n\t\tif x == \"CODEFORCES\" {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "ab033727a2d6bb1ec5c43f5866422f21", "src_uid": "bda4b15827c94b526643dfefc4bc36e7", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tconst cf = \"CODEFORCES\"\n\tvar s string\n\tfmt.Scan(&s)\n\tif len(s) < len(cf) {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tb := 0\n\tfor i := range cf {\n\t\tif s[i] != cf[i] {\n\t\t\tbreak\n\t\t}\n\t\tb++\n\t}\n\te := 0\n\tfor i := range cf {\n\t\tif s[len(s)-1-i] != cf[len(cf)-1-i] {\n\t\t\tbreak\n\t\t}\n\t\te++\n\t}\n\tif b+e >= len(cf) {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "c9629afa5be0144d4ceb6c5fc76a9d80", "src_uid": "bda4b15827c94b526643dfefc4bc36e7", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nvar scanner *bufio.Scanner\nvar writer *bufio.Writer\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 word := \"CODEFORCES\"\n result := \"NO\"\n n := len(word)\n s := getS()\n m := len(s)\n for i := 0; i <= n && i <= m; i++ {\n j := m - n + i\n if j < i {\n break\n }\n for ; j < m; j++ {\n if s[j] != word[n - m + j] {\n break\n }\n }\n if j == m {\n result = \"YES\"\n break\n }\n if s[i] != word[i] {\n break\n }\n }\n writer.WriteString(fmt.Sprintf(\"%s\\n\", result))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "fc6b3adf9b216ca1093c726acce78b41", "src_uid": "bda4b15827c94b526643dfefc4bc36e7", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tsize := len(s)\n\textra := size - len(\"CODEFORCES\")\n\tfor i := 0; i < size-extra; i++ {\n\t\tx := s[:i] + s[i+extra:]\n\t\tif x == \"CODEFORCES\" {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "700661fa72a6e45d610dc6eb9cb0d563", "src_uid": "bda4b15827c94b526643dfefc4bc36e7", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, r int64;\n\tfmt.Scan(&a, &b)\n\tfor r = 1; a < b; b-- {\n\t\tr *= b % 10\n\t\tif r == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(r % 10)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "51377735527710cb8d527c42f6488456", "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 10 {\n\t\t\tbreak\n\t\t}\n\t\tcnt++\n\t}\n\tfmt.Println(res % 10)\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc max(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\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": "c2e4cb568c5247388a96bb0488b62a00", "src_uid": "2ed5a7a6176ed9b0bda1de21aad13d60", "difficulty": 1100.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 if x == 0 {\n break\n }\n } \n\n fmt.Println(x);\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "fba1120ac2467f3d8947eb3ce6612f27", "src_uid": "2ed5a7a6176ed9b0bda1de21aad13d60", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"bufio\"\n\t\"os\"\n)\n\n// IO\nvar scanner *bufio.Scanner\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\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\tslove()\n}\n\nfunc slove() {\n\ta := readInt64()\n\tb := readInt64()\n\n\tres := int64(1)\n\tcnt := 0\n\tfor i := a + 1; i <= b; i++ {\n\t\tm := int64(1)\n\t\tif i != 0 {\n\t\t\tm = i\n\t\t}\n\t\tm %= 10\n\t\tres %= 10\n\t\tres *= m\n\t\tif cnt > 10 {\n\t\t\tbreak\n\t\t}\n\t\tcnt++\n\t}\n\tfmt.Println(res % 10)\n\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "4aea2c525a3b9fd3ed3af95fd005ea29", "src_uid": "2ed5a7a6176ed9b0bda1de21aad13d60", "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 solve() {\n\ta := readInt64()\n\tb := readInt64()\n\n\tres := int64(1)\n\tcnt := 0\n\tfor i := a + 1; i <= b; i++ {\n\t\tm := int64(1)\n\t\tif i != 0 {\n\t\t\tm = i\n\t\t}\n\t\tm %= 10\n\t\tres %= 10\n\t\tres *= m\n\t\tif cnt > 10 {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(res % 10)\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc max(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\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": "b6e5617370decc3503025e32892bbff7", "src_uid": "2ed5a7a6176ed9b0bda1de21aad13d60", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, r int;\n\tfmt.Scan(&a, &b)\n\tfor r = 1; a < b; b-- {\n\t\tr *= b % 10\n\t\tif r == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(r % 10)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "8127a7d73b8945a7b7159b730e3eb13c", "src_uid": "2ed5a7a6176ed9b0bda1de21aad13d60", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k, t int\n\tfmt.Scan(&n, &k, &t)\n\tif n < t {\n\t\tn += k - t\n\t}\n\tif n > k {\n\t\tn = k\n\t}\n\tfmt.Println(n)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "90881f82c31d7ef5d49de313526ab090", "src_uid": "7e614526109a2052bfe7934381e7f6c2", "difficulty": 800.0} {"lang": "Go", "source_code": "// Codeforces helper functions\n// 20 Jan 18\n// samadhi\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nconst debug = true\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\n\tin := gsli(reader)\n\n\tn := in[0]\n\tk := in[1]\n\tt := in[2]\n\n\tans := 0\n\tif t <= k {\n\t\tans = t\n\t} else if t <= n {\n\t\tans = k\n\t} else {\n\t\tans = k + n - t\n\t}\n\n\tfmt.Println(ans)\n\n}\n\n// Input helpers\n\n// If you don't pass in a reference to the reader, and just instantiate a new\n// one every time, it will work locally, with IO typed at human-speed, but not\n// on Codeforces.\n\n// Get Space-separated Line as Strings\n//\n// Example input:\n// 1 test 382.0\n// Example output:\n// [\"1\", \"test\", \"382.0\"]\n\nfunc gsls(reader *bufio.Reader) (arr []string) {\n\t// Get a full line\n\tinput, _ := reader.ReadString('\\n')\n\n\t//Strip newline and return chars, if any\n\tinput = strings.TrimSuffix(input, \"\\n\")\n\tinput = strings.TrimSuffix(input, \"\\r\")\n\n\t// Split at the spaces into an array\n\tarr = strings.Split(input, \" \")\n\n\treturn\n}\n\n// Get Space-separated Line as Integers\n// Any non-valid integers will be 0\n//\n// Example input:\n// test 1 12.3 -117\n// Example output:\n// [0, 1, 0, -117]\n\nfunc gsli(reader *bufio.Reader) (arr []int) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.Atoi(e)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Get Space-separated Line as 64-bit Floats\n// Any non-valid floats will be 0\n//\n// Example input:\n// test 128.328 12 -11.0\n// Example output:\n// [0, 128.328, 12, -11]\n\nfunc gslf(reader *bufio.Reader) (arr []float64) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.ParseFloat(e, 64)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// String helpers\n\n// Is Lowercase\n// Given some string[i], return whether it is lower case or not.\n\nfunc isl(b byte) bool {\n\tvar r rune\n\tr = rune(b)\n\treturn unicode.IsLower(r)\n}\n\n// Math helpers\n\n// Positve Modulo\n// Returns x mod y, but always positive\n\nfunc posMod(x, y int) int {\n\treturn (x%y + y) % y\n}\n\n// Max Int\n// Returns the max of two ints\n\nfunc maxInt(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\n// Distance formule\n// Calculates the distance to the origin\n\nfunc dist(x, y float64) float64 {\n\treturn math.Sqrt(math.Pow(x, 2) + math.Pow(y, 2))\n}\n\n// Output helpers\n\nfunc yes() {\n\tfmt.Println(\"Yes\")\n}\n\nfunc no() {\n\tfmt.Println(\"No\")\n}\n\n// Debug helpers\n\n// From https://groups.google.com/forum/#!topic/golang-nuts/Qlxs3V77nss\n\nfunc dbg(s string, a ...interface{}) {\n\tif debug {\n\t\tfmt.Printf(s, a...)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "ea5414b8b984f988ee6b991035125947", "src_uid": "7e614526109a2052bfe7934381e7f6c2", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tl := []int{0, 0, 0}\n\tfmt.Scan(&l[0], &l[1], &l[2])\n\tr := l[0] + l[1] - l[2]\n\tfor _, x := range l {\n\t\tif r > x {\n\t\t\tr = x\n\t\t}\n\t}\n\tfmt.Println(r)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "f647413f3d9fd9510e6d250b2afe28c8", "src_uid": "7e614526109a2052bfe7934381e7f6c2", "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\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tinit := scanner.Text()\n\theights := strings.Split(init, \" \")\n\n\tcater, _ := strconv.Atoi(heights[0])\n\tapple, _ := strconv.Atoi(heights[1])\n\n\tscanner.Scan()\n\tinput := scanner.Text()\n\tins := strings.Split(input, \" \")\n\n\tupS, _ := strconv.Atoi(ins[0])\n\tdS, _ := strconv.Atoi(ins[1])\n\n\tdiffDay := (upS - dS) * 12\n\tdays := 0\n\t// lets move for day1 first\n\tcater = (cater + 8*upS)\n\tif cater >= apple {\n\t\tfmt.Println(days)\n\t\treturn\n\t}\n\tif dS >= upS {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfor {\n\t\tif cater >= apple {\n\t\t\tfmt.Println(days)\n\t\t\treturn\n\t\t}\n\n\t\tdays++\n\t\tcater += diffDay\n\t}\n\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "40a90d06a476548e11af6c669bf078b8", "src_uid": "2c39638f07c3d789ba4c323a205487d7", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t// \"sort\"\n\t// \"strings\"\n)\n\nvar (\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\th1, h2 := nextInt(), nextInt()\n\ta, b := nextInt(), nextInt()\n\n\th1 += a * 8\n\n\tif a <= b {\n\t\tif h1 < h2 {\n\t\t\tprintln(-1)\n\t\t\treturn\n\t\t}\n\t}\n\n\tday := 0\n\n\tfor h1 < h2 {\n\t\th1 += (a - b) * 12\n\t\tday++\n\t}\n\n\tprintln(day)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "e4f54ab96941c02dcdafb4a44ec459c5", "src_uid": "2c39638f07c3d789ba4c323a205487d7", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc modPow(x, n, p int64) int64 {\n\tres := int64(1)\n\tfor n != 0 {\n\t\tif n%2 == 1 {\n\t\t\tres = res * x % p\n\t\t}\n\t\tx = x * x % p\n\t\tn >>= 1\n\t}\n\treturn res\n}\n\nfunc comb(n, m, p int64) int64 {\n\tif m > n {\n\t\treturn 0\n\t}\n\tret := int64(1)\n\tm = min(n-m, m)\n\tfor i := int64(1); i <= m; i++ {\n\t\ta := (n + i - m) % p\n\t\tb := i % p\n\t\tret = ret * (a * modPow(b, p-2, p) % p) % p\n\t}\n\treturn ret\n}\n\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc lucas(n, m, p int64) int64 {\n\tif m == 0 {\n\t\treturn 1\n\t}\n\treturn comb(n%p, m%p, p) * lucas(n/p, m/p, p) % p\n}\n\nconst (\n\tmod = int64(998244353)\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tt := 1\n\t//fmt.Fscanf(in, \"%d\\n\", &t)\n\tfor tt := 0; tt < t; tt++ {\n\t\tn, m := int64(0), int64(0)\n\t\tfmt.Fscanf(in, \"%d %d\\n\", &n, &m)\n\t\tans := lucas(m, n-1, mod)\n\t\tans *= (n - 2)\n\t\tans %= mod\n\t\tfor i := int64(0); i < n-3; i++ {\n\t\t\tans *= 2\n\t\t\tans %= mod\n\t\t}\n\t\tfmt.Fprintf(out, \"%d\\n\", ans)\n\t}\n\treturn\n}\n\nfunc getMi(a int64) int64 {\n\tif a == 1 {\n\t\treturn 0\n\t}\n\treturn 1 + getMi(a/2)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "1913d531bf8652b5c6d1b55970ad9ec7", "src_uid": "28d6fc8973a3e0076a21c2ea490dfdba", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\nfunc getInts() []int64 {\n\t//assumes POSITIVE INTEGERS. Check v for '-' if you have negative.\n\tvar buf []byte\n\tbuf, _ = ioutil.ReadAll(os.Stdin)\n\tvar ints []int64\n\tnum := int64(0)\n\tfound := false\n\tfor _, v := range buf {\n\t\tif '0' <= v && v <= '9' {\n\t\t\tnum = 10*num + int64(v-'0') //could use bitshifting here.\n\t\t\tfound = true\n\t\t} else if found {\n\t\t\tints = append(ints, num)\n\t\t\tfound = false\n\t\t\tnum = 0\n\t\t}\n\t}\n\tif found {\n\t\tints = append(ints, num)\n\t\tfound = false\n\t\tnum = 0\n\t}\n\treturn ints\n}\n\nconst mod = 998244353\n\nfunc binpow(a, n uint64) (res uint64) {\n\tres = 1\n\tfor n != 0 {\n\t\tif (n & 1) != 0 {\n\t\t\tres *= a\n\t\t\tres %= mod\n\t\t}\n\t\ta *= a\n\t\ta %= mod\n\t\tn >>= 1\n\t}\n\treturn res\n}\n\n// http://e-maxx.ru/algo/reverse_element\nfunc inv(a uint64) uint64 {\n\treturn binpow(a, mod-2)\n}\n\nfunc main() {\n\tints := getInts()\n\n\tn := uint64(ints[0])\n\tm := uint64(ints[1])\n\n\tif n-1 > m {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tif n == 2 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tans := uint64(1)\n\n\t// C(m, n-1)\n\tfor i := m; i > n-1; i-- {\n\t\tans *= uint64(i)\n\t\tans %= mod\n\t}\n\tfor i := m - (n - 1); i > 1; i-- {\n\t\tans *= inv(i)\n\t\tans %= mod\n\t}\n\n\t// * 2^(n-3)\n\tans *= binpow(2, n-3)\n\tans %= mod\n\n\t// * (n-2)\n\tans *= n - 2\n\tans %= mod\n\n\tfmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "63477f5c5272620918b211ce89a64cf4", "src_uid": "28d6fc8973a3e0076a21c2ea490dfdba", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\nimport \"bufio\"\nimport \"os\"\nimport \"sort\"\n \nvar input *bufio.Reader\n\nconst N = 200005\n\ntype arrs []int\n\nfunc (arr arrs) Len() int{\n\treturn len(arr)\n}\n\nfunc (arr arrs) Less(i, j int) bool {\n\treturn arr[i] < arr[j]\n}\n\nfunc (arr arrs) Swap(i, j int) {\n\tarr[i], arr[j] = arr[j], arr[i]\n}\n\nfunc main(){\n\tinput = bufio.NewReader(os.Stdin)\n\n\tvar k,n int\n\tfmt.Fscanf(input, \"%d%d\\n\", &n, &k)\n\n\tarr := make([]arrs, N)\n\tfor i:=0; i=0; x/=2 {\n\t\t\tarr[x] = append(arr[x], cnt)\n\t\t\tcnt++\n\t\t\tif x==0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tans := n*30\n\tfor i:=0; i 0 {\n\t\t\t// reversed binary representation of the value\n\t\t\tdigits = append(digits, v%2)\n\t\t\tv = v / 2\n\t\t}\n\n\t\taddToTree(root, digits, len(digits))\n\n\t}\n\n\tprintInt(search(root, k))\n\n}\n\nfunc search(node *nodeType, k int) int {\n\n\tif node == nil || node.cnt < k {\n\t\treturn 1000000000 // INF\n\t}\n\n\ts0 := 0\n\trem := k - node.cuts[0] // how many equal values do we need more\n\tfor i := 1; rem > 0 && i < 20; i++ {\n\t\tif rem > node.cuts[i] {\n\t\t\ts0 += node.cuts[i] * i\n\t\t\trem -= node.cuts[i]\n\t\t} else {\n\t\t\ts0 += rem * i\n\t\t\trem = 0\n\t\t}\n\t}\n\n\ts1, s2 := search(node.next[0], k), search(node.next[1], k)\n\n\treturn min(s0, min(s1, s2))\n\n}\n\nfunc addToTree(node *nodeType, digits []int, idx int) {\n\n\tnode.cnt++\n\tnode.cuts[idx]++\n\n\tidx--\n\tif idx < 0 {\n\t\treturn\n\t}\n\n\tnext := node.next[digits[idx]]\n\tif next == nil {\n\t\tnode.next[digits[idx]] = &nodeType{}\n\t\tnext = node.next[digits[idx]]\n\t}\n\n\taddToTree(next, digits, idx)\n\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n/* stubs */\n\nfunc main() {\n\n\tvar f *os.File\n\tif runtime.GOROOT() == \"C:\\\\Soft\\\\Go\" {\n\t\tf, _ = os.Open(\"input.txt\")\n\t\tdefer f.Close()\n\t} else {\n\t\tf = os.Stdin\n\t}\n\n\twriter = bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\treader = bufio.NewScanner(f)\n\n\tconst maxCapacity = 1024 * 1024\n\tbuf := make([]byte, maxCapacity)\n\treader.Buffer(buf, maxCapacity)\n\n\treader.Split(bufio.ScanWords)\n\n\tsolve()\n\n}\n\nvar reader *bufio.Scanner\nvar writer *bufio.Writer\n\nfunc read() string {\n\treader.Scan()\n\treturn reader.Text()\n}\n\nfunc readInt() int {\n\treader.Scan()\n\tret, _ := strconv.Atoi(reader.Text())\n\treturn ret\n}\n\nfunc print(s string) {\n\twriter.WriteString(s)\n\twriter.WriteString(\"\\n\")\n}\n\nfunc printInt(i int) {\n\tprint(strconv.Itoa(i))\n}\n\nfunc printInt64(i int64) {\n\tprint(strconv.FormatInt(i, 10))\n}\n\nfunc readInt64() int64 {\n\treader.Scan()\n\tret, _ := strconv.ParseInt(reader.Text(), 10, 64)\n\treturn ret\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "da00f914b0e0642be3fb3bcf74538117", "src_uid": "ed1a2ae733121af6486568e528fe2d84", "difficulty": 1500.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var comb [31][31]int64\n for i := 0; i <= 30; i++ { comb[i][0] = 1 }\n for i := 1; i <= 30; i++ {\n for j := 1; j <= i; j++ {\n comb[i][j] = comb[i-1][j]+comb[i-1][j-1]\n }\n }\n var n,m,t int64\n fmt.Scan(&n,&m,&t)\n ans := int64(0)\n for b := int64(4); b <= n; b++ {\n for g := int64(1); g <= m; g++ {\n if (b+g) == t {\n ans += comb[n][b]*comb[m][g]\n }\n }\n }\n fmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "dd30fffa9a8ccda02a7c1ac7826d8466", "src_uid": "489e69c7a2fba5fac34e89d7388ed4b8", "difficulty": 1400.0} {"lang": "Go", "source_code": "// 131C-mic_rizal\npackage main\n\nimport (\n \"fmt\"\n)\n\nfunc c(n, r int64) int64 {\n var i int64\n if r > n {\n return 0\n }\n a := int64(1)\n for i = r + 1; i <= n; i++ {\n a *= i\n a /= (i - r)\n }\n return a\n}\n\nfunc main() {\n var n, m, t, a, i int64\n fmt.Scan(&n, &m, &t)\n for i = 4; i < t; i++ {\n a += c(n, i) * c(m, t-i)\n }\n fmt.Println(a)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "fd0c47618822e9ba2dfe235e6cc4e3fa", "src_uid": "489e69c7a2fba5fac34e89d7388ed4b8", "difficulty": 1400.0} {"lang": "Go", "source_code": "// 131C\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc c(n int64, k int64) int64 {\n\tvar i, r int64\n\tr = 1\n\tfor i = 1; i <= k; i++ {\n\t\tr = r * (n - k + i)\n\t\tr = r / i\n\t}\n\treturn r\n}\n\nfunc main() {\n\tvar i, n, m, t, tot int64\n\ttot = 0\n\tfmt.Scan(&n, &m, &t)\n\tfor i = 4; i < t; i++ {\n\t\ttot = tot + c(n, i)*c(m, t-i)\n\t}\n\tfmt.Println(tot)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "6584b3f7f187b56bdef77728a2787373", "src_uid": "489e69c7a2fba5fac34e89d7388ed4b8", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\n\nfunc main(){\n\tvar n, m, t int\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tn, _ = strconv.Atoi(r.Text())\n\tr.Scan()\n\tm, _ = strconv.Atoi(r.Text())\n\tr.Scan()\n\tt, _ = strconv.Atoi(r.Text())\n\tpa1, pa2, num := 0, 0, 0\n\tfor i:=4; i s {\n\t\t\tpos--\n\t\t}\n\t\tresult = append(result, f[pos])\n\t\ts -= f[pos]\n\t}\n\twriter.WriteString(fmt.Sprintf(\"%d\\n%d\", len(result), result[0]))\n\tfor i := 1; i != len(result); i++ {\n\t\twriter.WriteString(fmt.Sprintf(\" %d\", result[i]))\n\t}\n\twriter.WriteString(\"\\n\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "37f49195bb66d7bcd447d9657c372f3a", "src_uid": "da793333b977ed179fdba900aa604b52", "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\n\ts, k := int64(scanInt(scanner)), scanInt(scanner)\n\tf := []int64{1}\n\tfor f[len(f)-1] < s {\n\t\tx, count := int64(0), 0\n\t\tfor i := len(f)-1; i != -1 && count != k; i-- {\n\t\t\tx += f[i]\n\t\t\tcount++\n\t\t}\n\t\tf = append(f, x)\n\t}\n\tresult := []int64{}\n\tpos := len(f)-1\n\tfor s != 0 {\n\t\tfor f[pos] > s {\n\t\t\tpos--\n\t\t}\n\t\tresult = append(result, f[pos])\n\t\ts -= f[pos]\n\t}\n\twriter.WriteString(fmt.Sprintf(\"%d\\n0\", len(result)))\n\tfor i := 0; i != len(result); i++ {\n\t\twriter.WriteString(fmt.Sprintf(\" %d\", result[i]))\n\t}\n\twriter.WriteString(\"\\n\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "42e6c970d45874e61ca0c9977e245250", "src_uid": "da793333b977ed179fdba900aa604b52", "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\n\ts, k := int64(scanInt(scanner)), scanInt(scanner)\n\tf := []int64{1}\n\tfor f[len(f)-1] < s {\n\t\tx, count := int64(0), 0\n\t\tfor i := len(f)-1; i != -1 && count != k; i-- {\n\t\t\tx += f[i]\n\t\t\tcount++\n\t\t}\n\t\tf = append(f, x)\n\t}\n\tresult := []int64{}\n\tpos := len(f)-1\n\tfor s != 0 {\n\t\tfor f[pos] > s {\n\t\t\tpos--\n\t\t}\n\t\tresult = append(result, f[pos])\n\t\ts -= f[pos]\n\t}\n\twriter.WriteString(fmt.Sprintf(\"%d\\n0\", len(result)+1))\n\tfor i := 0; i != len(result); i++ {\n\t\twriter.WriteString(fmt.Sprintf(\" %d\", result[i]))\n\t}\n\twriter.WriteString(\"\\n\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "c89f0173e22d85458925025bbcb5bfc8", "src_uid": "da793333b977ed179fdba900aa604b52", "difficulty": 1600.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(int64 a, int64 b) 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": true, "code_uid": "bade7e44accf508303ceb84b6847139c", "src_uid": "1f9107e8d1d8aebb1f4a1707a6cdeb6d", "difficulty": 1600.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\nvar DEBUG = true\n\nfunc main() {\n\tdefer Flush()\n\n\th := readi()\n\tw := readi()\n\n\tx := (h - 1) + (w - 1)\n\tans := 4\n\tp := INF3\n\tfor i := 0; i < x; i++ {\n\t\tans = ans * 2 % p\n\t}\n\tprintln(ans)\n\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[:len(b):len(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. Trailing '\\n' will not be included.\n// See also comments on readb()\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(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\nfunc dbgf(f string, args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc dbg(args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Utilities\n\nfunc sumSlice(a []int) int {\n\tvar res int\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc sumSlicell(a []int64) int64 {\n\tvar res int64\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc readInts(N int) (int, []int) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\treturn N, a\n}\n\nfunc readIntsll(N int) (int, []int64) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int64, N)\n\tfor i := range a {\n\t\ta[i] = readll()\n\t}\n\treturn N, a\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 minf(a, b float64) float64 {\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 maxf(a, b float64) float64 {\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\nfunc absf(a float64) float64 {\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", "lang_cluster": "Go", "compilation_error": false, "code_uid": "8c79493a299528ef85f9d501079aa551", "src_uid": "8b2a9ae21740c89079a6011a30cd6aee", "difficulty": 1300.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\n\n\nfunc main() {\n\tvar n int;\n\tfmt.Scanf(\"%d\",&n)\n\ta := make([]int,50)\n\tvar i int\n\tvar tmp string\n\tfor i = 0;i < n;i++ {\n\t\tfor {\n\t\t\tfmt.Scanf(\"%s\",&tmp)\n\t\t\tif tmp == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif tmp != \"\\n\" {\n\t\t\t\ta[i] = (int)(tmp[0])\n\t\t\t\ttmp = \"\"\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tvar flag bool = false;\n\tfor i = 1;i < n;i++ {\n\t\tif(a[i] - a[i-1] >= 2 || a[i] - a[i-1] <= -2 ){\n\t\t\tflag = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Println(\"NO\");\n\t}else {\n\t\tfmt.Println(\"YES\");\n\t}\n\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "cc5633efd12c7a9c585ecc2de3ad0353", "src_uid": "704d0ae50bccaa8bc49319812ae0be45", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int;\n\tfmt.Scanf(\"%d\",&n)\n\ta := make([]int,50)\n\tvar i int;\n\tfor i = 0;i < n;i++ {\n\t\tfmt.Scanf(\"%d\",&a[i]);\n\t}\n\tvar flag bool = false;\n\tfor i = 1;i < n;i++{\n\t\tif(a[i] - a[i-1] >= 2){\n\t\t\tflag = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif flag {\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": "457f346143184471746a0b1f9c6dfd83", "src_uid": "704d0ae50bccaa8bc49319812ae0be45", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int;\n\tfmt.Scanf(\"%d\",&n)\n\ta := make([]int,50)\n\tvar i int;\n\tfor i = 0;i < n;i++ {\n\t\tfmt.Scanf(\"%d\",&a[i]);\n\t}\n\tvar flag bool = false;\n\tfor i = 1;i < n;i++{\n\t\tif(a[i] - a[i-1] >= 2 || a[i] - a[i-1] <= -2 ){\n\t\t\tflag = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif flag {\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": "b3f9895b7be37dfadcef296ca69ba83b", "src_uid": "704d0ae50bccaa8bc49319812ae0be45", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n\n\nfunc main() {\n\tvar n int;\n\tfmt.Scanf(\"%d\",&n)\n\ta := make([]int,50)\n\tvar i int\n\tvar tmp string\n\n\tfor i = 0;i < n;i++ {\n\t\tfor {\n\t\t\tfmt.Scanf(\"%s\",&tmp)\n\t\t\tif tmp == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif tmp != \"\\n\" {\n\t\t\t\ta[i] , _= strconv.Atoi(tmp)\n\t\t\t\ttmp = \"\"\n\t\t\t\t//fmt.Println(a[i])\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tvar flag bool = false;\n\tfor i = 1;i < n;i++ {\n\t\tif(a[i] - a[i-1] >= 2 || a[i] - a[i-1] <= -2 ){\n\n\t\t\tflag = true;\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Println(\"NO\");\n\t}else {\n\t\tfmt.Println(\"YES\");\n\t}\n\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "3fa9e78ef000376f703496a08e1afddb", "src_uid": "704d0ae50bccaa8bc49319812ae0be45", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc sum(k, num int64) int64 {\n\treturn num * ((k-1)+(k - num))/2 + 1\n}\n\nfunc run(n, k int64) {\n\tvar i, j, mid int64\n\ti, j = 1, k-1\n\tmid = (i + j) >> 1\n\tif sum(k, j) < n {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfor i < j {\n\t\tif sum(n, mid) > n {\n\t\t\tj = mid - 1\n\t\t} else {\n\t\t\ti = mid + 1\n\t\t}\n\t\tmid = (i + j) >> 1\n\t}\n\tfmt.Println(mid)\n}\n\nfunc main() {\n\tvar n, k int64\n\tfor _, err := fmt.Scanf(\"%d %d\", &n, &k); err == nil; _, err = fmt.Scanf(\"%d %d\", &n, &k) {\n\t\trun(n, k)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "c0b66daddb63dab6594b79d87c1aeba6", "src_uid": "83bcfe32db302fbae18e8a95d89cf411", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc sum(k, num int64) int64 {\n\treturn num * ((k-1)+(k - num))/2 + 1\n}\n\nfunc run(n, k int64) {\n\tvar i, j, mid int64\n\ti, j = 1, k-1\n\tmid = (i + j) >> 1\n\tif sum(k, j) < n {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfor i < j {\n\t\ts := sum(k, mid)\n\t\tif s >= n {\n\t\t\tj = mid\n\t\t} else {\n\t\t\ti = mid + 1\n\t\t}\n\t\tmid = (i + j) >> 1\n\t}\n\tfmt.Println(mid)\n}\n\nfunc main() {\n\tvar n, k int64\n\tfor _, err := fmt.Scanf(\"%d %d\", &n, &k); err == nil; _, err = fmt.Scanf(\"%d %d\", &n, &k) {\n\t\trun(n, k)\n\t}\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "780efd26b202396e920cc435eddaedca", "src_uid": "83bcfe32db302fbae18e8a95d89cf411", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc sum(k, num int64) int64 {\n\treturn num * k - (num - 1) * (num + 2) / 2\n\t//return num * ((k-1)+(k - num))/2 + 1\n}\n\nfunc run(n, k int64) {\n\tvar i, j, mid int64\n\ti, j = 0, k\n\tfor i < j {\n\t\tmid = (i + j) >> 1\n\t\ts := sum(k, mid)\n\t\tif s < n {\n\t\t\ti = mid + 1\n\t\t} else {\n\t\t\tj = mid\n\t\t}\n\t}\n\tmid = (i + j) >> 1\n\tif sum(k, mid) < n {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println((i + j) >> 1)\n\t}\n}\n\nfunc main() {\n\tvar n, k int64\n\tfor _, err := fmt.Scanf(\"%d %d\", &n, &k); err == nil; _, err = fmt.Scanf(\"%d %d\", &n, &k) {\n\t\trun(n, k)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "65f486ff47c525d09494e86fdb149266", "src_uid": "83bcfe32db302fbae18e8a95d89cf411", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc sum(k, num int64) int64 {\n\treturn num * ((k-1)+(k - num))/2 + 1\n}\n\nfunc run(n, k int64) {\n\tvar i, j, mid int64\n\ti, j = 0, k-1\n\tmid = (i + j) >> 1\n\tif sum(k, j) < n {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfor i < j {\n\t\ts := sum(k, mid)\n\t\tif s >= n {\n\t\t\tj = mid\n\t\t} else {\n\t\t\ti = mid + 1\n\t\t}\n\t\tmid = (i + j) >> 1\n\t}\n\tfmt.Println(mid)\n}\n\nfunc main() {\n\tvar n, k int64\n\tfor _, err := fmt.Scanf(\"%d %d\", &n, &k); err == nil; _, err = fmt.Scanf(\"%d %d\", &n, &k) {\n\t\trun(n, k)\n\t}\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "3496a63bbe1b19d3672bea68c094e6f8", "src_uid": "83bcfe32db302fbae18e8a95d89cf411", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int64\n\tfmt.Scanln(&n, &k)\n\tlo, hi := int64(0), k\n\tfor lo <= hi {\n\t\tx := (lo + hi) >> 1\n\t\tif (k+k-x-1)*x/2+1 >= n {\n\t\t\thi = x - 1\n\t\t} else {\n\t\t\tlo = x + 1\n\t\t}\n\t}\n\tif lo < k {\n\t\tfmt.Println(lo)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "1d309418d25e08d17bda3568fe2c3b3f", "src_uid": "83bcfe32db302fbae18e8a95d89cf411", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t// \"time\"\n)\n\nfunc main() {\n\t// defer func(start time.Time) {\n\t// \tfmt.Println(time.Since(start))\n\t// }(time.Now())\n\n\treader := bufio.NewReader(os.Stdin)\n\n\tvar s string\n\tfmt.Fscan(reader, &s)\n\tvar c uint8\n\tvar index, count int\n\n\t// fmt.Println(s)\n\tfor i:=0; i=1; i--{\n if board[i][pos_r.y] < 2 {\n board[i][pos_r.y] = 1\n }else{\n break\n }\n }\n for j:=pos_r.y+1; j<=8; j++{\n if board[pos_r.x][j] < 2 {\n board[pos_r.x][j] = 1\n }else{\n break\n }\n }\n for j:=pos_r.y-1; j>=1; j--{\n if board[pos_r.x][j] < 2 {\n board[pos_r.x][j] = 1\n }else{\n break\n }\n }\n}\n\nfunc is_valid(x int, y int) bool{\n if x>=1 && x<=8{\n return y>=1 && y<=8\n }\n return false\n}\n\nvar move_x = [3]int{-1, 0, 1}\nvar move_y = [3]int{-1, 0, 1}\n\nfunc mark_king(board *[9][9]int, pos_k pos){\n for i:=0; i<3; i++{\n for j:=0; j<3; j++{\n x:= pos_k.x+move_x[i]\n y:= pos_k.y+move_y[j]\n if !is_valid(x,y){\n continue\n }\n if board[x][y] >=2{\n continue\n }\n board[x][y] = 1\n }\n }\n}\n\nfunc Result(bk pos, board [9][9]int) string{\n for i:= 0; i<3; i++{\n for j:=0; j<3; j++{\n x:= bk.x + move_x[i]\n y:= bk.y + move_y[j]\n if x==0 && y==0{\n continue\n }\n if !is_valid(x,y){\n continue\n }\n if board[x][y] == 2{\n return \"OTHER\"\n }\n if board[x][y] == 0{\n return \"OTHER\"\n }\n }\n }\n return \"CHECKMATE\"\n}\n\nfunc main(){\n chess := map[string]pos{}\n toi := [9]byte{'a','b', 'c', 'd', 'e', 'f', 'g', 'h'}\n for k, letter := range toi{\n for j:=1; j<=8; j++{\n chess[string(letter) + strconv.Itoa(j)] = pos{k+1, j}\n }\n }\n board := [9][9]int{}\n var wr, wr2, wk, bk string\n fmt.Scanf(\"%s %s %s %s\", &wr, &wr2, &wk, &bk)\n pos_wr, _ := chess[wr]\n board[pos_wr.x][pos_wr.y] = 2 //rock\n pos_wr2, _ := chess[wr2]\n board[pos_wr2.x][pos_wr2.y] = 2 //rock\n pos_wking, _ := chess[wk]\n board[pos_wking.x][pos_wking.y] = 3 //white king\n pos_bking, _ := chess[bk]\n mark_rock(&board, pos_wr)\n mark_rock(&board, pos_wr2)\n mark_king(&board, pos_wking)\n //show(board)\n fmt.Println(Result(pos_bking, board)) \n}\n\nfunc show(board [9][9]int){\n for i:=1; i<=8; i++{\n for j:=1; j<=8; j++{\n fmt.Printf(\"%d,%d:%v \", i, j, board[i][j])\n }\n fmt.Printf(\"\\n\")\n }\n fmt.Println(\"---------------\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "2106dd88fe70a55597662dd1c4d4959a", "src_uid": "5d05af36c7ccb0cd26a4ab45966b28a3", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n \"strconv\"\n)\n\ntype pos struct{\n x int\n y int\n}\n\nfunc mark_rock(board *[9][9]int, pos_r pos){\n for i:=pos_r.x+1; i<=8; i++{\n if board[i][pos_r.y] < 2 {\n board[i][pos_r.y] = 1\n }else{\n break\n }\n }\n for i:=pos_r.x-1; i>=1; i--{\n if board[i][pos_r.y] < 2 {\n board[i][pos_r.y] = 1\n }else{\n break\n }\n }\n for j:=pos_r.y+1; j<=8; j++{\n if board[pos_r.x][j] < 2 {\n board[pos_r.x][j] = 1\n }else{\n break\n }\n }\n for j:=pos_r.y-1; j>=1; j--{\n if board[pos_r.x][j] < 2 {\n board[pos_r.x][j] = 1\n }else{\n break\n }\n }\n}\n\nfunc is_valid(x int, y int) bool{\n if x>=1 && x<=8{\n return y>=1 && y<=8\n }\n return false\n}\n\nvar move_x = [3]int{-1, 0, 1}\nvar move_y = [3]int{-1, 0, 1}\n\nfunc mark_king(board *[9][9]int, pos_k pos){\n for i:=0; i<3; i++{\n for j:=0; j<3; j++{\n x:= pos_k.x+move_x[i]\n y:= pos_k.y+move_y[j]\n if !is_valid(x,y){\n continue\n }\n if board[x][y] >=2{\n continue\n }\n board[x][y] = 1\n }\n }\n}\n\nfunc kingBlackCanBeat(bk pos, board [9][9]int) bool{\n for i:= 0; i<3; i++{\n for j:=0; j<3; j++{\n x:= bk.x + move_x[i]\n y:= bk.y + move_y[j]\n if !is_valid(x,y){\n continue\n }\n if board[x][y] == 2{\n return true\n }\n }\n }\n return false\n}\n\nfunc main(){\n chess := map[string]pos{}\n toi := [9]byte{'a','b', 'c', 'd', 'e', 'f', 'g', 'h'}\n for k, letter := range toi{\n for j:=1; j<=8; j++{\n chess[string(letter) + strconv.Itoa(j)] = pos{k+1, j}\n }\n }\n board := [9][9]int{}\n var wr, wr2, wk, bk string\n fmt.Scanf(\"%s %s %s %s\", &wr, &wr2, &wk, &bk)\n pos_wr, _ := chess[wr]\n board[pos_wr.x][pos_wr.y] = 2 //rock\n pos_wr2, _ := chess[wr2]\n board[pos_wr2.x][pos_wr2.y] = 2 //rock\n pos_wking, _ := chess[wk]\n board[pos_wking.x][pos_wking.y] = 3 //white king\n pos_bking, _ := chess[bk]\n mark_rock(&board, pos_wr)\n mark_rock(&board, pos_wr2)\n mark_king(&board, pos_wking)\n //show(board)\n result := \"OTHER\"\n if board[pos_bking.x][pos_bking.y] != 0 {\n result = \"CHECKMATE\"\n }\n if kingBlackCanBeat(pos_bking, board){\n result = \"OTHER\"\n }\n fmt.Println(result) \n}\n\nfunc show(board [9][9]int){\n for i:=1; i<=8; i++{\n for j:=1; j<=8; j++{\n fmt.Printf(\"%d,%d:%v \", i, j, board[i][j])\n }\n fmt.Printf(\"\\n\")\n }\n fmt.Println(\"---------------\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "1487dc18389d37eb86e3849b33dd50a7", "src_uid": "5d05af36c7ccb0cd26a4ab45966b28a3", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n \"strconv\"\n)\n\ntype pos struct{\n x int\n y int\n}\n\nvar whites = [9][9]int{}\n\nfunc mark_rock(board *[9][9]int, pos_r pos){\n for i:=pos_r.x+1; i<=8; i++{\n board[i][pos_r.y] += 1\n if whites[i][pos_r.y] != 0{\n break\n }\n }\n for i:=pos_r.x-1; i>=1; i--{\n board[i][pos_r.y] += 1\n if whites[i][pos_r.y] != 0{\n break\n }\n }\n for j:=pos_r.y+1; j<=8; j++{\n board[pos_r.x][j] += 1\n if whites[pos_r.x][j] != 0{\n break\n }\n }\n for j:=pos_r.y-1; j>=1; j--{\n board[pos_r.x][j] += 1\n if whites[pos_r.x][j] != 0{\n break\n }\n }\n}\n\nfunc is_valid(x int, y int) bool{\n if x>=1 && x<=8{\n return y>=1 && y<=8\n }\n return false\n}\n\nvar move_x = [3]int{-1, 0, 1}\nvar move_y = [3]int{-1, 0, 1}\n\nfunc mark_king(board *[9][9]int, pos_k pos){\n for i:=0; i<3; i++{\n for j:=0; j<3; j++{\n x:= pos_k.x+move_x[i]\n y:= pos_k.y+move_y[j]\n if !is_valid(x,y){\n continue\n }\n board[x][y] += 1\n }\n }\n}\n\nfunc Result(wr1 pos, wr2 pos, bk pos, board [9][9]int) string{\n for i:= 0; i<3; i++{\n for j:=0; j<3; j++{\n x:= bk.x + move_x[i]\n y:= bk.y + move_y[j]\n if x==0 && y==0{\n continue\n }\n if !is_valid(x,y){\n continue\n }\n if board[x][y] == 0{\n return \"OTHER\"\n }\n if board[x][y] == 1 && whites[x][y] == 1{\n return \"OTHER\"\n } \n }\n }\n return \"CHECKMATE\"\n}\n\nfunc main(){\n chess := map[string]pos{}\n toi := [8]byte{'a','b', 'c', 'd', 'e', 'f', 'g', 'h'}\n for k, letter := range toi{\n for j:=1; j<=8; j++{\n chess[string(letter) + strconv.Itoa(j)] = pos{k+1, j}\n whites[k+1][j] = 0\n }\n }\n board := [9][9]int{}\n var wr, wr2, wk, bk string\n fmt.Scanf(\"%s %s %s %s\", &wr, &wr2, &wk, &bk)\n pos_wr, _ := chess[wr]\n board[pos_wr.x][pos_wr.y] = 1 //rock\n whites[pos_wr.x][pos_wr.y] = 1 //rock\n pos_wr2, _ := chess[wr2]\n board[pos_wr2.x][pos_wr2.y] = 1 //rock\n whites[pos_wr2.x][pos_wr2.y] = 1 //rock\n pos_wking, _ := chess[wk]\n board[pos_wking.x][pos_wking.y] = 1 //white king\n whites[pos_wking.x][pos_wking.y] = 2 //white king\n pos_bking, _ := chess[bk]\n\n mark_rock(&board, pos_wr)\n mark_rock(&board, pos_wr2)\n mark_king(&board, pos_wking)\n //show(board)\n fmt.Println(Result(pos_wr, pos_wr2, pos_bking, board))\n}\n\nfunc show(board [9][9]int){\n for i:=1; i<=8; i++{\n for j:=1; j<=8; j++{\n fmt.Printf(\"%d,%d:%v \", i, j, board[i][j])\n }\n fmt.Printf(\"\\n\")\n }\n fmt.Println(\"---------------\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "8839c7ba87333d2804cde30e064eb6e7", "src_uid": "5d05af36c7ccb0cd26a4ab45966b28a3", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n\t\"unicode/utf8\"\n)\n\nvar w *bufio.Writer\n\nvar sc *bufio.Scanner\n\nconst minus, zero byte = '-', '0'\n\nfunc nextInt() int {\n\tvar ans, fst int = 0, 0\n\tvar neg bool = false\n\tsc.Scan()\n\tif sc.Bytes()[0] == minus {\n\t\tfst = 1\n\t\tneg = true\n\t}\n\tfor _, j := range sc.Bytes()[fst:] {\n\t\tans = ans*10 + int(j-zero)\n\t}\n\tif neg == true {\n\t\tans = -ans\n\t}\n\treturn ans\n}\n\nfunc printInt(n int) {\n\tw.WriteString(strconv.Itoa(n) + \" \")\n}\n\n//two functions from go source:\nfunc isSpace(r rune) bool {\n\tif r <= '\\u00FF' {\n\t\t// Obvious ASCII ones: \\t through \\r plus space. Plus two Latin-1 oddballs.\n\t\tswitch r {\n\t\tcase ' ', '\\t', '\\n', '\\v', '\\f', '\\r', ':':\n\t\t\treturn true\n\t\tcase '\\u0085', '\\u00A0':\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\t// High-valued ones.\n\tif '\\u2000' <= r && r <= '\\u200a' {\n\t\treturn true\n\t}\n\tswitch r {\n\tcase '\\u1680', '\\u180e', '\\u2028', '\\u2029', '\\u202f', '\\u205f', '\\u3000':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc ScanWords(data []byte, atEOF bool) (advance int, token []byte, err error) {\n\t// Skip leading spaces.\n\tstart := 0\n\tfor width := 0; start < len(data); start += width {\n\t\tvar r rune\n\t\tr, width = utf8.DecodeRune(data[start:])\n\t\tif !isSpace(r) {\n\t\t\tbreak\n\t\t}\n\t}\n\tif atEOF && len(data) == 0 {\n\t\treturn 0, nil, nil\n\t}\n\t// Scan until space, marking end of word.\n\tfor width, i := 0, start; i < len(data); i += width {\n\t\tvar r rune\n\t\tr, width = utf8.DecodeRune(data[i:])\n\t\tif isSpace(r) {\n\t\t\treturn i + width, data[start:i], nil\n\t\t}\n\t}\n\t// If we're at EOF, we have a final, non-empty, non-terminated word. Return it.\n\tif atEOF && len(data) > start {\n\t\treturn len(data), data[start:], nil\n\t}\n\t// Request more data.\n\treturn 0, nil, nil\n}\n\nfunc main() {\n\n\tw = bufio.NewWriter(os.Stdout)\n\tsc = bufio.NewScanner(os.Stdin)\n\tsc.Split(ScanWords)\n\ttyme1, tyme2 := time.Date(nextInt(), time.Month(nextInt()), nextInt(), 0, 0, 0, 0, time.UTC),\n\t\ttime.Date(nextInt(), time.Month(nextInt()), nextInt(), 0, 0, 0, 0, time.UTC)\n\tans := int(tyme2.Sub(tyme1).Hours() / 24)\n\tif ans < 0 {\n\t\tans = -ans\n\t}\n\tprintInt(ans)\n\tw.Flush()\n\t//YOU FORGOT TO FLUSH!\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "6c525c63cb4f014296b2e5d9a94caf21", "src_uid": "bdf99d78dc291758fa09ec133fff1e9c", "difficulty": 1300.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\nimport \"os\"\n\nimport \"strconv\"\nimport \"strings\"\n\nfunc L(n int) int {\n\tif n==0 { return 0 }\n\tvar P=make([]int, n+1)\n\tvar C=make([]int, 10)\n\n\tfor i:=0; i < 10; i++ { P[i]=1 }\n\tfor i:=10; i <= n; i++ {\n\t\tm:=cyfry(i, C)\n\t\tmin:=-1\n\t\tfor j:=0; j < m; j++ {\n\t\t\tif C[j] > 0 {\n\t\t\t\tif min < 0 {\n\t\t\t\t\tmin=P[i-C[j]]\n\t\t\t\t} else {\n\t\t\t\t\tif P[i-C[j]] < min {\n\t\t\t\t\t\tmin=P[i-C[j]]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tP[i]=min+1\n\t}\n\treturn P[n]\n}\n\nfunc cyfry(n int, c []int) int {\n\tvar i int\n\tfor i=0; n > 0; i++ {\n\t\tc[i]=n%10\n\t\tn/=10\n\t}\n\treturn i\n}\n\nfunc min(a, b int) int {\n\tif a < b { return a }\n\treturn b\n}\n\nfunc main() {\n\tb:=make([]byte, 20)\n\tmax, _:=os.Stdin.Read(b)\n\ts:=strings.TrimRight(string(b)[0:max], \"\\r\\n\")\n\tn, _:=strconv.Atoi(s)\n\tfmt.Print(L(n))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "e0db176cb2437d013cb5e07b601ebd26", "src_uid": "fc5765b9bd18dc7555fa76e91530c036", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\nimport \"os\"\n\nimport \"strconv\"\nimport \"strings\"\n\nfunc L(n int) int {\n\tvar P=make([]int, n+1)\n\tvar C=make([]int, 10)\n\n\tfor i:=0; i < 10; i++ { P[i]=1 }\n\tfor i:=10; i <= n; i++ {\n\t\tm:=cyfry(i, C)\n\t\tmin:=-1\n\t\tfor j:=0; j < m; j++ {\n\t\t\tif C[j] > 0 {\n\t\t\t\tif min < 0 {\n\t\t\t\t\tmin=P[i-C[j]]\n\t\t\t\t} else {\n\t\t\t\t\tif P[i-C[j]] < min {\n\t\t\t\t\t\tmin=P[i-C[j]]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tP[i]=min+1\n\t}\n\treturn P[n]\n}\n\nfunc cyfry(n int, c []int) int {\n\tvar i int\n\tfor i=0; n > 0; i++ {\n\t\tc[i]=n%10\n\t\tn/=10\n\t}\n\treturn i\n}\n\nfunc min(a, b int) int {\n\tif a < b { return a }\n\treturn b\n}\n\nfunc main() {\n\tb:=make([]byte, 20)\n\tmax, _:=os.Stdin.Read(b)\n\ts:=strings.TrimRight(string(b)[0:max], \"\\r\\n\")\n\tn, _:=strconv.Atoi(s)\n\tfmt.Print(L(n))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "233f16d879bcf989d10c92a8ff2c4f89", "src_uid": "fc5765b9bd18dc7555fa76e91530c036", "difficulty": 1100.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\nimport \"os\"\n\nimport \"strconv\"\nimport \"strings\"\n\nfunc L(n int) int {\n\tif n==0 { return 0 }\n\tif n < 10 { return 1 }\n\n\tvar P=make([]int, n+1)\n\tvar C=make([]int, 10)\n\n\tfor i:=0; i < 10; i++ { P[i]=1 }\n\tfor i:=10; i <= n; i++ {\n\t\tm:=cyfry(i, C)\n\t\tmin:=-1\n\t\tfor j:=0; j < m; j++ {\n\t\t\tif C[j] > 0 {\n\t\t\t\tif min < 0 {\n\t\t\t\t\tmin=P[i-C[j]]\n\t\t\t\t} else {\n\t\t\t\t\tif P[i-C[j]] < min {\n\t\t\t\t\t\tmin=P[i-C[j]]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tP[i]=min+1\n\t}\n\treturn P[n]\n}\n\nfunc cyfry(n int, c []int) int {\n\tvar i int\n\tfor i=0; n > 0; i++ {\n\t\tc[i]=n%10\n\t\tn/=10\n\t}\n\treturn i\n}\n\nfunc min(a, b int) int {\n\tif a < b { return a }\n\treturn b\n}\n\nfunc main() {\n\tb:=make([]byte, 20)\n\tmax, _:=os.Stdin.Read(b)\n\ts:=strings.TrimRight(string(b)[0:max], \"\\r\\n\")\n\tn, _:=strconv.Atoi(s)\n\tfmt.Print(L(n))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "bfee89312cf396cfb23d773b4c1a0795", "src_uid": "fc5765b9bd18dc7555fa76e91530c036", "difficulty": 1100.0} {"lang": "Go", "source_code": "// Codeforces 635 E, with podskazki, done\npackage main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"strconv\"\n \"strings\"\n \"os\"\n)\n\nfunc miconv(s string) int64 {\n iret,err := strconv.ParseInt(s, 10, 64)\n if err != nil {\n fmt.Println(\"error in converting \" + s)\n }\n return iret\n}\n\nvar x int64\nvar pov int64\n\n\n\nfunc main() {\n // reading n\n in := bufio.NewReader(os.Stdin)\n s,err := in.ReadString('\\n')\n if err != nil {\n fmt.Println(\"first read failure\", err)\n }\n ss := strings.Split(strings.Trim(s,\" \\n\\r\"),\" \")\n x = miconv(ss[0])\n \n if x > 0 {\n x = x % 360\n } else {\n x = -(-x % 360)\n x = (x + 360) % 360\n }\n // fmt.Printf(\"converted x = %d\\n\", x)\n \n if x<=45 {\n pov = 0\n } else if x<=135 {\n pov = 1\n } else if x<=225 {\n pov = 2\n } else if x>=315 {\n pov = 0\n } else {\n pov = 3\n } \n\t\n\t// print result\n\tfmt.Printf(\"%d\\n\", pov)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "e92d4968220094defbd92fdcf9c3859e", "src_uid": "509db9cb6156b692557ba874a09f150e", "difficulty": 1800.0} {"lang": "Go", "source_code": "// Codeforces 635 E, with podskazki, done\npackage main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"strconv\"\n \"strings\"\n \"os\"\n)\n\nfunc miconv(s string) int64 {\n i,err := strconv.Atoi(s)\n if err != nil {\n fmt.Println(\"error in converting \" + s)\n }\n iret := int64(i)\n return iret\n}\n\nvar x int64\nvar pov int64\n\n\n\nfunc main() {\n // reading n\n in := bufio.NewReader(os.Stdin)\n s,err := in.ReadString('\\n')\n if err != nil {\n fmt.Println(\"first read failure\", err)\n }\n ss := strings.Split(strings.Trim(s,\" \\n\\r\"),\" \")\n x = miconv(ss[0])\n \n if x > 0 {\n x = x % 360\n } else {\n x = -(-x % 360)\n x = (x + 360) % 360\n }\n // fmt.Printf(\"converted x = %d\\n\", x)\n \n if x<=45 {\n pov = 0\n } else if x<=135 {\n pov = 1\n } else if x<=225 {\n pov = 2\n } else if x>=315 {\n pov = 0\n } else {\n pov = 3\n } \n\t\n\t// print result\n\tfmt.Printf(\"%d\\n\", pov)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "31670f9c3583778591ae05b8c2be095a", "src_uid": "509db9cb6156b692557ba874a09f150e", "difficulty": 1800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nconst mod int64 = 1e9 + 7\n\ntype matrix [][]int64\n\nfunc newMatrix(n int) matrix {\n\tmat := make(matrix, n)\n\tfor i := range mat {\n\t\tmat[i] = make([]int64, n)\n\t}\n\treturn mat\n}\n\nfunc newMatrixI(n int) matrix {\n\tmat := make(matrix, n)\n\tfor i := range mat {\n\t\tmat[i] = make([]int64, n)\n\t\tmat[i][i] = 1\n\t}\n\treturn mat\n}\n\nfunc (a matrix) mul(b matrix) matrix {\n\tc := newMatrix(len(a))\n\tfor i := range a {\n\t\tfor j := range b[0] {\n\t\t\tfor k, aik := range a[i] {\n\t\t\t\tc[i][j] += aik * b[k][j] % mod\n\t\t\t}\n\t\t\tc[i][j] %= mod\n\t\t}\n\t}\n\treturn c\n}\n\nfunc (a matrix) pow(k int64) matrix {\n\tres := newMatrixI(len(a))\n\tfor ; k > 0; k >>= 1 {\n\t\tif k&1 == 1 {\n\t\t\tres = res.mul(a)\n\t\t}\n\t\ta = a.mul(a)\n\t}\n\treturn res\n}\n\nfunc CF1117D(in io.Reader, out io.Writer) {\n\tn, m := int64(0), 0\n\tFscan(in, &n, &m)\n\tif n < int64(m) {\n\t\tFprint(out, 1)\n\t\treturn\n\t}\n\ta := newMatrix(m)\n\ta[0][0] = 1\n\ta[0][m-1] = 1\n\tfor i := 1; i < m; i++ {\n\t\ta[i][i-1] = 1\n\t}\n\tFprint(out, a.pow(n)[0][0])\n}\n\nfunc main() { CF1117D(os.Stdin, os.Stdout) }\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "3b677483160abc5928f3c9c6b2043570", "src_uid": "e7b9eec21d950f5d963ff50619c6f119", "difficulty": 2100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nconst mod int64 = 1e9 + 7\n\ntype matrix [][]int64\n\nfunc newMatrix(n int) matrix {\n\tmat := make(matrix, n)\n\tfor i := range mat {\n\t\tmat[i] = make([]int64, n)\n\t}\n\treturn mat\n}\n\nfunc newMatrixI(n int) matrix {\n\tmat := make(matrix, n)\n\tfor i := range mat {\n\t\tmat[i] = make([]int64, n)\n\t\tmat[i][i] = 1\n\t}\n\treturn mat\n}\n\nfunc (a matrix) mul(b matrix) matrix {\n\tc := newMatrix(len(a))\n\tfor i := range a {\n\t\tfor j := range b[0] {\n\t\t\tfor k, aik := range a[i] {\n\t\t\t\tc[i][j] += aik * b[k][j] % mod\n\t\t\t}\n\t\t\tc[i][j] %= mod\n\t\t}\n\t}\n\treturn c\n}\n\nfunc (a matrix) pow(k int64) matrix {\n\tres := newMatrixI(len(a))\n\tfor ; k > 0; k >>= 1 {\n\t\tif k&1 == 1 {\n\t\t\tres = res.mul(a)\n\t\t}\n\t\ta = a.mul(a)\n\t}\n\treturn res\n}\n\nfunc CF1117D(in io.Reader, out io.Writer) {\n\tvar n, m int64\n\tFscan(in, &n, &m)\n\tif n < m {\n\t\tFprint(out, 1)\n\t\treturn\n\t}\n\ta := newMatrix(int(m))\n\ta[0][0] = 1\n\ta[0][m-1] = 1\n\ta[m-1][0] = 1\n\tFprint(out, a.pow(n)[0][0])\n}\n\nfunc main() { CF1117D(os.Stdin, os.Stdout) }\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "b6296e09ef854ea803f253d65beac631", "src_uid": "e7b9eec21d950f5d963ff50619c6f119", "difficulty": 2100.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a int\n\tfmt.Scan(&a)\n\tif a == 1 {\n\t\tfmt.Println(1, 1)\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\tfmt.Println(2*(a-1), 2)\n\tfmt.Println(1, 2)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "3195320287974edd4b52596b4aa395ee", "src_uid": "5c000b4c82a8ecef764f53fda8cee541", "difficulty": 1400.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\tconst X = 1000001\n\tprev := make([]int, X)\n\tfor i := 0; i < X; i++ {\n\t\tprev[i] = 1\n\t}\n\tfor i := 2; i <= 10; i++ {\n\t\tcur := make([]int, X)\n\t\tcur[0] = 1\n\t\tfor j := 1; j < X; j++ {\n\t\t\tcur[j] = -1\n\t\t}\n\t\tfor j := 1; j < X; j++ {\n\t\t\tif j-i >= 0 && prev[j] != -1 {\n\t\t\t\tcur[j] = prev[j] + cur[j-i]\n\t\t\t} else {\n\t\t\t\tcur[j] = prev[j]\n\t\t\t}\n\t\t\tif cur[j] > 1e6 {\n\t\t\t\tcur[j] = -1\n\t\t\t}\n\t\t\tif cur[j] == n {\n\t\t\t\tfmt.Println(j, i)\n\t\t\t\tfor k := 1; k <= i; k++ {\n\t\t\t\t\tif k > 1 {\n\t\t\t\t\t\tfmt.Printf(\" %d\", k)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfmt.Printf(\"%d\", k)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfmt.Println()\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tprev = cur\n\t}\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc max(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\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": "1cf8644610668001e8e5871f144d7c8f", "src_uid": "5c000b4c82a8ecef764f53fda8cee541", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a int\n\tfmt.Scan(&a)\n\n\tvar n, m int = a - 1, 2\n\td := []int{1, 2}\n\n\tfmt.Printf(\"%d %d\\n\", n, m)\n\tfor _, v := range d {\n\t\tfmt.Printf(\"%d \", v)\n\t}\n\tfmt.Println()\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "64883e06b53eafc231880eb3e5a54489", "src_uid": "5c000b4c82a8ecef764f53fda8cee541", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a int\n\tfmt.Scan(&a)\n\n\tvar n, m int = 2 * (a - 1), 2\n\td := []int{1, 2}\n\n\tfmt.Printf(\"%d %d\\n\", n, m)\n\tfor _, v := range d {\n\t\tfmt.Printf(\"%d \", v)\n\t}\n\tfmt.Println()\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "eaa6e086cd37c8c6f123bb5f54170f06", "src_uid": "5c000b4c82a8ecef764f53fda8cee541", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tlength int\n\t\tstr string\n\t)\n\t\n\tfmt.Scanf(\"%d\\n\", &length)\n\tfmt.Scan(&str)\n\tpokemons := []string {\"vaporeon\", \"jolteon\", \"flareon\", \"espeon\", \"umbreon\", \"leafeon\", \"glaceon\", \"sylveon\"}\n\t\n\tsameLength := make([]string, 0)\n\tfor i := 0; i < len(pokemons); i++ {\n\t\tif len(pokemons[i]) == length {\n\t\t\tsameLength = append(sameLength, pokemons[i])\n\t\t\t\n\t\t}\n\t}\n\t\n\tfor j := 0; j < len(sameLength); j++ {\n\t\tfor i := 0; i < len(str); i++ {\n\t\t\tif (str[i] == sameLength[j][i] || str[i] == '.') && (i == (len(str) - 1)) {\n\t\t\t\tfmt.Println(sameLength[j])\n\t\t\t\treturn\n\t\t\t} else if (str[i] != sameLength[j][i]) && (str[i] != '.') {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "7e949beb13003787b31bf0eedf5246e3", "src_uid": "ec3d15ff198d1e4ab9fd04dd3b12e6c0", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\tlength int\n\t\tstr string\n\t)\n\n\tfmt.Scanf(\"%d\\n\", &length)\n\tfmt.Scan(&str)\n\tpokemons := []string{\"vaporeon\", \"jolteon\", \"flareon\", \"espeon\", \"umbreon\", \"leafeon\", \"glaceon\", \"sylveon\"}\n\n\tfor j := 0; j < len(pokemons); j++ {\n\t\tif len(pokemons[j]) != length {\n\t\t\tcontinue\n\t\t}\n\t\tfor i := 0; i < length; i++ {\n\t\t\t\n\t\t\tif str[i] == pokemons[j][i] || str[i] == '.' {\n\t\t\t\tif i == (length - 1) {\n\t\t\t\t\tfmt.Println(pokemons[j])\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "419bc74afcfaf1a59777f5708774dd5c", "src_uid": "ec3d15ff198d1e4ab9fd04dd3b12e6c0", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\nvar wrtr = bufio.NewWriterSize(os.Stdout, 10_000_000)\nvar rdr = bufio.NewScanner(os.Stdin)\nfunc gs() string { rdr.Scan(); return rdr.Text() }\nfunc gi() int { i,e := strconv.Atoi(gs()); if e != nil {panic(e)}; return i }\nfunc gis(n int) []int { res := make([]int,n); for i:=0;i 1 {\tinfn = os.Args[1] }\n\tif infn != \"\" {\tf, e := os.Open(infn); if e != nil { panic(e) }; rdr = bufio.NewScanner(f) }\n\trdr.Split(bufio.ScanWords); rdr.Buffer(make([]byte,1024),1_000_000_000)\n\t// PROGRAM STARTS HERE\n\tN,M := gi(),gi(); mask := ia(10); for i:=0;i> uint(k)) & 1 == 0 {\n\t\t\t\t\t\tg[(j | ((1< hi || lo > r {\n\t\treturn\n\t}\n\tmid := (lo + hi) / 2\n\tif val%2 == 1 && l <= mid && mid <= r {\n\t\tcnt++\n\t}\n\tdfs(lo, mid-1, val/2, l, r)\n\tdfs(mid+1, hi, val/2, l, r)\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 max(a, 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": false, "code_uid": "a37dfbfeafb252278f3b5e92c3395ab4", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "difficulty": 1600.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 := readInt64()\n\tl := readInt() - 1\n\tr := readInt() - 1\n\tif n == 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\ttmpn := int64(1)\n\treq := 0\n\tfor tmpn < n {\n\t\ttmpn <<= 1\n\t\treq = req*2 + 1\n\t}\n\tdfs(0, req-1, n, l, r)\n\tfmt.Println(cnt)\n}\n\nvar cnt int\n\nfunc dfs(lo int, hi int, val int64, l int, r int) {\n\tif val == 0 {\n\t\treturn\n\t}\n\tif l > hi || lo > r {\n\t\treturn\n\t}\n\tmid := (lo + hi) / 2\n\tif val%2 == 1 && l <= mid && mid <= r {\n\t\tcnt++\n\t}\n\tdfs(lo, mid-1, val/2, l, r)\n\tdfs(mid+1, hi, val/2, l, r)\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 max(a, 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": false, "code_uid": "3a055653caa9eea8639d5577a535fd60", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "difficulty": 1600.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 := readInt64()\n\tl := readInt() - 1\n\tr := readInt() - 1\n\tif n == 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\ttmpn := int64(1)\n\treq := 0\n\tfor tmpn < n {\n\t\ttmpn <<= 1\n\t\treq = req*2 + 1\n\t}\n\tdfs(0, req-1, n, l, r)\n\tfmt.Println(cnt)\n}\n\nvar cnt int\n\nfunc dfs(lo int, hi int, val int64, l int, r int) {\n\tif val == 0 {\n\t\treturn\n\t}\n\tmid := (lo + hi) / 2\n\tif val%2 == 1 && l <= mid && mid <= r {\n\t\tcnt++\n\t}\n\tdfs(lo, mid-1, val/2, l, r)\n\tdfs(mid+1, hi, val/2, l, r)\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 max(a, 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": false, "code_uid": "8f0838d234509475b9a1e6eb1c7d7059", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"bufio\"\n\t\"os\"\n)\n\nfunc get_len(n int64) int64 {\n\tif n > 1 {\n\t\treturn 2 * get_len(n/2) + 1\n\t}\n\treturn n\n}\n\nfunc max(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc solve(n, l, r int64) int64 {\n\tvar s int64\n\tif n > 0 {\n\t\tk := get_len(n / 2)\n\t\tif l < k {\n\t\t\ts += solve(n/2, l, min(r, k - 1))\n\t\t}\n\t\tif l <= k && k <= r {\n\t\t\ts += n % 2\n\t\t}\n\t\tif r > k {\n\t\t\ts += solve(n/2, max(l - k - 1, 0), r - k - 1)\n\t\t}\n\t\t// fmt.Printf(\"%d %d %d %d\\n\", n, k, l, r)\n\t}\n\treturn s\n}\n\nfunc main() {\n\tcin := NewParser(bufio.NewReaderSize(os.Stdin, 1<<16))\n\tn := cin.nextInt64()\n\tl := cin.nextInt64() - 1\n\tr := cin.nextInt64() - 1\n\tfmt.Printf(\"%v\", solve(n, l, r))\n}\n\n// some io\n\ntype ParserReader struct {\n\tr io.ByteReader\n\terr error\n\tc byte\n}\n\nfunc NewParser(r io.ByteReader) *ParserReader {\n\treturn &ParserReader{r, nil, 0}\n}\n\nfunc (p *ParserReader) next() error {\n\tp.c, p.err = p.r.ReadByte()\n\treturn p.err\n}\n\nfunc isDigit(c byte) bool {\n\treturn '0' <= c && c <= '9'\n}\n\nfunc (p *ParserReader) nextUInt64() uint64 {\n\tfor !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar r uint64\n\tfor isDigit(p.c) && p.err == nil {\n\t\tr = r*10 + uint64(p.c - '0')\n\t\tp.next()\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextUInt() uint {\n\tfor !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar r uint\n\tfor isDigit(p.c) && p.err == nil {\n\t\tr = r*10 + uint(p.c - '0')\n\t\tp.next()\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextInt64() int64 {\n\tfor p.c != '-' && !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar sign bool\n\tif p.c == '-' {\n\t\tsign = true\n\t}\n\tr := int64(p.nextUInt64())\n\tif sign {\n\t\treturn -r\n\t}\n\treturn r\n}\n\nfunc (p *ParserReader) nextInt() int {\n\tfor p.c != '-' && !isDigit(p.c) && p.err == nil {\n\t\tp.next()\n\t}\n\tvar sign bool\n\tif p.c == '-' {\n\t\tsign = true\n\t}\n\tr := int(p.nextUInt())\n\tif sign {\n\t\treturn -r\n\t}\n\treturn r\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "7a2f139ba299bb1bee845d1ff21bfcef", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "difficulty": 1600.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 := readInt64()\n\tl := readInt64() - 1\n\tr := readInt64() - 1\n\tif n == 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\ttmpn := int64(1)\n\tvar req int64\n\tfor tmpn <= n {\n\t\ttmpn <<= 1\n\t\treq = req*2 + 1\n\t}\n\tdfs(0, req-1, n, l, r)\n\tfmt.Println(cnt)\n}\n\nvar cnt int\n\nfunc dfs(lo int64, hi int64, val int64, l int64, r int64) {\n\tif val == 0 {\n\t\treturn\n\t}\n\tif l > hi || lo > r {\n\t\treturn\n\t}\n\tmid := (lo + hi) / 2\n\tif val%2 == 1 && l <= mid && mid <= r {\n\t\tcnt++\n\t}\n\tdfs(lo, mid-1, val/2, l, r)\n\tdfs(mid+1, hi, val/2, l, r)\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 max(a, 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": false, "code_uid": "928ed025961cd0ef9da572e9fb4fa80d", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n \"sort\"\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\nvar writer *bufio.Writer\nvar best int = -1\nvar g [][]int\nvar numRows, numCols int\n\nfunc permute(i int) {\n if i == numCols {\n xs := make([]int, numRows)\n for i := range g {\n x := 0\n for _, d := range g[i] {\n x = 10*x + d\n }\n xs[i] = x\n }\n sort.Ints(xs)\n diff := xs[numRows-1] - xs[0]\n if best == -1 || diff < best {\n best = diff\n }\n } else {\n permute(i+1)\n for j := i+1; j < numCols; j++ {\n for k := range g {\n g[k][i], g[k][j] = g[k][j], g[k][i]\n }\n permute(i+1)\n for k := range g {\n g[k][i], g[k][j] = g[k][j], g[k][i]\n }\n }\n }\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 numRows, numCols = getI(), getI()\n g = make([][]int, numRows)\n for i := range g {\n s := getS()\n g[i] = make([]int, numCols)\n for j := range g[i] {\n g[i][j] = int(s[j]-'0')\n }\n }\n permute(0)\n\n writer.WriteString(fmt.Sprintf(\"%d\\n\", best))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "86bc08698e06889fc42a367aca10cb79", "src_uid": "08f85cd4ffbd135f0b630235209273a4", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"io\"\n\t\"bufio\"\n)\nvar input io.Reader\n\nfunc main() {\n\tvar n, k int\n\tinput = bufio.NewReader(os.Stdin)\n\tfmt.Fscanln(input, &n, &k)\n\tl, r := 0, n\n\tfor l < r {\n\t\tmid := l + (r - l) / 2\n\t\td := k\n\t\tlines := mid\n\t\tfor lines < n && mid / d > 0 {\n\t\t\tlines += mid/d\n\t\t\td *= k\n\t\t}\n\t\tif lines < n {\n\t\t\tl = mid + 1\n\t\t} else {\n\t\t\tr = mid\n\t\t}\n\t}\n\n\tfmt.Println(r)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "92318c4e3c6fd0a06a1a031113815c9b", "src_uid": "41dfc86d341082dd96e089ac5433dc04", "difficulty": 1500.0} {"lang": "Go", "source_code": "\ufeffpackage main\nimport (\n\t\"fmt\"\n)\nfunc main() {\n\tvar n,k,l,h,m,t,ans,s int\n\tfmt.Scan(&n,&k)\n\tl=0\n\th=n\n\tfor l<=h {\n\t\tm=(l+h)>>1\n\t\tt=m\n\t\tans=m\n\t\tfor t!=0 {\n\t\t\tif t= n {\n\t\t\tgood = mid\n\t\t\tr = mid-1\n\t\t} else {\n\t\t\tl = mid+1\n\t\t}\n\t\tif l > r {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Print(good,\"\\n\")\n\t\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "42d740152149b9f4b724e94696027f5a", "src_uid": "41dfc86d341082dd96e089ac5433dc04", "difficulty": 1500.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\tscanner := bufio.NewScanner(os.Stdin)\n\n\tn, m := 0, 0\n\tif scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tfmt.Sscanf(line, \"%d %d\", &n, &m)\n\t}\n\n\tif scanner.Scan() {\n\t\tline := scanner.Text()\n\t\ttokens := strings.Fields(line)\n\t\tchildRequirement := make([]int, n)\n\n\t\tfor i := 0; i < n; i++ {\n\t\t\tchildRequirement[i], _ = strconv.Atoi(tokens[i])\n\t\t}\n\n\t\tchildGet := make([]int, n)\n\n\t\tlastChild := 0\n\t\tfor {\n\t\t\tfinishes := true\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tif childGet[i] < childRequirement[i] {\n\t\t\t\t\tchildGet[i] = childGet[i] + m\n\t\t\t\t\tlastChild = i\n\t\t\t\t}\n\n\t\t\t\tif childGet[i] < childRequirement[i] {\n\t\t\t\t\tfinishes = false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif finishes {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfmt.Println(lastChild + 1)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "ef9df4c4b5fef5449ba16552c8bf0d29", "src_uid": "c0ef1e4d7df360c5c1e52bc6f16ca87c", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m, a int\n\tfmt.Scan(&n)\n\tfmt.Scan(&m)\n\tvar z, t int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a)\n\t\tx := (a + m - 1) / m\n\t\tif x >= t {\n\t\t\tt = x\n\t\t\tz = i\n\t\t}\n\t}\n\tfmt.Println(z + 1)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "18528aa229a1c5198957827bac1e42ac", "src_uid": "c0ef1e4d7df360c5c1e52bc6f16ca87c", "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\nvar scanner = bufio.NewScanner(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tn, m := nextInt(), nextInt()\n\n\tmaxline, line, pos, a := 0, 0, 0, 0\n\n\tfor i := 0; i < n; i++ {\n\t\ta = nextInt()\n\n\t\tline = a / m\n\n\t\tif a % m > 0 {\n\t\t\tline++\n\t\t}\n\n\t\tif line >= maxline {\n\t\t\tmaxline = line\n\t\t\tpos = i\n\t\t}\n\t}\n\n\tprintln(pos + 1)\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\nfunc nextFloat() float64 {\n\tn, err := strconv.ParseFloat(next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n\nfunc print(a ...interface{}) {\n\tfmt.Fprint(writer, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\tfmt.Fprintf(writer, format, a...)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "a0bad62cc8dfa072777c172e35446b43", "src_uid": "c0ef1e4d7df360c5c1e52bc6f16ca87c", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, year int\n\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\n\tfor i := 1; a <= b; i++ {\n\t\ta = a * 3\n\t\tb = b * 2\n\t\tyear = i\n\t}\n\tfmt.Println(year)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "5e3a7f3a7f6789884e83a48c324dc4ee", "src_uid": "c0ef1e4d7df360c5c1e52bc6f16ca87c", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"strconv\"\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tN := sc.NextInt()\n\n\tfor i := int(math.Sqrt(float64(N))); i >= 1; i-- {\n\t\tif N % i == 0 {\n\t\t\tfmt.Println(i, N / i)\n\t\t\tbreak\n\t\t}\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": false, "code_uid": "db6363ce3e043a60c3d59e1c7b928608", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\n\tvar a, b int\n\ta = -1\n\n\tfor i:=1; i<=n; i++ {\n\t\tif (n%i == 0 && i <= (n/i)) {\n\n\t\t\tif (a == -1) {\n\t\t\t\ta = i\n\t\t\t\tb = n/i\n\t\t\t} else if ((n/i)-i < b-a) {\n\t\t\t\ta = i\n\t\t\t\tb = n/i\n\t\t\t}\n\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d %d\\n\", a, b)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "b4480093832376eb8d43ddebd0811646", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\n\ta := 1\n\tb := n\n\n\tfor x := 1; x*x <= n; x++ {\n\t\tif n%x == 0 {\n\t\t\ta = x\n\t\t\tb = n / x\n\t\t}\n\t}\n\n\tfmt.Println(a, b)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "8c003ef33f727ca47d3681d115a29911", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tvar r, c = 1, n\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tr, c = i, n/i\n\t\t}\n\t}\n\n\tfmt.Println(r, c)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "0608781e2f32f7b8723522391f6bbe3f", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\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, \"\\n\") == nil {\n\t\tsolve(n)\n\t}\n}\n\nfunc solve(n int) {\n\ta := int(math.Sqrt(float64(n)))\n\tif n == a*a {\n\t\tO(a, \" \")\n\t\tO(a, \"\\n\")\n\t\treturn\n\t}\n\tb := a + 1\n\tfor a*b != n {\n\t\tif a*b < n {\n\t\t\tb++\n\t\t} else {\n\t\t\ta--\n\t\t}\n\t}\n\tO(a, \" \")\n\tO(b, \"\\n\")\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "f62d991a777fe51c5244c5d17e1981e4", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\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\ta := int(math.Sqrt(float64(n)))\n\tb := n / a\n\tfor ; b * a != n; { \n\t\ta--\n\t\tb = n / a\n\t}\n\tfmt.Fprintln(w, a, b)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "d30b7764fd9d9638fee51fd0c8d5e9e2", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\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, \"\\n\") == nil {\n\t\tsolve(n)\n\t}\n}\n\nfunc solve(n int) {\n\ta := int(math.Sqrt(float64(n)))\n\tb := a\n\tfor a*b != n {\n\t\tif a*b < n {\n\t\t\tb++\n\t\t} else {\n\t\t\ta--\n\t\t}\n\t}\n\tO(a, \" \")\n\tO(b, \"\\n\")\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "f1ba664883b8abf3e7be62ab20042567", "src_uid": "f52af273954798a4ae38a1378bfbf77a", "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\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\tvar n int64\n\tfmt.Fscan(reader, &n)\n\tfmt.Fprintln(writer, n - (n / 2 + n / 3 + n / 5 + n / 7 - n / 6 - n / 10 - n / 14 - n / 15 - n / 21 - n / 35 + n / 30 + n / 42 + n / 70 + n / 105 - n / 210))\n}//2020-07-31 13:53:23.706", "lang_cluster": "Go", "compilation_error": false, "code_uid": "cda93aa4dce72c6d86cadd10e8db1af6", "src_uid": "e392be5411ffccc1df50e65ec1f5c589", "difficulty": 1500.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\t//input := bufio.NewScanner(os.Stdin)\n\tvar a, b, c, n int\n\tfmt.Scanf(\"%d%d%d%d\", &a, &b, &c, &n)\n\n\tif n-a-b+c < 1 || c > a || c > b || a > n || b > n {\n\t\tfmt.Printf(\"-1\\n\")\n\t} else {\n\t\tfmt.Printf(\"%d\\n\", n-a-b+c)\n\t}\n\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "a92be9336f4681f9c03f9c98588dfa5b", "src_uid": "959d56affbe2ff5dd999a7e8729f60ce", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport(\n\t\"fmt\"\n\t// \"sort\"\n\t\"os\"\n\t\"bufio\"\n\t// \"math\"\n\t// \"strconv\"\n\t// \"strings\"\n)\n\nfunc min(a,b int) int{\n\tif ab{\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc toInt(buf []byte) (o int) {\n for _, v := range buf {\n o = o*10 + int(v-'0')\n }\n return\n}\n\ntype pair struct {\n\tfirst int\n\tsecond int\n}\n\ntype pairs []pair\n\nfunc (a pairs) Len() int {return len(a)}\nfunc (a pairs) Swap(i,j int) {a[i], a[j] = a[j], a[i]}\nfunc (a pairs) Less(i,j int) bool {\n\treturn a[i].first < a[j].first\n\tif a[i].first > a[j].first {\n\t\treturn false\n\t}\n\treturn a[i].second <= a[j].second\n}\n\nvar MD int64 = 1000000007\nvar f map[int]int\n\nfunc deg(d int) int64 {\n\tif d == 0 {\n\t\treturn 1\n\t}\n\tt := deg(d / 2)\n\tt *= t\n\tt %= MD\n\tif d % 2 == 1 {\n\t\tt = t * 2 % MD\n\t}\n\treturn t\n}\n\nfunc calc(x int) int {\n\tif val, exists := f[x]; exists {\n\t\treturn val\n\t}\n\tres := int(deg(x - 1))\n\tfor i:= 2;i * i <= x; i++ {\n\t\tif x % i == 0 {\n\t\t\tfirst := i\n\t\t\tsecond := x / i\n\t\t\tres = res - calc(x / first)\n\t\t\tif res < 0 {\n\t\t\t\tres += 1000000007\n\t\t\t}\n\t\t\tif second != first {\n\t\t\t\tres = res - calc(x / second)\n\t\t\t\tif res < 0 {\n\t\t\t\t\tres += 1000000007\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tres = res - 1\n\tif res < 0 {\n\t\tres += 1000000007\n\t}\n\tf[x] = res\n\treturn res\n}\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tvar x,y int\n\tf = make(map[int]int)\n\tf[1] = 1\n\tfmt.Fscanf(in, \"%d %d\\n\", &x, &y)\n\tif y % x != 0 {\n\t\tfmt.Println(0)\n\t\tos.Exit(0)\n\t}\n\ty /= x\n\tfmt.Println(calc(y))\n}\n\n\n\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "26d549229af9a380a41d7e1751123570", "src_uid": "de7731ce03735b962ee033613192f7bc", "difficulty": 2000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, k, cnt int\n\n\tfmt.Scanln(&n, &k)\n\n\tif ((n - k) <= (k - 1)) && (n > 2) {\n\t\tcnt = (3 * n) + (n - k)\n\t} else if ((n - k) > (k - 1)) && (n > 2) {\n\t\tcnt = (3 * n) + (k - 1)\n\t} else {\n\t\tcnt = 3 * n\n\t}\n\n\tfmt.Println(cnt)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "356aa4e0159475ee4c14d111ce62980d", "src_uid": "24b02afe8d86314ec5f75a00c72af514", "difficulty": 1000.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, k, res int\n\tfmt.Fscan(reader, &n, &k)\n\tif k == 1 || k == n {\n\t\tres = 3 * n\n\t} else {\n\n\t\tres = 3*n + min(k-1, n-k)\n\t}\n\tfmt.Printf(\"%d\", res)\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}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "ea2b2df0ee6beabd2d0aa8f957d323a4", "src_uid": "24b02afe8d86314ec5f75a00c72af514", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tbuf := bufio.NewReader(os.Stdin)\n\n\tvar n, k int\n\tfmt.Fscanf(buf, \"%d %d\\n\", &n,&k)\n\n\tstep := n-k\n\tif step > k-1{\n\t\tstep = k-1\n\t}\n\tfmt.Printf(\"%d\\n\",3*n+step)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "6b0bade1be83add408089a335a32ccbe", "src_uid": "24b02afe8d86314ec5f75a00c72af514", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\n\nfunc main() {\n\tvar total int\n\tvar current int\n\tvar left, right, max, min int\n\tvar totalMoves int\n\tfmt.Scanln(&total, ¤t)\n\tleft = current - 1\n\tright = total - current\n\tmin, max = minMax(left, right)\n\ttotalMoves = min * 2 + max + total *2 + 1\n\tfmt.Println(totalMoves)\n}\n\nfunc minMax(a int, b int) (int, int){\n\tif a y {\n\t\treturn x\n\t}\n\treturn y\n}\n\n// Distance formule\n// Calculates the distance to the origin\n\nfunc dist(x, y float64) float64 {\n\treturn math.Sqrt(math.Pow(x, 2) + math.Pow(y, 2))\n}\n\n// Output helpers\n\nfunc yes() {\n\tfmt.Println(\"Yes\")\n}\n\nfunc no() {\n\tfmt.Println(\"No\")\n}\n\n// Debug helpers\n\n// From https://groups.google.com/forum/#!topic/golang-nuts/Qlxs3V77nss\n\nfunc dbg(s string, a ...interface{}) {\n\tif debug {\n\t\tfmt.Printf(s, a...)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "b0715b37b06f258c8fa34484f9f1db3f", "src_uid": "5551742f6ab39fdac3930d866f439e3e", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n var n int\n fmt.Scan(&n)\n fmt.Println(n/2+1)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "2757d12789997539c45e9451410f9a80", "src_uid": "5551742f6ab39fdac3930d866f439e3e", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nvar x int\n\nfunc main() {\n\tfmt.Scanf(\"%d\", &x)\n\tfmt.Println(x/2 + 1)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "d954be7e4572a8bc53920ae6a1e29615", "src_uid": "5551742f6ab39fdac3930d866f439e3e", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar t int\n\tfmt.Scan(&t)\n\tfmt.Print(t/2 + 1)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "bac08c0ea8d9772f6f1b55ae8ed4cf3c", "src_uid": "5551742f6ab39fdac3930d866f439e3e", "difficulty": 800.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\tfmt.Println(n/2 + 1)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "e5c63b5062d4383adaf915af9fa14227", "src_uid": "5551742f6ab39fdac3930d866f439e3e", "difficulty": 800.0} {"lang": "Go", "source_code": "// Codeforces 785 B Anton and Classes done\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"strings\"\n\t\"strconv\"\n\t\"os\"\n\t\"sort\"\n)\nvar in *bufio.Reader\n\nfunc readFive() (int,int,int,int,int) {\n\tvar a [5]int\n\ts, err := in.ReadString('\\n')\n\tif err != nil {\n\t\tfmt.Println(\"first read failure\", err)\n\t\tpanic(err)\n\t}\n\tss := strings.Split(strings.Trim(s, \" \\n\\r\"), \" \")\n\tfor i:=0; i= '0' && bytes[i] <= '9' {\n\t\ttmp = tmp*10 + int(bytes[i]-'0')\n\t\ti++\n\t}\n\t*val = tmp * sign\n\treturn i\n}\n\nfunc readNum(reader *bufio.Reader) (a int) {\n\tbs, _ := reader.ReadBytes('\\n')\n\treadInt(bs, 0, &a)\n\treturn\n}\n\nfunc readTwoNums(reader *bufio.Reader) (a int, b int) {\n\tres := readNNums(reader, 2)\n\ta, b = res[0], res[1]\n\treturn\n}\n\nfunc readThreeNums(reader *bufio.Reader) (a int, b int, c int) {\n\tres := readNNums(reader, 3)\n\ta, b, c = res[0], res[1], res[2]\n\treturn\n}\n\nfunc readNNums(reader *bufio.Reader, n int) []int {\n\tres := make([]int, n)\n\tx := 0\n\tbs, _ := reader.ReadBytes('\\n')\n\tfor i := 0; i < n; i++ {\n\t\tfor x < len(bs) && (bs[x] < '0' || bs[x] > '9') {\n\t\t\tx++\n\t\t}\n\t\tx = readInt(bs, x, &res[i])\n\t}\n\treturn res\n}\n\nfunc readUint64(bytes []byte, from int, val *uint64) int {\n\ti := from\n\n\tvar tmp uint64\n\tfor i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {\n\t\ttmp = tmp*10 + uint64(bytes[i]-'0')\n\t\ti++\n\t}\n\t*val = tmp\n\n\treturn i\n}\n\nfunc solve(N, H int) int64 {\n\tdp := make([][]int64, N+1)\n\tfp := make([][]int64, N+1)\n\tfor i := 0; i <= N; i++ {\n\t\tdp[i] = make([]int64, N+1)\n\t\tfp[i] = make([]int64, N+1)\n\t}\n\n\tfor h := 0; h <= N; h++ {\n\t\tdp[0][h] = 1\n\t}\n\n\tfor h := 1; h <= N; h++ {\n\t\tfor n := h; n <= N; n++ {\n\t\t\tfor x := 0; x < n; x++ {\n\t\t\t\tdp[n][h] += dp[x][h-1] * dp[n-1-x][h-1]\n\t\t\t}\n\t\t\tfp[n][h] = dp[n][h]\n\t\t\tdp[n][h] += dp[n][h-1]\n\t\t}\n\t}\n\tvar res int64\n\tfor h := H; h <= N; h++ {\n\t\tres += fp[N][h]\n\t}\n\n\treturn res\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "50c2e1147db126a40f854e4eeb49c324", "src_uid": "faf12a603d0c27f8be6bf6b02531a931", "difficulty": 1900.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\n\tN, H := readTwoNums(reader)\n\n\tfmt.Println(solve(N, H))\n}\n\nfunc readInt(bytes []byte, from int, val *int) int {\n\ti := from\n\tsign := 1\n\tif bytes[i] == '-' {\n\t\tsign = -1\n\t\ti++\n\t}\n\ttmp := 0\n\tfor i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {\n\t\ttmp = tmp*10 + int(bytes[i]-'0')\n\t\ti++\n\t}\n\t*val = tmp * sign\n\treturn i\n}\n\nfunc readNum(reader *bufio.Reader) (a int) {\n\tbs, _ := reader.ReadBytes('\\n')\n\treadInt(bs, 0, &a)\n\treturn\n}\n\nfunc readTwoNums(reader *bufio.Reader) (a int, b int) {\n\tres := readNNums(reader, 2)\n\ta, b = res[0], res[1]\n\treturn\n}\n\nfunc readThreeNums(reader *bufio.Reader) (a int, b int, c int) {\n\tres := readNNums(reader, 3)\n\ta, b, c = res[0], res[1], res[2]\n\treturn\n}\n\nfunc readNNums(reader *bufio.Reader, n int) []int {\n\tres := make([]int, n)\n\tx := 0\n\tbs, _ := reader.ReadBytes('\\n')\n\tfor i := 0; i < n; i++ {\n\t\tfor x < len(bs) && (bs[x] < '0' || bs[x] > '9') {\n\t\t\tx++\n\t\t}\n\t\tx = readInt(bs, x, &res[i])\n\t}\n\treturn res\n}\n\nfunc readUint64(bytes []byte, from int, val *uint64) int {\n\ti := from\n\n\tvar tmp uint64\n\tfor i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {\n\t\ttmp = tmp*10 + uint64(bytes[i]-'0')\n\t\ti++\n\t}\n\t*val = tmp\n\n\treturn i\n}\n\nfunc solve(N, H int) uint64 {\n\tdp := make([][]uint64, N+1)\n\n\tfor i := 0; i <= N; i++ {\n\t\tdp[i] = make([]uint64, N+1)\n\t}\n\t//\n\tfor h := 0; h <= N; h++ {\n\t\tdp[0][h] = 1\n\t}\n\n\n\tfor i := 1; i <= N; i++ {\n\t\tfor j := 1; j <= N; j++ {\n\t\t\tfor k := 0; k < i; k++ {\n\t\t\t\tdp[i][j] += dp[k][j-1] * dp[i-k-1][j-1]\n\t\t\t}\n\t\t}\n\t}\n\n\tres := dp[N][N] - dp[N][H-1]\n\n\treturn res\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "76487dd1531fc81c619e6329110310e5", "src_uid": "faf12a603d0c27f8be6bf6b02531a931", "difficulty": 1900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF101C(in io.Reader, out io.Writer) {\n\tvar x, y [3]int64\n\tfor i := 0; i < 3; i++ {\n\t\tFscan(in, &x[i], &y[i])\n\t}\n\td := x[2]*x[2] + y[2]*y[2]\n\tfor i := 0; i < 4; i++ {\n\t\tx[0], y[0] = y[0], -x[0]\n\t\tdx, dy := x[1]-x[0], y[1]-y[0]\n\t\td1, d2 := dx*x[2]+dy*y[2], dx*y[2]-dy*x[2]\n\t\tif d == 0 && dx == 0 && dy == 0 || d > 0 && d1%d == 0 && d2%d == 0 {\n\t\t\tFprint(out, \"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tFprint(out, \"NO\")\n}\n\nfunc main() { CF101C(os.Stdin, os.Stdout) }\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "19b973f1dabe11102c99d5976c37e8a0", "src_uid": "cc8a8af1ba2b19bf081e379139542883", "difficulty": 2000.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 CF101C(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar x, y [3]int64\n\tfor i := 0; i < 3; i++ {\n\t\tFscan(in, &x[i], &y[i])\n\t}\n\td := x[2]*x[2] + y[2]*y[2]\n\tfor i := 0; i < 4; i++ {\n\t\tx[0], y[0] = y[0], x[0]\n\t\ty[0] = -y[0]\n\t\tdx, dy := x[1]-x[0], y[1]-y[0]\n\t\td1, d2 := dx*x[2]+dy*y[2], dx*y[2]-dx*x[2]\n\t\tif d == 0 && dx == 0 && dy == 0 || d > 0 && d1%d == 0 && d2%d == 0 {\n\t\t\tFprint(out, \"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tFprint(out, \"NO\")\n}\n\nfunc main() { CF101C(os.Stdin, os.Stdout) }\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "58efb00b67ba92e589f1832989066ace", "src_uid": "cc8a8af1ba2b19bf081e379139542883", "difficulty": 2000.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 CF1152D(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tconst mod int = 1e9 + 7\n\tvar n int\n\tFscan(in, &n)\n\tf := [1001][1001]int{}\n\tf[0][0] = 1\n\tans := 0\n\tfor i := 1; i <= n; i++ {\n\t\tf[i][0] = f[i-1][0]\n\t\tif i&1 == 1 {\n\t\t\tans = (ans + f[i][0]) % mod\n\t\t}\n\t\tfor j := 1; j <= i; j++ {\n\t\t\tf[i][j] = (f[i-1][j] + f[i][j-1]) % mod\n\t\t\tif (i+j)&1 == 1 {\n\t\t\t\tans = (ans + f[i][j]) % mod\n\t\t\t}\n\t\t}\n\t}\n\tFprint(out, ans)\n}\n\nfunc main() {\n\tCF1152D(os.Stdin, os.Stdout)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "49c41a16221ddde0de2e9f7cd7d7a120", "src_uid": "8218255989e5eab73ac7107072c3b2af", "difficulty": 2100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tans := []int{0, 2, 3, 1, 2, 1}\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tfmt.Printf(\"%d\", ans[n])\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "c547e61e562a832d85601f2e975c548b", "src_uid": "c702e07fed684b7741d8337aafa005fb", "difficulty": 1300.0} {"lang": "Go", "source_code": "// Codeforces 859 C Pie Rules train\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar in *bufio.Reader\n\nfunc readFive() (int, int, int, int, int) {\n\tvar a [5]int\n\ts, err := in.ReadString('\\n')\n\tif err != nil {\n\t\tfmt.Println(\"first read failure\", err)\n\t\tpanic(err)\n\t}\n\tss := strings.Split(strings.Trim(s, \" \\n\\r\"), \" \")\n\tfor i := 0; i < len(ss); i++ {\n\t\ta[i], err = strconv.Atoi(ss[i])\n\t\tif err != nil {\n\t\t\tfmt.Println(\"n atoi failure\", err)\n\t\t\tpanic(err)\n\t\t}\n\t}\n\treturn a[0], a[1], a[2], a[3], a[4]\n}\n\nfunc readLineNumbs(n int) []int {\n\ta := make([]int, n)\n\ts, err := in.ReadString('\\n')\n\tif err != nil {\n\t\tfmt.Println(\"read failure\", err)\n\t\tpanic(err)\n\t}\n\tss := strings.Split(strings.Trim(s, \" \\n\\r\"), \" \")\n\tfor j := 0; j < n; j++ {\n\t\taa, err := strconv.Atoi(ss[j])\n\t\tif err != nil {\n\t\t\tfmt.Println(\"aa conv failed\", err)\n\t\t\tpanic(err)\n\t\t}\n\t\ta[j] = aa\n\t}\n\treturn a\n}\n\nvar n int\nvar p []int // pie slices sizes\nvar pAlice,pBob int\nvar mem [][]int // mem[0] - bob win, mem[1] - alice win\nvar pSum int\nvar pSumLeft []int // sum left after step \n\n// readData read data for out problem.\nfunc readData() {\n\tin = bufio.NewReader(os.Stdin)\n\t// reading n\n\tn, _, _, _, _ = readFive()\n\tp = readLineNumbs(n)\n}\n\nfunc initMemSum() {\n\tmem = make([][]int, 2)\n\tfor ba := 0; ba<2; ba++ {\n\t\tmem[ba] = make([]int, n)\n\t\tfor j:=0; j=0; i-- {\n\t\tpSum += p[i]\n\t\tpSumLeft[i] = pSum;\n\t}\n}\n\n// Return for player with fishka.\nfunc play(ba int, step int) int {\n\tif step>=n {\n\t\treturn 0\n\t} else if mem[ba][step]>=0 {\n\t\treturn mem[ba][step]\n\t}\n\t// pass fishka\n\tretp := p[step] + (pSumLeft[step+1] - play(1-ba, step+1));\n\t// stay with fishka\n\trets := play(ba, step+1)\n\t// max result\n\tret := retp\n\tif ret < rets {\n\t\tret = rets\n\t}\n\t// fmt.Printf(\"play(%d, %d) returned %d\\n\", ba,step, ret)\n\tmem[ba][step] = ret;\n\treturn ret;\n}\n\n// solve func solves our problem.\nfunc solve() {\n\tinitMemSum()\n\tpBob = play(1,0)\n\tpAlice = pSum - pBob\n}\n\n// printRes print problem solution in expected format.\nfunc printRes() {\n\tfmt.Printf(\"%d %d\\n\", pAlice, pBob)\n}\n\nfunc main() {\n\treadData()\n\tsolve()\n\tprintRes()\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "c4f09f7024961ce3631c480c9ae7af6b", "src_uid": "414540223db9d4cfcec6a973179a0216", "difficulty": 1500.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar n int\nvar sum [60]int\nvar dp [60]int\nvar pie [60]int\n\nfunc main() {\n fmt.Scan(&n)\n for i := n; i >= 1; i-- {\n fmt.Scan(&pie[i])\n }\n for i := 1; i <= n; i++ {\n sum[i] = sum[i-1] + pie[i]\n if dp[i-1] > sum[i-1]-dp[i-1]+pie[i] {\n dp[i] = dp[i-1]\n } else {\n dp[i] = sum[i-1] - dp[i-1] + pie[i]\n }\n }\n fmt.Println(sum[n]-dp[n], dp[n])\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "3bf393ac6fe56ce05b749f6ad68c3038", "src_uid": "414540223db9d4cfcec6a973179a0216", "difficulty": 1500.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nvar mem [2][51]int\n\nfunc get(sum int, slices []int, decider bool) (returned int) {\n\tif len(slices) == 0 {\n\t\treturn 0\n\t}\n\n\tdec := 0\n\tif decider {\n\t\tdec = 1\n\t}\n\n\tif mem[dec][len(slices)] != 0 {\n\t\treturn mem[dec][len(slices)]\n\t}\n\tdefer func() { mem[dec][len(slices)] = returned }()\n\n\tans := get(sum-slices[0], slices[1:], decider)\n\tif x := sum - get(sum-slices[0], slices[1:], !decider); ans < x {\n\t\tans = x\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tslices := make([]int, n)\n\tsum := 0\n\tfor i := range slices {\n\t\tfmt.Scan(&slices[i])\n\t\tsum += slices[i]\n\t}\n\tbob := get(sum, slices, true)\n\tfmt.Println(sum-bob, bob)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "0a066c57c0107171f1455edc60040645", "src_uid": "414540223db9d4cfcec6a973179a0216", "difficulty": 1500.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar n int\nvar sum [60]int\nvar dp [60]int\nvar pie [60]int\n\nfunc main() {\n fmt.Scan(&n)\n for i := n; i >= 1; i-- {\n fmt.Scan(&pie[i])\n }\n for i := 1; i <= n; i++ {\n sum[i] = sum[i-1] + pie[i]\n if dp[i-1] > sum[i-1]-dp[i-1]+pie[i] {\n dp[i] = dp[i-1]\n } else {\n dp[i] = sum[i-1] - dp[i-1] + pie[i]\n }\n }\n fmt.Println(dp[n], sum[n]-dp[n])\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "9608b826a3968288f84e9445804d0a3d", "src_uid": "414540223db9d4cfcec6a973179a0216", "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\ntype graph struct {\n\tedges [][]int\n\tdegree []int\n\tscc int\n\tcolor []int\n}\n\nfunc (g *graph) add(from, to int) {\n\tg.edges[from] = append(g.edges[from], to)\n\tg.degree[from]++\n}\n\nfunc (g *graph) addBoth(from, to int) {\n\tg.add(from, to)\n\tif from != to {\n\t\tg.add(to, from)\n\t}\n}\n\nfunc (g *graph) dfs(v int) {\n\tg.color[v] = g.scc\n\tfor _, w := range g.edges[v] {\n\t\tif g.color[w] == 0 {\n\t\t\tg.dfs(w)\n\t\t}\n\t}\n}\n\nfunc (g *graph) check() bool {\n\tcnt := 0\n\tfor _, c := range g.color {\n\t\tif c == g.scc {\n\t\t\tcnt++\n\t\t}\n\t}\n\tfor i, c := range g.color {\n\t\tif c == g.scc && g.degree[i] != cnt-1 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// github.com/EndlessCheng/codeforces-go\nfunc Sol623A(reader io.Reader, writer io.Writer) {\n\tin := bufio.NewReader(reader)\n\tout := bufio.NewWriter(writer)\n\tdefer out.Flush()\n\n\tvar n, m int\n\tFscan(in, &n, &m)\n\tg := &graph{\n\t\tedges: make([][]int, n+1),\n\t\tdegree: make([]int, n+1),\n\t\tscc: 1,\n\t\tcolor: make([]int, n+1),\n\t}\n\tfor ; m > 0; m-- {\n\t\tvar v, w int\n\t\tFscan(in, &v, &w)\n\t\tg.addBoth(v, w)\n\t}\n\n\tg.dfs(1)\n\tif !g.check() {\n\t\tFprint(out, \"No\")\n\t\treturn\n\t}\n\tg.scc++\n\tfor i := 2; i <= n; i++ {\n\t\tif g.color[i] == 0 {\n\t\t\tg.dfs(i)\n\t\t\tbreak\n\t\t}\n\t}\n\tif !g.check() {\n\t\tFprint(out, \"No\")\n\t\treturn\n\t}\n\tfor _, c := range g.color[1:] {\n\t\tif c == 0 {\n\t\t\tFprint(out, \"No\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tFprintln(out, \"Yes\")\n\tfor _, c := range g.color[1:] {\n\t\tif c == 1 {\n\t\t\tFprint(out, \"a\")\n\t\t} else {\n\t\t\tFprint(out, \"c\")\n\t\t}\n\t}\n}\n\nfunc main() {\n\tSol623A(os.Stdin, os.Stdout)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "aea87070bb1870a759ae566887bf5b1f", "src_uid": "e71640f715f353e49745eac5f72e682a", "difficulty": 1800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\ntype graph struct {\n\tsize int\n\tedges [][]bool\n\tdegree []int\n\tcolor []int\n}\n\nfunc (g *graph) add(from, to int) {\n\tg.edges[from][to] = true\n\tg.degree[from]++\n}\n\nfunc (g *graph) addBoth(from, to int) {\n\tg.add(from, to)\n\tif from != to {\n\t\tg.add(to, from)\n\t}\n}\n\nfunc (g *graph) _isBipartite(v int) bool {\n\tfor w, e := range g.edges[v] {\n\t\tif e || w == v {\n\t\t\tcontinue\n\t\t}\n\t\tif g.color[w] == g.color[v] {\n\t\t\treturn false\n\t\t}\n\t\tif g.color[w] == 0 {\n\t\t\tg.color[w] = 3 - g.color[v]\n\t\t\tif !g._isBipartite(w) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}\n\nfunc (g *graph) isBipartite() bool {\n\tchecked := false\n\tcnt := 0\n\tfor i, deg := range g.degree {\n\t\tdeg = g.size - 1 - deg\n\t\tif deg > 0 {\n\t\t\tif checked {\n\t\t\t\tif g.color[i] == 0 {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tg.color[i] = 1\n\t\t\tif !g._isBipartite(i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tfor w := range g.edges[i] {\n\t\t\t\tif g.color[w] == 2 {\n\t\t\t\t\tcnt++\n\t\t\t\t}\n\t\t\t}\n\t\t\tchecked = true\n\t\t}\n\t}\n\tif cnt > 0 {\n\t\tfor v, c := range g.color {\n\t\t\tif c == 1 {\n\t\t\t\tcntW := 0\n\t\t\t\tfor w, e := range g.edges[v] {\n\t\t\t\t\tif e || w == v {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif g.color[w] == 2 {\n\t\t\t\t\t\tcntW++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif cntW != cnt {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}\n\n// github.com/EndlessCheng/codeforces-go\nfunc Sol623A(reader io.Reader, writer io.Writer) {\n\tin := bufio.NewReader(reader)\n\tout := bufio.NewWriter(writer)\n\tdefer out.Flush()\n\n\tvar n, m int\n\tFscan(in, &n, &m)\n\tg := &graph{\n\t\tsize: n,\n\t\tedges: make([][]bool, n),\n\t\tdegree: make([]int, n),\n\t\tcolor: make([]int, n),\n\t}\n\tfor i := range g.edges {\n\t\tg.edges[i] = make([]bool, n)\n\t}\n\tfor ; m > 0; m-- {\n\t\tvar v, w int\n\t\tFscan(in, &v, &w)\n\t\tg.addBoth(v-1, w-1)\n\t}\n\n\t// \u82e5\u53cd\u56fe\u4e3a\u7a7a\u6216\u4e8c\u5206\u56fe\uff0c\u5219\u5b58\u5728\n\tif !g.isBipartite() {\n\t\tFprint(out, \"No\")\n\t\treturn\n\t}\n\n\tFprintln(out, \"Yes\")\n\tfor _, c := range g.color {\n\t\tFprintf(out, \"%c\", \"bac\"[c])\n\t}\n}\n\nfunc main() {\n\tSol623A(os.Stdin, os.Stdout)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "d41514294fd6be43a958f2dbdc4acfbd", "src_uid": "e71640f715f353e49745eac5f72e682a", "difficulty": 1800.0} {"lang": "Go", "source_code": "// 79A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y int64\n\tw := true\n\tfmt.Scan(&x, &y)\n\tfor x*10+y >= 22 && y >= 2 {\n\t\tif w || (y < 12) {\n\t\t\tx -= 2\n\t\t\ty -= 2\n\t\t} else if y < 22 {\n\t\t\tx--\n\t\t\ty -= 12\n\t\t} else {\n\t\t\ty -= 22\n\t\t}\n\t\tw = !w\n\t}\n\tif w == true {\n\t\tfmt.Print(\"Hanako\")\n\t} else {\n\t\tfmt.Print(\"Ciel\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "2823774f36532ca91e39b89f378f57c3", "src_uid": "8ffee18bbc4bb281027f91193002b7f5", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\nimport \"math\"\n\nfunc sum(n int64) int64 {\n\tvar summ int64\n\tfor n > 0 {\n\t\tsumm += n%10\n\t\tn /= 10\n\t}\n\treturn summ\n}\n\nfunc main(){\n\tvar n int64\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tn, _ = strconv.ParseInt(r.Text(), 0, 64)\n\tvar l int64 = int64(math.Sqrt(float64(n)))-40\n\tif l < 0 {\n\t\tl = 1\n\t}\n\tvar s int64 = int64(math.Sqrt(float64(n)))+1\n\tfor i:=l; i 0 {\n\t\t\tsum = sum + c%10\n\t\t\tc /= 10\n\t\t}\n\t\tif (sum+i)*i == a {\n\t\t\tfmt.Print(i)\n\t\t\treturn\n\t\t}\n\t}\n\tc = -1\n\tfmt.Print(c)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "321448bd814b3a83bf7fa69f034d988d", "src_uid": "e1070ad4383f27399d31b8d0e87def59", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\nimport \"math\"\n\nfunc sum(n int64) int64 {\n\tvar summ int64\n\tfor n > 0 {\n\t\tsumm += n%10\n\t\tn /= 10\n\t}\n\treturn summ\n}\n\nfunc main(){\n\tvar n int64\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tn, _ = strconv.ParseInt(r.Text(), 0, 64)\n\tvar l int64 = int64(math.Sqrt(float64(n)))-40\n\tif l < 0 {\n\t\tl = 1\n\t}\n\tvar s int64 = int64(math.Sqrt(float64(n)))+1\n\tfor i:=l; i 0 {\n\t\t\tinputs := strings.Split(input, \" \")\n\t\t\tfor i := range inputs{\n\t\t\t\tstrs <- &inputs[i]\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc main(){\n\trs := bufio.NewReader(os.Stdin)\n\tws := bufio.NewWriter(os.Stdout)\n\n\tstrs := make(chan *string, 100)\n\n\tgo inputter(rs, strs)\n\n\tstr := strings.Split(*<-strs, \":\")\n\ta , _ := strconv.ParseInt(str[0], 10, 64)\n\tb , _ := strconv.ParseInt(str[1], 10, 64)\n\tc , _ := strconv.ParseInt(*<-strs, 10, 64)\n\n\tb += c\n\n\ta += b/60\n\tb %= 60\n\ta %= 24\n\n\tws.WriteString(fmt.Sprintf(\"%02d:%02d\", a, b))\n\tws.Flush()\n}\n\n\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "37ea3b65843a4faa47282696dabc1653", "src_uid": "20c2d9da12d6b88f300977d74287a15d", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t// \"sort\"\n\t\"strings\"\n)\n\nvar (\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\ttimes := strings.Split(next(), \":\")\n\th, _ := strconv.Atoi(times[0])\n\tm, _ := strconv.Atoi(times[1])\n\ta := nextInt()\n\n\th = (h + a/60)\n\tm = (m + (a % 60))\n\n\tif m >= 60 {\n\t\th++\n\t\tm = m % 60\n\t}\n\n\th = h % 24\n\n\tprintf(\"%02d:%02d\\n\", h, m)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "c0348b753aacb393cca822bb885d322b", "src_uid": "20c2d9da12d6b88f300977d74287a15d", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\nimport (\n \"fmt\"\n )\nfunc main(){\n var n\n i := 1\n fmt.Scan(&n)\n while(n>i){\n n -= i\n i++\n }\n if n == i {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "540a602e2db37c3364cea1397dc8d278", "src_uid": "587d4775dbd6a41fc9e4b81f71da7301", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\nimport (\n \"fmt\"\n )\nfunc main(){\n var n int\n i := 1\n fmt.Scan(&n)\n while(n>i){\n n -= i\n i++\n }\n if n == i {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "5bf850d04126d9e2188a6d035bda604e", "src_uid": "587d4775dbd6a41fc9e4b81f71da7301", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\nimport (\n \"fmt\"\n )\nfunc main(){\n var n int\n i := 1\n fmt.Scan(&n)\n for ;n>i;i++{\n n -= i\n }\n if n == i {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "2b1f5349630ef0a4b40bda584185e61a", "src_uid": "587d4775dbd6a41fc9e4b81f71da7301", "difficulty": 800.0} {"lang": "Go", "source_code": "\ufeffpackage main\nimport (\n\t\"fmt\"\n)\nfunc main() {\n\tvar n,i int\n\tfmt.Scan(&n)\n\tflag:=false\n\tfor i=1;i<=n;i++ {\n\t\tif i*(i+1)/2==n {\n\t\t\tflag=true\n\t\t}\n\t}\n\tif flag==true {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n}\n\n\n\n\n\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "7943f4c2747fe58fe6615f235aee4675", "src_uid": "587d4775dbd6a41fc9e4b81f71da7301", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\t// \u4ece\u5de6\u5f00\u59cb\u9047\u52301\u5c31\u6269\u5927\u53f3\u8fb9\u754c\uff0c\u76f4\u5230\u8d85\u51fa\u53f3\u8fb9\u754c\u4e3a\u6b62\u3002\n\tvar (\n\t\tn, d int\n\t\ts string\n\t)\n\tfmt.Scanf(\"%d%d\", &n, &d)\n\tfmt.Scan(&s)\n\tf := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tf[i] = -1\n\t}\n\tif s[0] == '1' {\n\t\tf[0] = 0\n\t}\n\tfor l, r := 0, 0; l <= r; l++ {\n\t\tif s[l] != '1' {\n\t\t\tcontinue\n\t\t}\n\t\tfor r < l+d && r+1 < n {\n\t\t\tr++\n\t\t\tif s[r] == '1' {\n\t\t\t\tf[r] = f[l] + 1\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", f[n-1])\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "47158f0561d186d181c1a45b0650dd5a", "src_uid": "c08d2ecdfc66cd07fbbd461b1f069c9e", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, d int\n\tfmt.Scan(&n, &d)\n\tvar a string\n\tfmt.Scan(&a)\n\ti := 0\n\tflag := false\n\tcount := 0\n\tvar j int\n\tfor i < n {\n\t\tif i+d >= n {\n\t\t\tj = n - 1\n\t\t} else {\n\t\t\tj = i + d\n\t\t}\n\t\tfor (j > i && j < n) && a[j] != '1' {\n\t\t\tj--\n\t\t}\n\t\tif j <= n-1 {\n\t\t\tif a[j] != '1' || j == i {\n\t\t\t\tflag = true\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\ti = j\n\t\t\t\tif j == n-1 {\n\t\t\t\t\tcount++\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(count)\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "75a91596d7db21fb6652b7d7bd5f5471", "src_uid": "c08d2ecdfc66cd07fbbd461b1f069c9e", "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\tvar (\n\t\ta, b, x, y int\n\t)\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\n\tscanner.Scan()\n\ta, _ = strconv.Atoi(scanner.Text())\n\n\tscanner.Scan()\n\tb, _ = strconv.Atoi(scanner.Text())\n\n\tscanner.Scan()\n\tx, _ = strconv.Atoi(scanner.Text())\n\n\tscanner.Scan()\n\ty, _ = strconv.Atoi(scanner.Text())\n\n\tdel := gcd(x, y)\n\tx, y = x/del, y/del\n\n\tf, s := a/x, b/y\n\n\tmn := f\n\tif mn > s {\n\t\tmn = s\n\t}\n\tfmt.Println(mn)\n}\n\nfunc gcd(a, b int) int {\n\tfor b != 0 {\n\t\ta %= b\n\t\ta, b = b, a\n\t}\n\treturn a\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "1dbedd7d2a335a6fa17bcaf79b044dac", "src_uid": "907ac56260e84dbb6d98a271bcb2d62d", "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\tvar (\n\t\ta, b, x, y int64\n\t)\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\n\tscanner.Scan()\n\ta, _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\n\tscanner.Scan()\n\tb, _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\n\tscanner.Scan()\n\tx, _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\n\tscanner.Scan()\n\ty, _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\n\tg := gcd(x, y)\n\n\tx /= g\n\ty /= g\n\n\tf, s := a/x, b/y\n\n\tres := min(f, s)\n\tfmt.Println(res)\n}\n\nfunc min(x, y int64) int64 {\n\tif x < y {\n\t\treturn x\n\t}\n\n\treturn y\n}\n\nfunc gcd(a, b int64) int64 {\n\tfor b != 0 {\n\t\ta %= b\n\t\ta, b = b, a\n\t}\n\treturn a\n}\n\nfunc lcm(a, b int64) int64 {\n\treturn a / gcd(a, b) * b\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "69fb20a70aeaefae8a1d92487763b8da", "src_uid": "907ac56260e84dbb6d98a271bcb2d62d", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\nvar (\n\tr *bufio.Scanner\n\tw *bufio.Writer\n)\n\nconst ISDEBUG = false\n\nfunc readLine() string {\n\tr.Scan()\n\treturn r.Text()\n}\n\nfunc readInt() int {\n\tr.Scan()\n\tx, _ := strconv.Atoi(r.Text())\n\treturn x\n}\n\nfunc readInts(n int) []int {\n\tvar res []int\n\tfor i:=0; i d {\n\t\t\tbreak\n\t\t}\n\t\tans = p - p%t\n\t}\n\tfmt.Print(ans - 1)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "48a2f17d18f63e05191232e0eee8b2ec", "src_uid": "c706cfcd4c37fbc1b1631aeeb2c02b6a", "difficulty": 1400.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\n\nfunc main() {\n\tvar pp, dd, x, y, t, w, h int64\n\tw=1\n\tfmt.Scan(&pp, &dd)\n\tx=pp-dd\n\ty=pp\n\tfor {\n\t\tt=y\n\t\tw*=10\n\t\th=pp%w\n\t\tif h==w-1 {\n\t\t\th--\n\t\t}\n\t\ty=pp-(h+1)\n\t\tif y 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": "503254cc5f5a8917aba63b2a022f577c", "src_uid": "b991c064562704b6106a6ff2a297e64a", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc min(nums ...int) int {\n\tres := math.MaxInt32\n\tfor _, num := range nums {\n\t\tif num < res {\n\t\t\tres = num\n\t\t}\n\t}\n\treturn res\n}\n\nfunc main() {\n\tn, m, a, b, countMap := 0, 0, 0, 0, map[int]int{}\n\tfmt.Scan(&n, &m)\n\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scan(&a, &b)\n\t\tcountMap[b] += a\n\t}\n\n\tpointer, result := 10, 0\n\tfor (n > 0) && (pointer > 0) {\n\t\tsteal := min(n, countMap[pointer])\n\t\tresult, n, pointer = result+steal*pointer, n-steal, pointer-1\n\t}\n\n\tfmt.Println(result)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "41b65d8898d48f0e3f168cad5b8da98a", "src_uid": "c052d85e402691b05e494b5283d62679", "difficulty": 900.0} {"lang": "Go", "source_code": "// 70A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar m int\n\te := 1\n\tfmt.Scan(&m)\n\tfor j := 1; j <= m-1; j++ {\n\t\te = (3 * e) % 1000003\n\t}\n\tfmt.Print(e)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "31febb65aa684293dd730d05b6e702fb", "src_uid": "1a335a9638523ca0315282a67e18eec7", "difficulty": 1300.0} {"lang": "Go", "source_code": "//70A\npackage main\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar nn, a int64\n\ta=1\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tr.Scan()\n\tnn, _ = strconv.ParseInt(r.Text(), 0, 64)\n\tif nn==1 {\n\t\ta=1\n\t} else {\n\t\tfor i:=2; int64(i)<=nn; i++ {\n\t\t\ta=(a*3)%1000003\n\t\t}\n\t}\n\tfmt.Println(a)\n}\t\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "bdd6538db8bd9b794c247ef7ac6cc895", "src_uid": "1a335a9638523ca0315282a67e18eec7", "difficulty": 1300.0} {"lang": "Go", "source_code": "// 70A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar m, n int\n\te := 1\n\tfmt.Scan(&m)\n\tfor j = 1; j <= m-1; j++ {\n\t\te = (3 * e) % 1000003\n\t}\n\tfmt.Print(e)\n}\n", "lang_cluster": "Go", "compilation_error": true, "code_uid": "bcb33ade358cc9d0163bfc6e00ec1d94", "src_uid": "1a335a9638523ca0315282a67e18eec7", "difficulty": 1300.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tweight := make([]int,2*n)\n\tfor i := 0; i < 2*n; i++ {\n\t\tfmt.Scan(&weight[i])\n\t}\n\tsort.Ints(weight)\n\tres := 50000\n\tfor i := 0; i < 2*n-1; i++ { //enumerate the two elements\n\t\tfor j := i + 1; j < 2*n; j++ {\n\t\t\ttot := 0\n\t\t\tfor k := 0; k < 2*n-1; k++ { //left weight\n\t\t\t\tif k==i || k==j{continue} //skip it\n\t\t\t\tr := k+1\n\t\t\t\tfor r==i || r==j {r++} //right weight\n\t\t\t\ttot += weight[r] - weight[k]\n\t\t\t\tk = r //update left\n\t\t\t}\n\t\t\tif tot < res { res = tot} //update the result\n\t\t}\n\t}\n\tfmt.Println(res)\n\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "dc83aa4cae8c5d4361a8dad8e6c34205", "src_uid": "76659c0b7134416452585c391daadb16", "difficulty": 1500.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tn *= 2\n\ta := make([]int, n)\n\tfor i, _ := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tres := -1\n\tfor i, _ := range a {\n\t\tfor j, _ := range a {\n\t\t\tif j == i {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tcur := make([]int, 0)\n\t\t\tfor k, _ := range a {\n\t\t\t\tif k != i && k != j {\n\t\t\t\t\tcur = append(cur, a[k])\n\t\t\t\t}\n\t\t\t}\n\t\t\tsort.Ints(cur)\n\n\t\t\tans := 0\n\t\t\tfor k := 0; k < len(cur); k += 2 {\n\t\t\t\tans += cur[k+1] - cur[k]\n\t\t\t}\n\t\t\tif res == -1 {\n\t\t\t\tres = ans\n\t\t\t} else if res > ans {\n\t\t\t\tres = ans\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "61395b3b248be65b9462c037ca7e5f71", "src_uid": "76659c0b7134416452585c391daadb16", "difficulty": 1500.0} {"lang": "Go", "source_code": "package main\n\nimport . \"fmt\"\n\ntype vec struct {\n\tx, y int64\n}\n\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\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\tmp[p0]++\n\t\tmp[p1]++\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": "afd4bdf767e61c60b6de832a419821f4", "src_uid": "ad105c08f63e9761fe90f69630628027", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport . \"fmt\"\n\ntype vec struct {\n\tx, y int64\n}\n\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\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\tv := p1.sub(p0)\n\t\tif 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}\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": "a0c87c41904210de2a7d802e80fa010b", "src_uid": "ad105c08f63e9761fe90f69630628027", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF1034B(in io.Reader, out io.Writer) {\n\tmax := func(a, b int64) int64 {\n\t\tif a > b {\n\t\t\treturn a\n\t\t}\n\t\treturn b\n\t}\n\tvar n, m, ans int64\n\tFscan(in, &n, &m)\n\tif n > m {\n\t\tn, m = m, n\n\t}\n\tif n == 1 {\n\t\tans = m - m%6 + max(m%6-3, 0)*2\n\t} else if n == 2 {\n\t\tswitch m {\n\t\tcase 2:\n\t\t\tans = 0\n\t\tcase 3:\n\t\t\tans = 4\n\t\tcase 7:\n\t\t\tans = 12\n\t\tdefault:\n\t\t\tans = m * 2\n\t\t}\n\t} else {\n\t\tans = n * m &^ 1\n\t}\n\tFprint(out, ans)\n}\n\nfunc main() { CF1034B(os.Stdin, os.Stdout) }\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "99cf2234f8ac6ff9da669275dbe1bdec", "src_uid": "02ce135a4b276d1e9ba6a4ce37f2fe70", "difficulty": 2200.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int\n var m int\n fmt.Scan(&m)\n fmt.Scan(&n)\n for i := 0; i < n; i++ {\n var res int\n res = m / n\n if i < m % n {\n res = res + 1\n }\n fmt.Print(res, \" \")\n } \n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "241cb864ec37ef82ada82b39b66419a4", "src_uid": "0b2c1650979a9931e00ffe32a70e3c23", "difficulty": 800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF533C(in io.Reader, out io.Writer) {\n\tmax := func(a, b int) int {\n\t\tif a > b {\n\t\t\treturn a\n\t\t}\n\t\treturn b\n\t}\n\tvar x1, y1, x2, y2 int\n\tFscan(in, &x1, &y1, &x2, &y2)\n\tif x1+y1 <= max(x2, y2) || x1 <= x2 && y1 <= y2 {\n\t\tFprint(out, \"Polycarp\")\n\t} else {\n\t\tFprint(out, \"Vasiliy\")\n\t}\n}\n\nfunc main() { CF533C(os.Stdin, os.Stdout) }\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "ff23098a6a24da42a30e0d48dd53b8d3", "src_uid": "2637d57f7809ff8f922549c617709074", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nconst MOD = int64(1e9 + 7)\n\nvar (\n\tk int64\n\tn int64\n\tinv [100]int64\n)\n\nfunc qpow(x, k int64) int64 {\n\tvar y int64 = 1\n\tfor k > 0 {\n\t\tif k%2 > 0 {\n\t\t\ty = y * x % MOD\n\t\t}\n\t\tk >>= 1\n\t\tx = x * x % MOD\n\t}\n\treturn y\n}\nfunc solve(x int64, cnt int64) int64 {\n\tdp := [10001][60]int64{}\n\ts := int64(1)\n\tfor i := int64(0); i <= cnt; i++ {\n\t\tdp[0][i] = s\n\t\ts = s * x % MOD\n\t}\n\tfor i := int64(1); i <= k; i++ {\n\t\tvar s int64 = 0\n\t\tfor j := int64(0); j <= cnt; j++ {\n\t\t\ts += dp[i-1][j]\n\t\t\tif s >= MOD {\n\t\t\t\ts -= MOD\n\t\t\t}\n\t\t\tdp[i][j] = s * inv[j+1] % MOD\n\t\t}\n\t}\n\treturn dp[k][cnt]\n}\n\nfunc main() {\n\tfor i := int64(1); i < 100; i++ {\n\t\tinv[i] = qpow(i, MOD-2)\n\t}\n\tfmt.Scanln(&n, &k)\n\tvar ans int64 = 1\n\tfor i := int64(2); i*i <= n; i++ {\n\t\tvar c int64 = 0\n\t\tfor n%i == 0 {\n\t\t\tc++\n\t\t\tn /= i\n\t\t}\n\t\tif c > 0 {\n\t\t\tans = ans * solve(i, c) % MOD\n\t\t}\n\t}\n\tif n > 1 {\n\t\tans = ans * solve(n, 1) % MOD\n\t}\n\tfmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "91ad18eb62ade154a3d59c13a0a091aa", "src_uid": "dc466d9c24b7dcb37c0e99337b4124d2", "difficulty": 2200.0} {"lang": "Go", "source_code": "package main\nimport (\n \"fmt\"\n)\nfunc main(){\n var n int\n fmt.Scan(&n)\n fmt.Printf(\"1%d\\n\",n)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "71450214627712caac36104476587da9", "src_uid": "7220f2da5081547a12118595bbeda4f6", "difficulty": null} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"math/rand\"\n)\n\nfunc solve() {\n\tvar st int\n\tReadf(\"%d\", &st)\n\n\n\tWritef(\"%d\\n\", st + rand.Intn(100))\n}\n\nfunc main() {\n\t// If io still contains some buffered data flush it before\n\t// quiting\n\tdefer io.Flush()\n\n\t// Solution of the problem goes here\n\tsolve()\n}\n\nvar (\n\t// fmt.Print and fmt.Scan is slow, we will use bufio\n\t// for read and write from stdin.\n\tio = bufio.NewReadWriter(\n\t\tbufio.NewReader(os.Stdin),\n\t\tbufio.NewWriter(os.Stdout),\n\t)\n)\n\nfunc Readf(format string, args ...interface{}) {\n\tfmt.Fscanf(io, format, args...)\n}\n\nfunc Writef(format string, args ...interface{}) {\n\tfmt.Fprintf(io, format, args...)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "9dcc6d813f15758bc4465e0a7db56726", "src_uid": "7220f2da5081547a12118595bbeda4f6", "difficulty": null} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nfunc solve() {\n\tvar st int\n\tReadf(\"%d\", &st)\n\n\tsqrt := int(math.Sqrt(float64(st)))\n\tvar a, b int\n\n\tvar ok bool\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif st % i == 0 {\n\t\t\ta = i\n\t\t\tb = st / i\n\n\t\t\tok = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif ok {\n\t\tWritef(\"%d%d\\n\", a, b)\n\t} else {\n\t\tWritef(\"-1\\n\")\n\t}\n}\n\nfunc main() {\n\t// If io still contains some buffered data flush it before\n\t// quiting\n\tdefer io.Flush()\n\n\t// Solution of the problem goes here\n\tsolve()\n}\n\nvar (\n\t// fmt.Print and fmt.Scan is slow, we will use bufio\n\t// for read and write from stdin.\n\tio = bufio.NewReadWriter(\n\t\tbufio.NewReader(os.Stdin),\n\t\tbufio.NewWriter(os.Stdout),\n\t)\n)\n\nfunc Readf(format string, args ...interface{}) {\n\tfmt.Fscanf(io, format, args...)\n}\n\nfunc Writef(format string, args ...interface{}) {\n\tfmt.Fprintf(io, format, args...)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "31096192574d815ed3a2bfac36544482", "src_uid": "7220f2da5081547a12118595bbeda4f6", "difficulty": null} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n, ans int64\n var a [10]int64\n fmt.Scan(&n)\n \n for i := 0; i < 9; i++ {\n a[i] = n / 9\n if i != 0 && n % 9 >= i {\n a[i] += 1\n }\n }\n \n for i := 0; i < 9; i++ {\n for j := 0; j < 9; j++ {\n ans += a[i] * a[j] * a[i * j]\n }\n }\n \n for i := 1; i <= n; i++ {\n ans -= n / int64(i)\n }\n fmt.Println(ans)\n \n return\n}", "lang_cluster": "Go", "compilation_error": true, "code_uid": "e75729766f0a8d1a75c0052eb6a732fc", "src_uid": "fc133fe6353089a0ebee08dec919f608", "difficulty": 2000.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n, ans int64\n var a [10]int64\n fmt.Scan(&n)\n \n for i := 0; i < 9; i++ {\n a[i] = n / 9\n if i != 0 && n % 9 >= int64(i) {\n a[i] += 1\n }\n }\n \n for i := 0; i < 9; i++ {\n for j := 0; j < 9; j++ {\n ans += a[i] * a[j] * a[i * j % 9]\n }\n }\n \n for i := 1; int64(i) <= n; i++ {\n ans -= n / int64(i)\n }\n fmt.Println(ans)\n \n return\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "a0557ddfb9fcbd999710a6ab02b19499", "src_uid": "fc133fe6353089a0ebee08dec919f608", "difficulty": 2000.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 CF10C(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar n int\n\tFscan(in, &n)\n\n\tans := int64(0)\n\tcnts := [9]int64{}\n\tfor i := 1; i <= n; i++ {\n\t\tcnts[i%9]++\n\t\tans -= int64(n / i)\n\t}\n\tfor i := 0; i < 9; i++ {\n\t\tfor j := 0; j < 9; j++ {\n\t\t\tans += cnts[i] * cnts[j] * cnts[i*j%9]\n\t\t}\n\t}\n\tFprint(out, ans)\n}\n\nfunc main() { CF10C(os.Stdin, os.Stdout) }\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "f555c98eb8341562b1ea944618c2b9e9", "src_uid": "fc133fe6353089a0ebee08dec919f608", "difficulty": 2000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar days = []int32{\n\t31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n\t31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n\t31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n\t31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n\t31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n\t31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n\t31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n\t31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,\n}\n\nfunc main() {\n\tvar n int\n\tvar a [24]int32\n\tfmt.Scan(&n)\n\tvar id = -1\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t\tif id == -1 && (a[i] == 28 || a[i] == 29) {\n\t\t\tid = i\n\t\t}\n\t}\n\tif id != -1 {\n\t\tif id+12 < n {\n\t\t\tif a[id+12] != 28 && a[id+12] != 29 {\n\t\t\t\tfmt.Println(\"NO\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif a[id] == 29 && a[id+12] == 29 {\n\t\t\t\tfmt.Println(\"NO\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\ta[id+12] = 28\n\t\t}\n\t\ta[id] = 28\n\t}\n\tfor i := 0; i < 12; i++ {\n\t\tvar yes = true\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif a[j] != days[i+j] {\n\t\t\t\tyes = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif yes {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n\treturn\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "b8ff1531858625611b537cb6c61c3330", "src_uid": "d60c8895cebcc5d0c6459238edbdb945", "difficulty": 1200.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 CF888E(_r io.Reader, out io.Writer) {\n\tmax := func(a, b int) int {\n\t\tif a > b {\n\t\t\treturn a\n\t\t}\n\t\treturn b\n\t}\n\tin := bufio.NewReader(_r)\n\tvar n, m, ans int\n\tFscan(in, &n, &m)\n\ta := make([]int64, n)\n\tfor i := range a {\n\t\tFscan(in, &a[i])\n\t}\n\n\tb := a[:(n+1)/2]\n\tf := func(i int) int {\n\t\ts := int64(0)\n\t\tfor j, v := range b {\n\t\t\tif i>>j&1 > 0 {\n\t\t\t\ts += v\n\t\t\t}\n\t\t}\n\t\treturn int(s % int64(m))\n\t}\n\tx := []int{}\n\tfor i := 0; i < 1< 0 {\n\t\t\tans = max(ans, s+x[j-1])\n\t\t}\n\t}\n\tFprint(out, ans)\n}\n\nfunc main() { CF888E(os.Stdin, os.Stdout) }\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "131f362ed8ac915e7bc5e5668252100b", "src_uid": "d3a8a3e69a55936ee33aedd66e5b7f4a", "difficulty": 1800.0} {"lang": "Go", "source_code": "//In the Name of God\n//Ya Ali\n\npackage main\n\nimport \"fmt\"\n\nconst MOD int = 1e9 + 7\n\nfunc mulInt(x, y int) int {\n\treturn int(int64(x) * int64(y) % int64(MOD))\n}\n\nfunc powInt(a int, k int) (r int) {\n\tr = 1\n\tfor k > 0 {\n\t\tif k % 2 == 1 {\n\t\t\tr = mulInt(r, a)\n\t\t}\n\t\ta = mulInt(a, a)\n\t\tk /= 2\n\t}\n\treturn\n}\n\ntype Matrix struct {\n\tn int\n\tm int\n\ta [][]int\n}\n\nfunc makeMat(n, m int) Matrix {\n\ta := make([][]int, n)\n\tfor i := range a {\n\t\ta[i] = make([]int, m)\n\t}\n\treturn Matrix{n, m, a}\n}\n\nfunc mulMat(a Matrix, b Matrix) (c Matrix) {\n\tc = makeMat(a.n, b.m)\n\tfor i := 0; i < a.n; i ++ {\n\t\tfor j := 0; j < b.m; j ++ {\n\t\t\tfor k := 0; k < a.n; k ++ {\n\t\t\t\tc.a[i][j] = (c.a[i][j] + mulInt(a.a[i][k], b.a[k][j])) % MOD\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\nfunc powMat(a Matrix, k int) (c Matrix) {\n\tc = makeMat(a.n, a.m)\n\tfor i := 0; i < a.n; i ++ {\n\t\tc.a[i][i] = 1\n\t}\n\tfor k > 0 {\n\t\tif k%2 == 1 {\n\t\t\tc = mulMat(c, a)\n\t\t}\n\t\ta = mulMat(a, a)\n\t\tk /= 2\n\t}\n\treturn\n}\n\nfunc main() {\n\tvar n, k int\n\t_, _ = fmt.Scan(&n, &k)\n\n\tar := make([]int, n)\n\n\tA, a := 0, 0\n\tB := 0\n\n\tfor i := 0; i < n; i ++ {\n\t\t_, _ = fmt.Scan(&ar[i])\n\t\tA += ar[i]\n\t}\n\n\tfor i := 0; i < A; i ++ {\n\t\ta += ar[n - 1 - i]\n\t}\n\n\tB = n - A\n\n\tmat := makeMat(A + 1, A + 1)\n\n\tfor i := 0; i <= A; i ++ {\n\t\tif B >= A - i {\n\t\t\tpls := (A - i) * (A - i)\n\t\t\tmns := i * (B - A + i)\n\t\t\tsm := n * (n - 1) / 2 - pls - mns\n\t\t\tif i > 0 {\n\t\t\t\tmat.a[i - 1][i] = mns\n\t\t\t}\n\t\t\tif i < A {\n\t\t\t\tmat.a[i + 1][i] = pls\n\t\t\t}\n\t\t\tmat.a[i][i] = sm\n\t\t}\n\t}\n\n\tmat = powMat(mat, k)\n\tres := makeMat(A + 1, 1)\n\tres.a[a][0] = 1\n\n\tres = mulMat(mat, res)\n\n\tans := mulInt(res.a[A][0], powInt(powInt(n * (n - 1) / 2, k), MOD - 2))\n\n\tfmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "ca2da2813802db881ebcc931115c174a", "src_uid": "77f28d155a632ceaabd9f5a9d846461a", "difficulty": 2300.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\t\"strings\"\n)\n\nconst (\n\tBIG = 1024 * 1024 * 10\n)\n\nfunc readLine(r *bufio.Reader) string {\n\tbytes, _, err := r.ReadLine()\n\tif err != nil {\n\t\tlog.Fatalln(\"Failed to read line\")\n\t}\n\n\treturn string(bytes)\n}\n\nfunc readInts(r *bufio.Reader) []int {\n\telems := strings.Fields(readLine(r))\n\n\tret := make([]int, len(elems))\n\tfor i, el := range elems {\n\t\ttmp, err := strconv.ParseInt(el, 10, 64)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Failed to parse number %v\", el)\n\t\t}\n\t\tret[i] = int(tmp)\n\t}\n\n\treturn ret\n}\n\nfunc min(a, b int64) int64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc combination(a, b int64) int64 {\n\tb = min(b, a-b)\n\tnom, denom := int64(1), int64(1)\n\tfor b > 0 {\n\t\tnom *= a\n\t\tdenom *= b\n\t\ta -= 1\n\t\tb -= 1\n\t}\n\n\treturn nom / denom\n}\n\nfunc pow(a, b int64) int64 {\n\tret := int64(1)\n\tfor b > 0 {\n\t\tret *= a\n\t\tb -= 1\n\t}\n\n\treturn ret\n}\n\nfunc main() {\n\tr := bufio.NewReaderSize(os.Stdin, BIG)\n\n\tn := readInts(r)[0]\n\n\tvar res int64\n\tif n == 3 {\n\t\tres = int64(4*(n-1)) * pow(int64(3), int64(n-2))\n\t} else {\n\t\tres = int64(4*2*3) * pow(int64(4), int64(n-3)) // The n-block is in the beginning/end\n\t\tres += int64(4*(n-3)*3*3) * pow(int64(4), int64(n-4)) // The n-block has blocks to the left/right\n\t}\n\n\tfmt.Println(res)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "3acec0de932152cba4c63352914b48a5", "src_uid": "3b02cbb38d0b4ddc1a6467f7647d53a9", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"os\"\r\n)\r\n\r\nvar (\r\n\tin = bufio.NewReader(os.Stdin)\r\n\tout = bufio.NewWriter(os.Stdout)\r\n)\r\n\r\nfunc flush() { out.Flush() }\r\nfunc scan(a ...interface{}) { fmt.Fscan(in, a...) }\r\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(out, f, a...) }\r\nfunc assert(f bool) {\r\n\tif !f {\r\n\t\tpanic(\"gg\")\r\n\t}\r\n}\r\n\r\n// ----------------------------- TEMPLATE END ----------------------------------\r\n\r\nconst MOD = 998244353\r\nconst LCM16 = 720720 // lcm(1, 2, 3, ..., 16)\r\nconst MAXK = 17\r\n\r\nfunc add(a, b int) int {\r\n\treturn (a + b) % MOD\r\n}\r\n\r\nfunc mul(a, b int) int {\r\n\treturn int(int64(a) * int64(b) % MOD)\r\n}\r\n\r\nvar dp [MAXK][LCM16]int\r\nvar pown [MAXK + 1]int\r\n\r\nfunc main() {\r\n\tdefer flush()\r\n\r\n\tvar n, a0, k, ai int\r\n\tvar genX, genY, genMod int64\r\n\tscan(&n, &a0, &genX, &genY, &k, &genMod)\r\n\r\n\tpown[0] = 1\r\n\tfor i := 1; i <= MAXK; i++ {\r\n\t\tpown[i] = mul(pown[i-1], n)\r\n\t}\r\n\r\n\tans := 0\r\n\tai = a0\r\n\tfor i := 0; i < n; i++ {\r\n\t\tdp[0][ai%LCM16]++\r\n\t\tans = add(ans, mul(ai-ai%LCM16, mul(k, pown[k-1])))\r\n\t\tai = int((int64(ai)*genX + genY) % genMod)\r\n\t}\r\n\r\n\tfor i := 0; i+1 < k; i++ {\r\n\t\tfor j := 0; j < LCM16; j++ {\r\n\t\t\tdp[i+1][j-j%(i+1)] = add(dp[i+1][j-j%(i+1)], dp[i][j])\r\n\t\t\tdp[i+1][j] = add(dp[i+1][j], mul(dp[i][j], n-1))\r\n\t\t}\r\n\t}\r\n\r\n\tfor j := 1; j <= k; j++ {\r\n\t\tfor i := 0; i < LCM16; i++ {\r\n\t\t\tans = add(\r\n\t\t\t\tans,\r\n\t\t\t\tmul(mul(dp[j-1][i], i), pown[k-j]),\r\n\t\t\t)\r\n\t\t}\r\n\t}\r\n\r\n\tprintf(\"%d\\n\", ans)\r\n}\r\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "975dee7e0b6e7d24096adbbdca56f126", "src_uid": "1d45491e28d24e2b318605cd328d6ecf", "difficulty": 2800.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar (\n\tin = bufio.NewReader(os.Stdin)\n\tout = bufio.NewWriter(os.Stdout)\n)\n\nfunc flush() { out.Flush() }\nfunc scan(a ...interface{}) { fmt.Fscan(in, a...) }\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(out, f, a...) }\nfunc assert(f bool) {\n\tif !f {\n\t\tpanic(\"gg\")\n\t}\n}\n\n// ----------------------------- TEMPLATE END ----------------------------------\n\nconst MOD = 998244353\nconst LCM16 = 720720 // lcm(1, 2, 3, ..., 16)\nconst MAXK = 17\n\nfunc add(a, b int) int {\n\treturn (a + b) % MOD\n}\n\nfunc mul(a, b int) int {\n\treturn int(int64(a) * int64(b) % MOD)\n}\n\nfunc fpow(b, e int) int {\n\tr := 1\n\tfor ; e > 0; e >>= 1 {\n\t\tif (e & 1) > 0 {\n\t\t\tr = mul(r, b)\n\t\t}\n\t\tb = mul(b, b)\n\t}\n\treturn r\n}\n\nvar dp [MAXK][LCM16]int\n\nfunc main() {\n\tdefer flush()\n\n\tvar n, a0, k, ai int\n\tvar genX, genY, genMod int64\n\tscan(&n, &a0, &genX, &genY, &k, &genMod)\n\n\tans := 0\n\tai = a0\n\tfor i := 0; i < n; i++ {\n\t\tdp[0][ai%LCM16]++\n\t\tans += mul(ai-ai%LCM16, mul(k, fpow(n, k-1)))\n\t\tai = int((int64(ai)*genX + genY) % genMod)\n\t}\n\n\tfor i := 0; i+1 < k; i++ {\n\t\tfor j := 0; j < LCM16; j++ {\n\t\t\tdp[i+1][j-j%(i+1)] = add(dp[i+1][j-j%(i+1)], dp[i][j])\n\t\t\tdp[i+1][j] = add(dp[i+1][j], mul(dp[i][j], n-1))\n\t\t}\n\t}\n\n\tfor j := 1; j <= k; j++ {\n\t\tfor i := 0; i < LCM16; i++ {\n\t\t\tans = add(\n\t\t\t\tans,\n\t\t\t\tmul(mul(dp[j-1][i], i), fpow(n, k-j)),\n\t\t\t)\n\t\t}\n\t}\n\n\tprintf(\"%d\\n\", ans)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "99504ce9cf629b507e76a7f78ce53025", "src_uid": "1d45491e28d24e2b318605cd328d6ecf", "difficulty": 2800.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc nextPermutation(a []int) bool {\n i := len(a)-1\n for (i > 0) && (a[i] <= a[i-1]) { i-- }\n if (i == 0) { return false }\n j := len(a)-1\n for a[j] <= a[i-1] { j-- }\n a[j], a[i-1] = a[i-1], a[j]\n j = len(a)-1\n for i < j {\n a[i], a[j] = a[j], a[i]\n i++; j--\n }\n return true\n}\n\nfunc main() {\n var g [5][5]int\n a := make([]int,5)\n for i := 0; i < 5; i++ {\n a[i] = i\n for j := 0; j < 5; j++ {\n fmt.Scan(&g[i][j])\n }\n }\n max := 0\n for {\n cnt := 0\n for i := 0; i < 4; i++ {\n for j := 0; (i+j) < 4; j += 2 {\n cnt += g[a[i+j]][a[i+j+1]]+g[a[i+j+1]][a[i+j]]\n }\n }\n if max < cnt { max = cnt }\n if !nextPermutation(a) { break }\n }\n fmt.Println(max)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "1575f72308c5372dcf690eca4374a457", "src_uid": "be6d4df20e9a48d183dd8f34531df246", "difficulty": 1200.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%2 == ty/b%2) {\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": "2cee1eabac3fbbfd39f12b7f7f4fab4d", "src_uid": "51155e9bfa90e0ff29d049cedc3e1862", "difficulty": 2000.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 int\n\tvar s string\n\tfmt.Fscanf(reader, \"%d\\n%s\\n\", &n, &s)\n\tsum := make([]int, n+1)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tif s[i] == ')' {\n\t\t\tsum[i] = sum[i+1] + 1\n\t\t} else {\n\t\t\tsum[i] = sum[i+1] - 1\n\t\t}\n\t}\n\n\tif sum[0] != 0 {\n\t\tfmt.Printf(\"0\\n1 1\\n\")\n\t\treturn\n\t}\n\n\tmin := 2 * n\n\ttotal := 0\n\ta := 1\n\tb := 1\n\n\tfor i := 0; i < n; i++ {\n\t\tif sum[i] < min {\n\t\t\tmin = sum[i]\n\t\t\ttotal = 1\n\t\t} else if sum[i] == min {\n\t\t\ttotal++\n\t\t}\n\t}\n\n\t//fmt.Printf(\"%d %d\\n%d %d\\n\", min, total, a, b)\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tif s[i] == s[j] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tsub := 0\n\t\t\tif s[i] == ')' {\n\t\t\t\tsub = 2\n\t\t\t} else {\n\t\t\t\tsub = -2\n\t\t\t}\n\t\t\tcha := 0\n\t\t\ttmin := 2 * n\n\t\t\tttotal := 0\n\n\t\t\tfor k := 0; k < n; k++ {\n\t\t\t\tif k > i && k <= j {\n\t\t\t\t\tcha = sub\n\t\t\t\t} else {\n\t\t\t\t\tcha = 0\n\t\t\t\t}\n\n\t\t\t\tif sum[k]+cha < tmin {\n\t\t\t\t\ttmin = sum[k]\n\t\t\t\t\tttotal = 1\n\t\t\t\t} else if sum[k]+cha == tmin {\n\t\t\t\t\tttotal++\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ttotal > total {\n\t\t\t\ttotal = ttotal\n\t\t\t\ta = i\n\t\t\t\tb = j\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n%d %d\\n\", total, a+1, b+1)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "4a4a9f60a0fbb52d09eb1aae922deeb7", "src_uid": "2d10668fcc2d8e90e102b043f5e0578d", "difficulty": 2000.0} {"lang": "Go", "source_code": "package 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/*********** 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\t// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\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\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/*********** DP sub-functions ***********/\n\n// ChMin accepts a pointer of integer and a target value.\n// If target value is SMALLER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMin(updatedValue *int, target int) bool {\n\tif *updatedValue > target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n// ChMax accepts a pointer of integer and a target value.\n// If target value is LARGER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMax(updatedValue *int, target int) bool {\n\tif *updatedValue < target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n// NthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc NthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\n}\n\n// OnBit returns the integer that has nth ON bit.\n// If an argument has nth ON bit, OnBit returns the argument.\nfunc OnBit(num, nth int) int {\n\treturn num | (1 << uint(nth))\n}\n\n// OffBit returns the integer that has nth OFF bit.\n// If an argument has nth OFF bit, OffBit returns the argument.\nfunc OffBit(num, nth int) int {\n\treturn num & ^(1 << uint(nth))\n}\n\n// PopCount returns the number of ON bit of an argument.\nfunc PopCount(num int) int {\n\tres := 0\n\n\tfor i := 0; i < 70; i++ {\n\t\tif ((num >> uint(i)) & 1) == 1 {\n\t\t\tres++\n\t\t}\n\t}\n\n\treturn res\n}\n\n/*********** Arithmetic ***********/\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Sum returns multiple integers sum.\nfunc Sum(integers ...int) int {\n\ts := 0\n\n\tfor _, i := range integers {\n\t\ts += i\n\t}\n\n\treturn s\n}\n\n// PowInt is integer version of math.Pow\n// PowInt calculate a power by Binary Power (\u4e8c\u5206\u7d2f\u4e57\u6cd5(O(log e))).\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalfE := e / 2\n\t\thalf := PowInt(a, halfE)\n\t\treturn half * half\n\t}\n\n\treturn a * PowInt(a, e-1)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// Gcd returns the Greatest Common Divisor of two natural numbers.\n// Gcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Gcd uses the Euclidean Algorithm.\nfunc Gcd(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\n\t// Euclidean Algorithm\n\tfor b > 0 {\n\t\tdiv := a % b\n\t\ta, b = b, div\n\t}\n\n\treturn a\n}\n\n// Lcm returns the Least Common Multiple of two natural numbers.\n// Lcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Lcd uses the Euclidean Algorithm indirectly.\nfunc Lcm(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\n\t// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2\n\t// a' and b' are relatively prime numbers\n\t// gcd consists of prime numbers, that are included in a and b\n\tgcd := Gcd(a, b)\n\n\t// not (a * b / gcd), because of reducing a probability of overflow\n\treturn (a / gcd) * b\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\t// str := 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/********** 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 MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\nconst INF_INT64 = math.MaxInt64\nconst INF_BIT60 = 1 << 60\n\nvar n int\nvar S []rune\n\nfunc main() {\n\tn = ReadInt()\n\tS = ReadRuneSlice()\n\n\t// S[4], S[9] = S[9], S[4]\n\t// sub()\n\n\tans := 0\n\tl, r := 0, 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i; j < n; j++ {\n\t\t\t// \u5165\u308c\u66ff\u3048\u308b\n\t\t\tS[i], S[j] = S[j], S[i]\n\n\t\t\ttmp := sub()\n\t\t\tif ans < tmp {\n\t\t\t\tans = tmp\n\t\t\t\tl, r = i, j\n\t\t\t}\n\n\t\t\t// \u3082\u3068\u306b\u623b\u3059\n\t\t\tS[i], S[j] = S[j], S[i]\n\t\t}\n\t}\n\tfmt.Println(ans)\n\tfmt.Println(l+1, r+1)\n}\n\ntype Char struct {\n\tidx int\n\tc rune\n}\n\nfunc sub() int {\n\t// \u30b9\u30bf\u30c3\u30af\u3067\u5b57\u53e5\u89e3\u6790\u3059\u308b\n\ts := make([]Char, 0, 1000)\n\tmemo := []int{}\n\tfor i := 0; i < n; i++ {\n\t\tr := S[i]\n\t\tchar := Char{idx: i, c: r}\n\n\t\tif len(s) == 0 || r == '(' {\n\t\t\ts = append(s, char)\n\t\t\tcontinue\n\t\t}\n\n\t\tif r == ')' && s[len(s)-1].c == '(' {\n\t\t\tpopped := s[len(s)-1]\n\t\t\ts = s[:len(s)-1]\n\t\t\tif len(s) == 0 || s[len(s)-1].c == ')' {\n\t\t\t\tmemo = append(memo, popped.idx)\n\t\t\t}\n\t\t} else {\n\t\t\ts = append(s, char)\n\t\t}\n\t}\n\n\t// \u30b9\u30bf\u30c3\u30af\u306b\u4f55\u3082\u6b8b\u3063\u3066\u3044\u306a\u3044\u3068\u304d\u306fmemo\u306e\u9577\u3055\n\tif len(s) == 0 {\n\t\treturn len(memo)\n\t}\n\n\t// \u6b8b\u3063\u305f\u30ab\u30c3\u30b3\u306e\u6570\u3092\u30c1\u30a7\u30c3\u30af\n\top, cl := 0, 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i].c == '(' {\n\t\t\top++\n\t\t} else {\n\t\t\tcl++\n\t\t}\n\t}\n\t// \u6570\u304c\u4e00\u81f4\u3057\u306a\u3044\u3068\u30c0\u30e1\n\tif op != cl {\n\t\treturn 0\n\t}\n\n\tl, r := 0, 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i].c == '(' {\n\t\t\tr = s[i].idx\n\t\t\tbreak\n\t\t}\n\t}\n\tfor i := len(s) - 1; i >= 0; i-- {\n\t\tif s[i].c == ')' {\n\t\t\tl = s[i].idx\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// fmt.Println(memo)\n\t// for i := 0; i < len(s); i++ {\n\t// \tfmt.Printf(\"%d: %c\\n\", s[i].idx, s[i].c)\n\t// }\n\t// fmt.Printf(\"lidx: %d, ridx: %d\\n\", l, r)\n\n\tans := 0\n\tfor i := 0; i < len(memo); i++ {\n\t\tif l < memo[i] && memo[i] <= r {\n\t\t\tans++\n\t\t}\n\t}\n\n\treturn ans + 1\n}\n\n// MOD\u306f\u3068\u3063\u305f\u304b\uff1f\n// \u9077\u79fb\u3060\u3051\u3058\u3083\u306a\u304f\u3066\u6700\u5f8c\u306e\u6700\u5f8c\u3067\u3061\u3083\u3093\u3068\u53d6\u308c\u3088\uff1f\n\n/*******************************************************************/\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "bf58b1cd73301267dbaa9d02dac1f428", "src_uid": "2d10668fcc2d8e90e102b043f5e0578d", "difficulty": 2000.0} {"lang": "Go", "source_code": "package main\nimport (\n \"fmt\"\n \"sort\"\n)\n\ntype Trie struct {\n x, i, v int\n}\n\nvar n, m int\n\ntype Tries []*Trie\nvar P Tries\nfunc (s Tries) Len() int { return len(s) }\nfunc (s Tries) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\n\ntype ByPos struct {Tries}\nfunc (s ByPos) Less(i, j int) bool { return s.Tries[i].i < s.Tries[j].i}\n\ntype ByVal struct {Tries}\nfunc (s ByVal) Less(i, j int) bool { return s.Tries[i].x < s.Tries[j].x}\n\nfunc main(){\n fmt.Scanf(\"%d %d\", &n, &m)\n P = make([]*Trie, n)\n for i := range P {\n P[i] = new(Trie)\n fmt.Scan(&P[i].x)\n P[i].i = i\n }\n sort.Sort(ByVal{P})\n for i, p := range P {\n p.v = i % 2\n }\n sort.Sort(ByPos{P})\n for _, p := range P {\n fmt.Print(p.v, \" \")\n }\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "b546613a6a7ff25799176545985a469f", "src_uid": "692698d4b49ad446984f3a7a631f961d", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a,b,c int\n fmt.Scan(&a,&b,&c)\n fmt.Println(b*c + (a-1)*(b+c-1))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "d1a4fbe05e11c199e7fd06d8d007c78e", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "difficulty": 1200.0} {"lang": "Go", "source_code": "\ufeffpackage main\nimport (\n\t\"fmt\"\n\t//\"bufio\"\n\t//\"os\"\n\t//\"strconv\"\n)\n\nfunc main() {\n\tvar a,b,c,d int\n\tfmt.Scan(&a,&b,&c)\n\td=c*b+(a-1)*b+(c-1)*(a-1)\n\tfmt.Println(d)\n}\n\n\n\n\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "4c682903f73fe2450e0dfbd401b93da6", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da", "difficulty": 1200.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 CF1030C(_r io.Reader, out io.Writer) {\n\tvar n, s int\n\tvar a []byte\n\tFscan(bufio.NewReader(_r), &n, &a)\no:\n\tfor i, v := range a[:n-1] {\n\t\ts += int(v & 15)\n\t\tfor j := i + 1; j < n; {\n\t\t\ts2 := int(a[j] & 15)\n\t\t\tfor j++; j < n && (s2 < s || s2 == s && a[j] == '0'); j++ {\n\t\t\t\ts2 += int(a[j] & 15)\n\t\t\t}\n\t\t\tif s2 != s {\n\t\t\t\tcontinue o\n\t\t\t}\n\t\t}\n\t\tFprintln(out, \"YES\")\n\t\treturn\n\t}\n\tFprintln(out, \"NO\")\n}\n\nfunc main() { CF1030C(os.Stdin, os.Stdout) }\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "c9013d46ddfa08fc51a190c94541e2cc", "src_uid": "410296a01b97a0a39b6683569c84d56c", "difficulty": 1300.0} {"lang": "Go", "source_code": "// Author: sighduck\n// URL: https://codeforces.com/problemset/problem/128/A\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype Position struct {\n\tX int\n\tY int\n}\n\ntype Node struct {\n\tPosition Position\n\tTime int\n}\n\nfunc getNeighbors(p Position) []Position {\n\tvar validNeighbors []Position\n\tfor i := -1; i <= 1; i++ {\n\t\tfor j := -1; j <= 1; j++ {\n\t\t\tx := p.X + i\n\t\t\ty := p.Y + j\n\t\t\tif 0 <= x && x < 8 && 0 <= y && y < 8 {\n\t\t\t\tvalidNeighbors = append(validNeighbors, Position{X: x, Y: y})\n\t\t\t}\n\t\t}\n\t}\n\treturn validNeighbors\n}\n\nfunc hasStatue(board [8]string, p Position, time int) bool {\n\tif 0 <= p.X-time && p.X-time < 8 {\n\t\tif string(board[p.X-time][p.Y]) == \"S\" {\n\t\t\treturn true\n\t\t}\n\t}\n\tif 0 <= p.X-time-1 && p.X-time-1 < 8 {\n\t\tif string(board[p.X-time-1][p.Y]) == \"S\" {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc Solve(board [8]string) string {\n\tstack := []Node{{Position: Position{X: 7, Y: 0}, Time: 0}}\n\tfor {\n\t\tcurrentNode := stack[len(stack)-1]\n\t\tstack = stack[:len(stack)-1]\n\t\tif currentNode.Time == 8 || currentNode.Position.X == 0 {\n\t\t\treturn \"WIN\"\n\t\t}\n\t\tfor _, neighbor := range getNeighbors(currentNode.Position) {\n\t\t\tif !hasStatue(board, neighbor, currentNode.Time) {\n\t\t\t\tstack = append(stack, Node{Position: neighbor, Time: currentNode.Time + 1})\n\t\t\t}\n\t\t}\n\t\tif len(stack) == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn \"LOSE\"\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar board [8]string\n\tfor i := 0; i < 8; i++ {\n\t\tfmt.Fscanf(reader, \"%s\\n\", &board[i])\n\t}\n\tfmt.Fprintf(writer, \"%s\\n\", Solve(board))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "82311e2f2d7e1b318c52fe7e003f94ae", "src_uid": "f47e4ab041288ba9567c19930eb9a090", "difficulty": 1500.0} {"lang": "Go", "source_code": "// Author: sighduck\n// URL: https://codeforces.com/problemset/problem/128/A\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype Position struct {\n\tX int\n\tY int\n}\n\ntype Node struct {\n\tMaria Position\n\tTime int\n}\n\nfunc getNeighbors(p Position) []Position {\n\tneighbors := []Position{\n\t\t{X: p.X - 1, Y: p.Y - 1},\n\t\t{X: p.X - 1, Y: p.Y},\n\t\t{X: p.X - 1, Y: p.Y + 1},\n\t\t{X: p.X, Y: p.Y - 1},\n\t\t{X: p.X, Y: p.Y},\n\t\t{X: p.X, Y: p.Y + 1},\n\t\t{X: p.X + 1, Y: p.Y - 1},\n\t\t{X: p.X + 1, Y: p.Y},\n\t\t{X: p.X + 1, Y: p.Y + 1},\n\t}\n\tvar validNeighbors []Position\n\tfor _, neighbor := range neighbors {\n\t\tif 0 <= neighbor.X && neighbor.X < 8 && 0 <= neighbor.Y && neighbor.Y < 8 {\n\t\t\tvalidNeighbors = append(validNeighbors, neighbor)\n\t\t}\n\t}\n\treturn validNeighbors\n}\n\nfunc hasStatue(board [8]string, p Position, time int) bool {\n\tif 0 <= p.X-time && p.X-time < 8 {\n\t\tif string(board[p.X-time][p.Y]) == \"S\" {\n\t\t\treturn true\n\t\t}\n\t}\n\tif 0 <= p.X-time-1 && p.X-time-1 < 8 {\n\t\tif string(board[p.X-time-1][p.Y]) == \"S\" {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc Solve(board [8]string) string {\n\tstack := []Node{{Maria: Position{X: 7, Y: 0}, Time: 0}}\n\tfor {\n\t\tcurrentNode, stack := stack[len(stack)-1], stack[:len(stack)-1]\n\t\tif currentNode.Time == 8 || currentNode.Maria.X == 0 {\n\t\t\treturn \"WIN\"\n\t\t}\n\t\tfor _, neighbor := range getNeighbors(currentNode.Maria) {\n\t\t\tif !hasStatue(board, neighbor, currentNode.Time) {\n\t\t\t\tstack = append(stack, Node{Maria: neighbor, Time: currentNode.Time + 1})\n\t\t\t}\n\t\t}\n\t\tif len(stack) == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn \"LOSE\"\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar board [8]string\n\tfor i := 0; i < 8; i++ {\n\t\tfmt.Fscanf(reader, \"%s\\n\", &board[i])\n\t}\n\tfmt.Fprintf(writer, \"%s\\n\", Solve(board))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "b3fae584494ca5ea881345ae9786cb58", "src_uid": "f47e4ab041288ba9567c19930eb9a090", "difficulty": 1500.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc genCount(t string, target map[int]int) {\n\tfor _,ch := range t{\n\t\ttarget[int(ch-'0')]++\n\t}\n\ttarget[2] += target[5]\n\ttarget[6] += target[9]\n\tdelete(target,5)\n\tdelete(target,9)\n}\n\nfunc main() {\n\tvar t,seq string\n\tfmt.Scan(&t,&seq)\n\ttarget := make(map[int]int)\n\tsource := make(map[int]int)\n\tgenCount(t,target)\n\tgenCount(seq,source)\n\tvar cnt int = 200\n\tfor k,_ := range target{\n\t\tif target[k] == 0 {continue}\n\t\tif cnt > source[k]/target[k] {cnt = source[k]/target[k]}\n\t}\n\tfmt.Println(cnt)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "1ff60b5ea83e4ac283fcfd3238be02c6", "src_uid": "72a196044787cb8dbd8d350cb60ccc32", "difficulty": 1500.0} {"lang": "Go", "source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n var s string\n fmt.Scan(&s)\n fmt.Println(len(s)*25+26)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "3ef04d66e9626933171afa0d1e37c329", "src_uid": "556684d96d78264ad07c0cdd3b784bc9", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar inf int = 0x3f3f3f3f\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 s string\n\nfunc main() {\n\tfmt.Fscan(reader, &s)\n\tm := make(map[string]int)\n\tfor i := 0; i <= len(s); i++ {\n\t\tfor j := 0; j < 26; j++ {\n\t\t\tt := s[0:i] + string(j+'a') + s[i:len(s)]\n\t\t\tm[t] = 1\n\t\t}\n\t}\n\tfmt.Println(len(m))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "044e89ff21ce6a3cff0b1ec795d1e3de", "src_uid": "556684d96d78264ad07c0cdd3b784bc9", "difficulty": 900.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int64\n\tfmt.Scan(&n)\n\tif n <= 5 {\n\t\tif n == 2 || n == 5 {\n\t\t\tfmt.Println(\"1\")\n\t\t} else {\n\t\t\tfmt.Println(\"0\")\n\t\t}\n\t\treturn\n\t}\n\tlvl0 := (n - 2) / 3\n\tfree := (n - 2) % 3\n\thave := int64(0)\n\tif free == 0 {\n\t\thave = 0\n\t} else if free == 2 {\n\t\thave = 1\n\t} else {\n\t\tlvl0 -= 2\n\t\tif lvl0 < 2 {\n\t\t\tfmt.Println(\"0\")\n\t\t\treturn\n\t\t}\n\t\thave = 2\n\t}\n\tret := 1\n\tfor {\n\t\tlvl0 -= have\n\t\thave++\n\t\tlvl0 -= have\n\t\thave++\n\t\tlvl0 -= have\n\t\thave++\n\t\tlvl0 -= 2\n\t\tif lvl0 < have {\n\t\t\tbreak\n\t\t}\n\t\tret++\n\t}\n\tfmt.Println(ret)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "8481ff883da49a762ee7bc80adb699fc", "src_uid": "ab4f9cb3bb0df6389a4128e9ff1207de", "difficulty": 1700.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar (\n\tbufin = bufio.NewReader(os.Stdin)\n\tbufout = bufio.NewWriter(os.Stdout)\n)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(bufout, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(bufin, f, a...) }\n\n/*\nf(x) = 2*x - .5\n4*x - 1.5\n2^(n+1) x - (2^n - 1)\n*/\n\nconst M = 1000000007\n\nfunc main() {\n\tdefer bufout.Flush()\n\tvar N, K uint64\n\tscanf(\"%d%d\", &N, &K)\n\tN = (2*N - 1) % M\n\tz := getx(K)\n\tprintf(\"%d\\n\", (int64(z)*int64(N)+1)%M)\n}\n\nfunc getx(N uint64) int {\n\tif N < 30 {\n\t\treturn 1 << N\n\t}\n\tif N%2 == 0 {\n\t\tY := getx(N >> 1)\n\t\treturn int(int64(Y) * int64(Y) % M)\n\t}\n\treturn getx(N-1) * 2 % M\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "7190513771b5f25d0d2dd68b3fadb8a9", "src_uid": "e0e017e8c8872fc1957242ace739464d", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar (\n\tbufin = bufio.NewReader(os.Stdin)\n\tbufout = bufio.NewWriter(os.Stdout)\n)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(bufout, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(bufin, f, a...) }\n\n/*\nf(x) = 2*x - .5\n4*x - 1.5\n2^(n+1) x - (2^n - 1)\n*/\n\nconst M = 1000000007\n\nfunc main() {\n\tdefer bufout.Flush()\n\tvar N, K uint64\n\tscanf(\"%d%d\", &N, &K)\n\tif N == 0 {\n\t\tprintf(\"0\\n\")\n\t\treturn\n\t}\n\tN = (2*N - 1) % M\n\tz := getx(K)\n\tprintf(\"%d\\n\", (int64(z)*int64(N)+1)%M)\n}\n\nfunc getx(N uint64) int {\n\tif N < 30 {\n\t\treturn 1 << N\n\t}\n\tif N%2 == 0 {\n\t\tY := getx(N >> 1)\n\t\treturn int(int64(Y) * int64(Y) % M)\n\t}\n\treturn getx(N-1) * 2 % M\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "c8df4d1762a31739009791d815b330db", "src_uid": "e0e017e8c8872fc1957242ace739464d", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int64\n fmt.Scan(&n)\n for a := int64(1); ; a *= 3 {\n if (n%a) != 0 {\n fmt.Println((n/a)+1)\n break\n }\n }\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "8c0c7177b18e3a0b27ec887e5e7d7d9b", "src_uid": "7e7b59f2112fd200ee03255c0c230ebd", "difficulty": 1600.0} {"lang": "Go", "source_code": "\ufeffpackage main\nimport (\n\t\"fmt\"\n)\nfunc main() {\n\tvar n int64\n\tfmt.Scan(&n)\n\tfor ;n%3==0; {\n\t\tn/=3\n\t}\n\tfmt.Println(n/3+1)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "e695bc4ca0a52122a351bf6b53c8148e", "src_uid": "7e7b59f2112fd200ee03255c0c230ebd", "difficulty": 1600.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nvar rows = [][]int{\n\t{1 << 0, 1 << 1, 1 << 2},\n\t{1 << 3, 1 << 4, 1 << 5, 1 << 6},\n\t{1 << 7, 1 << 8, 1 << 9, 1 << 10, 1 << 11},\n\t{1 << 12, 1 << 13, 1 << 14, 1 << 15},\n\t{1 << 16, 1 << 17, 1 << 18},\n\n\t{1 << 0, 1 << 3, 1 << 7},\n\t{1 << 1, 1 << 4, 1 << 8, 1 << 12},\n\t{1 << 2, 1 << 5, 1 << 9, 1 << 13, 1 << 16},\n\t{1 << 6, 1 << 10, 1 << 14, 1 << 17},\n\t{1 << 11, 1 << 15, 1 << 18},\n\n\t{1 << 2, 1 << 6, 1 << 11},\n\t{1 << 1, 1 << 5, 1 << 10, 1 << 15},\n\t{1 << 0, 1 << 4, 1 << 9, 1 << 14, 1 << 18},\n\t{1 << 3, 1 << 8, 1 << 13, 1 << 17},\n\t{1 << 7, 1 << 12, 1 << 16},\n}\n\nvar mem [1 << 19]int\n\nfunc win(st int) bool {\n\tif st == 0 {\n\t\treturn false\n\t}\n\tif mem[st] != 0 {\n\t\treturn mem[st] == 1\n\t}\n\n\tfor _, row := range rows {\n\t\tfor i := range row {\n\t\t\tcur := 0\n\t\t\tfor _, m := range row[i:] {\n\t\t\t\tif st&m == 0 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcur |= m\n\t\t\t\tif !win(st & ^cur) {\n\t\t\t\t\tmem[st] = 1\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tmem[st] = 2\n\treturn false\n}\n\nfunc main() {\n\tst := 0\n\tfor i := 0; i < 19; i++ {\n\t\tvar w string\n\t\tfmt.Scan(&w)\n\t\tif w == \"O\" {\n\t\t\tst |= 1 << i\n\t\t}\n\t}\n\tif win(st) {\n\t\tfmt.Println(\"Karlsson\")\n\t} else {\n\t\tfmt.Println(\"Lillebror\")\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "97574659499f7d81de277df025e4cccf", "src_uid": "eaa022cc7846c983a826900dc6dd919f", "difficulty": 2000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\ts, _ := reader.ReadBytes('\\n')\n\tvar n, k uint64\n\tpos := readUint64(s, 0, &n)\n\treadUint64(s, pos+1, &k)\n\n\tfmt.Println(solve(int(n), int64(k)))\n}\n\nfunc readInt(bytes []byte, from int, val *int) int {\n\ti := from\n\tsign := 1\n\tif bytes[i] == '-' {\n\t\tsign = -1\n\t\ti++\n\t}\n\ttmp := 0\n\tfor i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {\n\t\ttmp = tmp*10 + int(bytes[i]-'0')\n\t\ti++\n\t}\n\t*val = tmp * sign\n\treturn i\n}\n\nfunc readNum(reader *bufio.Reader) (a int) {\n\tbs, _ := reader.ReadBytes('\\n')\n\treadInt(bs, 0, &a)\n\treturn\n}\n\nfunc readTwoNums(reader *bufio.Reader) (a int, b int) {\n\tres := readNNums(reader, 2)\n\ta, b = res[0], res[1]\n\treturn\n}\n\nfunc readThreeNums(reader *bufio.Reader) (a int, b int, c int) {\n\tres := readNNums(reader, 3)\n\ta, b, c = res[0], res[1], res[2]\n\treturn\n}\n\nfunc readNNums(reader *bufio.Reader, n int) []int {\n\tres := make([]int, n)\n\tx := 0\n\tbs, _ := reader.ReadBytes('\\n')\n\tfor i := 0; i < n; i++ {\n\t\tfor x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {\n\t\t\tx++\n\t\t}\n\t\tx = readInt(bs, x, &res[i])\n\t}\n\treturn res\n}\n\nfunc readUint64(bytes []byte, from int, val *uint64) int {\n\ti := from\n\n\tvar tmp uint64\n\tfor i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {\n\t\ttmp = tmp*10 + uint64(bytes[i]-'0')\n\t\ti++\n\t}\n\t*val = tmp\n\n\treturn i\n}\n\nconst N = 50\n\nvar s [N + 1]int\n\nvar dp [N + 1][2][2]int64\n\nfunc solve(n int, k int64) string {\n\tnPrefix := n>>1 + n&1\n\n\tfor i := 0; i <= n; i++ {\n\t\tfor j := 0; j < 2; j++ {\n\t\t\tfor k := 0; k < 2; k++ {\n\t\t\t\tdp[i][j][k] = -1\n\t\t\t}\n\t\t}\n\t\ts[i] = 0\n\t}\n\n\trem := k + 1\n\tvar found bool\n\n\tfor prefix := 0; prefix < 1< 0 {\n\t\t\ti := nPrefix - 1\n\t\t\tfor i >= 0 {\n\t\t\t\tif s[i] == 0 {\n\t\t\t\t\ts[i] = 1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\ts[i] = 0\n\t\t\t\ti--\n\t\t\t}\n\n\t\t\tfor j := n - nPrefix; j <= n-1-i; j++ {\n\t\t\t\tdp[j][0][0] = -1\n\t\t\t\tdp[j][0][1] = -1\n\t\t\t\tdp[j][1][0] = -1\n\t\t\t\tdp[j][1][1] = -1\n\t\t\t}\n\t\t}\n\n\t\t//firstPos := nPrefix\n\t\tless, lessRev := 1, 1\n\t\tif n&1 == 1 && s[nPrefix-1] == 1 {\n\t\t\tlessRev = 0\n\t\t}\n\t\ttmp := f(n, nPrefix, less, lessRev)\n\n\t\tif tmp < rem {\n\t\t\trem -= tmp\n\t\t} else {\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif !found {\n\t\treturn \"-1\"\n\t}\n\n\tless, lessRev := 1, 1\n\tif n&1 == 1 && s[nPrefix-1] == 1 {\n\t\tlessRev = 0\n\t}\n\n\tfor pos := nPrefix; pos < n; pos++ {\n\t\tnextLess, nextLessRev := less, lessRev\n\t\tif 0 < s[n-1-pos] {\n\t\t\tnextLess = 0\n\t\t}\n\t\tif 1 > s[n-1-pos] {\n\t\t\tnextLessRev = 1\n\t\t}\n\n\t\ttmp := f(n, pos+1, nextLess, nextLessRev)\n\n\t\tif tmp >= rem {\n\t\t\ts[pos] = 0\n\t\t\tless, lessRev = nextLess, nextLessRev\n\t\t\tcontinue\n\t\t}\n\n\t\trem -= tmp\n\t\ts[pos] = 1\n\t\tif 1 > s[n-1-pos] {\n\t\t\tless = 1\n\t\t}\n\t\tif 0 < s[n-1-pos] {\n\t\t\tlessRev = 0\n\t\t}\n\t}\n\tvar buf bytes.Buffer\n\tfor i := 0; i < n; i++ {\n\t\tif s[i] == 0 {\n\t\t\tbuf.WriteByte('0')\n\t\t} else {\n\t\t\tbuf.WriteByte('1')\n\t\t}\n\t}\n\treturn buf.String()\n}\n\nfunc f(n int, pos int, less int, lessRev int) int64 {\n\tif dp[pos][less][lessRev] != -1 {\n\t\treturn dp[pos][less][lessRev]\n\t}\n\tif pos >= n {\n\t\tdp[pos][less][lessRev] = int64(less & lessRev)\n\n\t\treturn dp[pos][less][lessRev]\n\t}\n\n\tvar ret int64\n\n\tfor i := 0; i <= 1; i++ {\n\t\tnextLess := less\n\t\tnextLessRev := lessRev\n\t\tif i > s[n-1-pos] {\n\t\t\tnextLess = 1\n\t\t} else if i < s[n-1-pos] {\n\t\t\tnextLess = 0\n\t\t}\n\t\tif 1-i > s[n-1-pos] {\n\t\t\tnextLessRev = 1\n\t\t} else if 1-i < s[n-1-pos] {\n\t\t\tnextLessRev = 0\n\t\t}\n\t\tret += f(n, pos+1, nextLess, nextLessRev)\n\t}\n\n\tdp[pos][less][lessRev] = ret\n\treturn ret\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "aa4d7f76a534a8f27c4d19910ade79eb", "src_uid": "0a4a418dafaee71f1b31c928fc2ad24a", "difficulty": 2600.0} {"lang": "Go", "source_code": "// A1. Good Matrix Elements\n/*\nThe Smart Beaver from ABBYY got hooked on square matrices. Now he is busy studying an n\u2009\u00d7\u2009n size matrix, where n is odd. The Smart Beaver considers the following matrix elements good:\n\n Elements of the main diagonal.\n Elements of the secondary diagonal.\n Elements of the \"middle\" row \u2014 the row which has exactly rows above it and the same number of rows below it.\n Elements of the \"middle\" column \u2014 the column that has exactly columns to the left of it and the same number of columns to the right of it.\n\nThe figure shows a 5\u2009\u00d7\u20095 matrix. The good elements are marked with green.\n\nHelp the Smart Beaver count the sum of good elements of the given matrix.\n\nInput\nThe first line of input data contains a single odd integer n. Each of the next n lines contains n integers a ij (0\u2009\u2264\u2009a ij\u2009\u2264\u2009100) separated by single spaces \u2014 the elements of the given matrix.\n\nThe input limitations for getting 30 points are:\n\n 1\u2009\u2264\u2009n\u2009\u2264\u20095\n\nThe input limitations for getting 100 points are:\n\n 1\u2009\u2264\u2009n\u2009\u2264\u2009101\n\nOutput\nPrint a single integer \u2014 the sum of good matrix elements.\n\nExamples\nInput\n3\n1 2 3\n4 5 6\n7 8 9\n\nOutput\n45\n\nInput\n5\n1 1 1 1 1\n1 1 1 1 1\n1 1 1 1 1\n1 1 1 1 1\n1 1 1 1 1\n\nOutput\n17\n\nNote\nIn the first sample all matrix elements will be good. Good elements in the second sample are shown on the figure.\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\tinput1, _ := reader.ReadString('\\n')\n\tn, _ := strconv.Atoi(strings.TrimSpace(input1))\n\n\ttotal := 0\n\tfor i := 0; i < n; i++ {\n\t\tinput2, _ := reader.ReadString('\\n')\n\t\tfor j := 0; j < n; j++ {\n\t\t\tarr := strings.Split(strings.TrimSpace(input2), \" \")\n\t\t\tx, _ := strconv.Atoi(arr[j])\n\t\t\tif i == j {\n\t\t\t\ttotal += x\n\t\t\t} else if i+j == n-1 {\n\t\t\t\ttotal += x\n\t\t\t} else if j == (n-1)/2 {\n\t\t\t\ttotal += x\n\t\t\t} else if i == (n-1)/2 {\n\t\t\t\ttotal += x\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Print(total)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "0be9d64917c289d82fa2dbdce5ac0abc", "src_uid": "5ebfad36e56d30c58945c5800139b880", "difficulty": 800.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 := bits.Len64(x)\n\tnlen := 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 := 0\n\tfor ; solve(n, x * 2) >= k; x *= 2 {\n\t\tl++\n\t}\n\n\tfor i := 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": true, "code_uid": "8b168bcdebf66280db9ed2f08a356dd0", "src_uid": "783c4b3179c558369f94f4a16ac562d4", "difficulty": 2100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\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 n := len(s)\n for i := range s {\n if s[i] == '.' {\n continue\n }\n jump := 0\n for {\n jump++\n if i + 4*jump >= n {\n break\n }\n okay := true\n for j := 1; j <= 4; j++ {\n if s[i+j*jump] == '.' {\n okay = false\n break\n }\n }\n if okay {\n writer.WriteString(\"yes\\n\")\n return\n }\n }\n }\n writer.WriteString(\"no\\n\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "ed4ff143547d4ad7d240847cfdbead5b", "src_uid": "12d451eb1b401a8f426287c4c6909e4b", "difficulty": 1300.0} {"lang": "Go", "source_code": "package main\n\n/*\n\tTo solve this problem basically we just need to generate login\n\tstring which alphabetically earliest than any other string login string.\n\n\tThe rules to generate login string are following:\n\t- must concatenate prefix of user's first name & last name\n\t- each prefix must not be empty\n\t- any prefix can be full name\n\n\tA string is said alphabetically earlier than other string if:\n\t- string is prefix of other string (ab >< abc, ab is earlier)\n\t- string is coincide up to some point with another\n\t string then string has char which alphabetically earlier than\n\t corresponding letter in another string (a >< ab >< ac => a < ab < ac)\n\n\tNotice that the minimum string we can generate is first[0] + last[0], yet\n\twith only this we already got decent enough early string. But can we make\n\tthis string much earlier?\n\n\tYes! If all char in first[1:] is alphabetically earlier than last[0]. So yeah,\n\tbasically we just need to get all chars in first name which earlier than last[0],\n\tthen combine them into a string.\n*/\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar first, second string\n\tstdio := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(stdio, \"%s %s\", &first, &second)\n\tidx := 1\n\tfor i := 1; i < len(first); i++ {\n\t\tif first[i] < second[0] {\n\t\t\tidx++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(first[:idx] + \"\" + second[:1])\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "3c1b2f21ba39e72c018305ea230df032", "src_uid": "aed892f2bda10b6aee10dcb834a63709", "difficulty": 1000.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar first, second string\n\tstdio := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(stdio, \"%s %s\", &first, &second)\n\tidx := 1\n\tfor i := 1; i < len(first); i++ {\n\t\tif first[i] < second[0] {\n\t\t\tidx++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(first[:idx] + \"\" + second[:1])\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "4c144cc5e5f3f71d9de09e1aef388f1d", "src_uid": "aed892f2bda10b6aee10dcb834a63709", "difficulty": 1000.0} {"lang": "Go", "source_code": "\ufeffpackage main\nimport (\n\t\"fmt\"\n)\nfunc divisors(n int) int{\n\tc:= 1\n\tfor d:=2; d<100; d++{\n\t\tif (n % d == 0){\n\t\t\talpha := 0;\n\t\t\tfor ;n % d == 0; {\n\t\t\t\tn /= d\n\t\t\t\talpha++\n\t\t\t}\n\t\t\tc *= (alpha + 1)\n\t\t}\n\t}\n\treturn c\n}\n\nfunc main() {\n\tvar sum , al, bl, cl int\n\tsum=0\n\tfmt.Scan(&al,&bl,&cl)\n\tfor a := 1; a <= al; a++{\n\t\tfor b := 1; b <= bl; b++{\n\t\t\tfor c := 1; c <= cl; c++{\n\t\t\t\tsum += divisors(a*b*c);\n\t\t\t\tsum %= 1073741824;\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n\n\n\n\n\n\n\n\n\n\n\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "7c3c2facfc5b61f95214fbe229c177ca", "src_uid": "4fdd4027dd9cd688fcc70e1076c9b401", "difficulty": 1300.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var s string\n fmt.Scanln(&s)\n res := 0\n for i, c := range s {\n if c >= 'a' && c <= 'z' {\n res = res - int(s[i]-'a') - 1\n }\n if c >= 'A' && c <= 'Z' {\n res = res + int(s[i]-'A') + 1\n }\n }\n fmt.Println(res)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "b9360e50b587db19485874fd142e5d70", "src_uid": "d3fa5a3a008048dc4a9fbce1ebc61d67", "difficulty": 2000.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\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\ta := make([]int, n)\n\tbribe := 0\n\n\tfor i := range a {\n\t\ta[i] = nextInt()\n\t}\n\n\tidx := max(a[1:]) + 1\n\n\tfor a[0] <= a[idx] {\n\t\ta[0]++\n\t\ta[idx]--\n\t\tbribe++\n\t\t// println(idx, a, bribe)\n\t\tidx = max(a[1:]) + 1\n\t}\n\n\tprintln(bribe)\n}\n\nfunc max(a []int) int {\n\tidx := 0\n\n\tfor i := range a {\n\t\tif a[i] > a[idx] {\n\t\t\tidx = i\n\t\t}\n\t}\n\n\treturn idx\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "7da5c15b5449e22c8322f64359e755f8", "src_uid": "aa8fabf7c817dfd3d585b96a07bb7f58", "difficulty": 1200.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\tvotes := make([]int, n)\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tfor i := 0; scanner.Scan() && i < n; i++ {\n\t\ta, err := strconv.Atoi(scanner.Text())\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tvotes[i] = a\n\t}\n\n\tbubble_sort(votes, 1, n)\n\n\tbribing := 0\n\tfor votes[0] <= votes[1] {\n\t\tvotes[0]++\n\t\tvotes[1]--\n\t\tbribing++\n\t\tif len(votes) > 2 {\n\t\t\tfor i := 2; i < n && votes[i-1] < votes[i]; i++ {\n\t\t\t\tswap(i-1, i, votes)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(bribing)\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, start, end int) {\n\tfor i := start; i < end; i++ {\n\t\tfor j := start; j < end; 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": "923bc10c316f2d5653d30f592c6df329", "src_uid": "aa8fabf7c817dfd3d585b96a07bb7f58", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var total, downloaded, q float64\n fmt.Scanf(\"%f %f %f\", &total, &downloaded, &q)\n\n var listened = 0.0\n var ans = 0\n\n for {\n ans++\n\n var t = (downloaded - listened) * q\n if t >= total {\n break\n } else {\n downloaded = t\n listened = 0\n }\n }\n\n fmt.Println(ans)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "2f21cfafd0d42e36d014c121556763f4", "src_uid": "0d01bf286fb2c7950ce5d5fa59a17dd9", "difficulty": 1500.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\nfunc check(n, m int, matrix [][]int) (bool, int, int, int, int) {\n\tlegalRow := []int{}\n\tlegalCol := []int{}\n\tfor i := 0; i <= n-3; i++ {\n\t\tfor j := 0; j <= m-3; j++ {\n\t\t\tvar p [16]bool\n\t\t\tk := matrix[i][j] >> 4\n\t\t\tpFailed, kFailed := false, false\n\n\t\t\tfor r := 0; r < 3; r++ {\n\t\t\t\tfor c := 0; c < 3; c++ {\n\t\t\t\t\tpm, km := matrix[i+r][j+c]&0xf, matrix[i+r][j+c]>>4\n\t\t\t\t\tif p[pm] {\n\t\t\t\t\t\tpFailed = true\n\t\t\t\t\t}\n\t\t\t\t\tif k != km {\n\t\t\t\t\t\tkFailed = true\n\t\t\t\t\t}\n\t\t\t\t\tp[pm] = true\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !pFailed || !kFailed {\n\t\t\t\tlegalRow = append(legalRow, i)\n\t\t\t\tlegalCol = append(legalCol, j)\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < len(legalRow); i++ {\n\t\tfor j := i + 1; j < len(legalRow); j++ {\n\t\t\tif legalRow[j]-legalRow[i] >= 3 || legalCol[j]-legalCol[i] >= 3 {\n\t\t\t\treturn true, legalRow[i], legalCol[i], legalRow[j], legalCol[j]\n\t\t\t}\n\t\t}\n\t}\n\treturn false, 0, 0, 0, 0\n}\n\nfunc main() {\n\tbs, _ := ioutil.ReadAll(os.Stdin)\n\treader := bytes.NewReader(bs)\n\tcards := make([]bool, 64)\n\n\tpointByte := [14]byte{'0', 'A', '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K'}\n\tkindByte := [4]byte{'C', 'D', 'H', 'S'}\n\tpoint := map[byte]int{\n\t\t'A': 1,\n\t\t'2': 2,\n\t\t'3': 3,\n\t\t'4': 4,\n\t\t'5': 5,\n\t\t'6': 6,\n\t\t'7': 7,\n\t\t'8': 8,\n\t\t'9': 9,\n\t\t'T': 10,\n\t\t'J': 11,\n\t\t'Q': 12,\n\t\t'K': 13,\n\t}\n\tkind := map[byte]int{\n\t\t'C': 0,\n\t\t'D': 1,\n\t\t'H': 2,\n\t\t'S': 3,\n\t}\n\tvar n, m int\n\tfmt.Fscanf(reader, \"%d %d\\n\", &n, &m)\n\tmatrix := make([][]int, n)\n\tj1, j2 := false, false\n\tvar j1Row, j1Col, j2Row, j2Col int\n\tfor i := 0; i < n; i++ {\n\t\tmatrix[i] = make([]int, m)\n\t\tfor j := 0; j < m-1; j++ {\n\t\t\tvar s string\n\t\t\tfmt.Fscanf(reader, \"%s \", &s)\n\t\t\tif s == \"J1\" {\n\t\t\t\tj1, j1Row, j1Col = true, i, j\n\t\t\t} else if s == \"J2\" {\n\t\t\t\tj2, j2Row, j2Col = true, i, j\n\t\t\t} else {\n\t\t\t\tmatrix[i][j] = point[s[0]] + (kind[s[1]] << 4)\n\t\t\t\tcards[matrix[i][j]] = true\n\t\t\t}\n\t\t}\n\t\tvar s string\n\t\tfmt.Fscanf(reader, \"%s\\n\", &s)\n\t\tif s == \"J1\" {\n\t\t\tj1, j1Row, j1Col = true, i, m-1\n\t\t} else if s == \"J2\" {\n\t\t\tj2, j2Row, j2Col = true, i, m-1\n\t\t} else {\n\t\t\tmatrix[i][m-1] = point[s[0]] + (kind[s[1]] << 4)\n\t\t\tcards[matrix[i][m-1]] = true\n\t\t}\n\t}\n\tfor i := 0; i < 4; i++ {\n\t\tcards[i<<4] = true\n\t\tcards[(i<<4)+14] = true\n\t\tcards[(i<<4)+15] = true\n\t}\n\tfor i := 0; i < 64; i++ {\n\t\tfor j := 0; j < 64; j++ {\n\t\t\tif i == j || cards[i] || cards[j] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif j1 {\n\t\t\t\tmatrix[j1Row][j1Col] = i\n\t\t\t}\n\t\t\tif j2 {\n\t\t\t\tmatrix[j2Row][j2Col] = j\n\t\t\t}\n\t\t\tif ok, r0, c0, r1, c1 := check(n, m, matrix); ok {\n\t\t\t\tfmt.Printf(\"Solution exists.\\n\")\n\t\t\t\tif j1 && !j2 {\n\t\t\t\t\tfmt.Printf(\"Replace J1 with %c%c.\\n\", pointByte[i&0xf], kindByte[i>>4])\n\t\t\t\t}\n\t\t\t\tif j2 && !j1 {\n\t\t\t\t\tfmt.Printf(\"Replace J2 with %c%c.\\n\", pointByte[j&0xf], kindByte[j>>4])\n\t\t\t\t}\n\t\t\t\tif !j1 && !j2 {\n\t\t\t\t\tfmt.Printf(\"There are no jokers.\\n\")\n\t\t\t\t}\n\t\t\t\tif j1 && j2 {\n\t\t\t\t\tfmt.Printf(\"Replace J1 with %c%c and J2 with %c%c.\\n\", pointByte[i&0xf], kindByte[i>>4], pointByte[j&0xf], kindByte[j>>4])\n\t\t\t\t}\n\t\t\t\tfmt.Printf(\"Put the first square to (%d, %d).\\n\", r0+1, c0+1)\n\t\t\t\tfmt.Printf(\"Put the second square to (%d, %d).\\n\", r1+1, c1+1)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Printf(\"No solution.\")\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "cfa0386ce6a5630d375141bf8017e79e", "src_uid": "b3f29d9c27cbfeadb96b6ac9ffd6bc8f", "difficulty": 2200.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"fmt\"\n\t\"sort\"\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([]int, n)\n\tfor i, ch := range s {\n\t\tpal[i] = int(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[int]bool{}\n\tfor i := 0; i < k; i++ {\n\t\tseen['a'+int(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 := []int{}\n\tfor ch, ok := range seen {\n\t\tif !ok {\n\t\t\tneed = append(need, ch)\n\t\t}\n\t}\n\tsort.Ints(need)\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": "352fc5ab40ac2c84d0108b8f850a003a", "src_uid": "9d1dd9d722e5fe46823224334b3b208a", "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\nvar arr [][]int64\n\nfunc min(a, b int64) int64 {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc main() {\n\tbs, _ := ioutil.ReadAll(os.Stdin)\n\treader := bytes.NewBuffer(bs)\n\n\tvar n, m, a, b int\n\tvar g, x, y, z int64\n\tfmt.Fscanf(reader, \"%d %d %d %d\\n\", &n, &m, &a, &b)\n\tfmt.Fscanf(reader, \"%d %d %d %d\\n\", &g, &x, &y, &z)\n\tarr = make([][]int64, n)\n\tfor i := 0;i < n;i ++ {\n\t\tarr[i] = make([]int64, m)\n\t\tfor j := 0;j < m;j ++ {\n\t\t\tarr[i][j] = g\n\t\t\tg = (g * x + y) % z\n\t\t}\n\t}\n\tvar ax, bx int\n\tfor bx = 2;bx <= b;bx <<= 1 {\n\t\tfor i := 0;i < n;i ++ {\n\t\t\tfor j := 0;j <= m - bx;j ++ {\n\t\t\t\tarr[i][j] = min(arr[i][j], arr[i][j + bx / 2])\n\t\t\t}\n\t\t}\n\t}\n\tfor ax = 2;ax <= a;ax <<= 1 {\n\t\tfor i := 0;i <= n - ax;i ++ {\n\t\t\tfor j := 0;j < m;j ++ {\n\t\t\t\tarr[i][j] = min(arr[i][j], arr[i + ax / 2][j])\n\t\t\t}\n\t\t}\n\t}\n\tax, bx = ax / 2, bx / 2\n\tvar res int64 = 0\n\tfor i := 0;i <= n - a;i ++ {\n\t\tfor j := 0;j <= m - b;j ++ {\n\t\t\tdi, dj := i + a, j + b\n\t\t\tres += min(min(arr[i][j], arr[di - ax][j]), min(arr[i][dj - bx], arr[di - ax][dj - bx]))\n\t\t}\n\t}\n\tfmt.Printf(\"%d\", res)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "1065e536dd2da331cb3d3b1a901bb3e1", "src_uid": "4618fbffb2b9d321a6d22c11590a4773", "difficulty": 2100.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\ti:=0.0\n\tfmt.Scanln(&i)\n\tc:=math.Log2(i)\n\td:=float64(int(c))\n\tif c-d<0.000001 {\n\t\tfmt.Println(\"YES\")\n\t}else {\n\t\tfmt.Println(\"NO\")\n\t}\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "c3dac983538888cbae2ae9b1fcdcaf47", "src_uid": "4bd174a997707ed3a368bd0f2424590f", "difficulty": 1200.0} {"lang": "Go", "source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\ntype point struct {\n\tx, y int\n}\n\nvar ans int64\n\nconst (\n\tmod = int(1e9 + 7)\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tn, total := 0, 0\n\tfmt.Fscanf(in, \"%d %d\\n\", &n, &total)\n\tt := make([]int, n)\n\tg := make([]int, n)\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(in, \"%d %d\\n\", &t[i], &g[i])\n\t\tsum += t[i]\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tif t[i] < t[j] {\n\t\t\t\tt[i], t[j] = t[j], t[i]\n\t\t\t\tg[i], g[j] = g[j], g[i]\n\t\t\t}\n\t\t}\n\t}\n\thelp(0, n, total, t, g, 0, 0, 0, 0, sum)\n\tfmt.Fprintf(out, \"%d\\n\", ans)\n\treturn\n}\n\nfunc help(i int, n int, total int, t []int, g []int, cur int, c1, c2, c3 int, remaining int) {\n\t//fmt.Println(i, cur)\n\tif i == n {\n\t\tif cur == total {\n\t\t\tcal(c1, c2, c3)\n\t\t}\n\t\treturn\n\t}\n\tif cur > total {\n\t\treturn\n\t}\n\tif cur+remaining < total {\n\t\treturn\n\t}\n\tswitch g[i] {\n\tcase 1:\n\t\thelp(i+1, n, total, t, g, cur+t[i], c1+1, c2, c3, remaining-t[i])\n\tcase 2:\n\t\thelp(i+1, n, total, t, g, cur+t[i], c1, c2+1, c3, remaining-t[i])\n\tcase 3:\n\t\thelp(i+1, n, total, t, g, cur+t[i], c1, c2, c3+1, remaining-t[i])\n\t}\n\thelp(i+1, n, total, t, g, cur, c1, c2, c3, remaining-t[i])\n}\n\nfunc cal(c1, c2, c3 int) {\n\ta := []int{c1, c2, c3}\n\tsort.Ints(a)\n\ttmp := int64(try(c1, c2, c3, 0))\n\ttmp %= int64(mod)\n\tfor i := 1; i <= c1; i++ {\n\t\ttmp *= int64(i)\n\t\ttmp %= int64(mod)\n\t}\n\tfor i := 1; i <= c2; i++ {\n\t\ttmp *= int64(i)\n\t\ttmp %= int64(mod)\n\t}\n\tfor i := 1; i <= c3; i++ {\n\t\ttmp *= int64(i)\n\t\ttmp %= int64(mod)\n\t}\n\tans += tmp\n\tans %= int64(mod)\n}\n\nfunc try(a, b, c int, last int) int64 {\n\tif a == 0 && b == 0 && c == 0 {\n\t\treturn 1\n\t}\n\tif a < 0 || b < 0 || c < 0 {\n\t\treturn 0\n\t}\n\tif last == 0 {\n\t\treturn try(a-1, b, c, 1) + try(a, b-1, c, 2) + try(a, b, c-1, 3)\n\t}\n\tif last == 1 {\n\t\treturn try(a, b-1, c, 2) + try(a, b, c-1, 3)\n\t}\n\tif last == 2 {\n\t\treturn try(a-1, b, c, 1) + try(a, b, c-1, 3)\n\t}\n\treturn try(a-1, b, c, 1) + try(a, b-1, c, 2)\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "588b5df0f70abbe85a1ebc6b152fe5dd", "src_uid": "ac2a37ff4c7e89a345b189e4891bbf56", "difficulty": 2100.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nconst (\n\tMaxSum = 10005\n\tMaxNums = 101\n\tType = 2\n\tSame = 0\n\tDifferent = 1\n)\n\nvar n int\nvar a [MaxNums]int\nvar dp[MaxSum][MaxNums][Type]bool\n\nfunc computeDp() {\n\tdp[a[0]][1][Same] = true\n\tfor i := 1; i < n; i++ {\n\t\tfor s := MaxSum - 1; s >= 0; s-- {\n\t\t\tfor cnt := 1; cnt <= i; cnt++ {\n\t\t\t\tif dp[s][cnt][Same] {\n\t\t\t\t\tk := s / cnt\n\t\t\t\t\tif k == a[i] {\n\t\t\t\t\t\tdp[s+k][cnt+1][Same] = true\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdp[s+a[i]][cnt+1][Different] = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif dp[s][cnt][Different] {\n\t\t\t\t\tdp[s+a[i]][cnt+1][Different] = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdp[a[i]][1][Same] = true\n\t}\n}\n\nfunc main() {\n\tfmt.Scanf(\"%d\\n\", &n)\n\tcounter := make(map[int]int)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &a[i])\n\t\tcounter[a[i]]++\n\t}\n\n\tif len(counter) == 2 {\n\t\tfmt.Println(n)\n\t\treturn\n\t}\n\n\tcomputeDp()\n\n\tbest := 1\n\tfor weight := range counter {\n\t\tfor count := 1; count <= counter[weight]; count++ {\n\t\t\tif dp[weight*count][count][Same] && !dp[weight*count][count][Different] && best < count {\n\t\t\t\tbest = count\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(best)\n}", "lang_cluster": "Go", "compilation_error": false, "code_uid": "e866f064c7ede5f1d473db38450b3dc9", "src_uid": "ccc4b27889598266e8efe73b8aa3666c", "difficulty": 2100.0} {"lang": "Go", "source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar Ss [3]string\n\tvar m map[byte]int = map[byte]int{'A': 0, 'B': 1, 'C': 2}\n\tvar a [3]rune = [3]rune{'A', 'B', 'C'}\n\tvar tmpR rune\n\tvar tmpI int\n\n\tfor i := 0; i < 3; i++ {\n\t\tfmt.Scanf(\"%s\\n\", &Ss[i])\n\t}\n\t// fmt.Println(Ss)\n\t// fmt.Println(m)\n\t// fmt.Println(a)\n\n\tfor i := 0; i < 3; i++ {\n\t\tif Ss[i][1] == '<' {\n\t\t\tif !(m[Ss[i][0]] < m[Ss[i][2]]) {\n\t\t\t\ttmpR = a[m[Ss[i][0]]]\n\t\t\t\ta[m[Ss[i][0]]] = a[m[Ss[i][2]]]\n\t\t\t\ta[m[Ss[i][2]]] = tmpR\n\t\t\t\ttmpI = m[Ss[i][0]]\n\t\t\t\tm[Ss[i][0]] = m[Ss[i][2]]\n\t\t\t\tm[Ss[i][2]] = tmpI\n\t\t\t}\n\t\t} else {\n\t\t\tif !(m[Ss[i][0]] > m[Ss[i][2]]) {\n\t\t\t\ttmpR = a[m[Ss[i][0]]]\n\t\t\t\ta[m[Ss[i][0]]] = a[m[Ss[i][2]]]\n\t\t\t\ta[m[Ss[i][2]]] = tmpR\n\t\t\t\ttmpI = m[Ss[i][0]]\n\t\t\t\tm[Ss[i][0]] = m[Ss[i][2]]\n\t\t\t\tm[Ss[i][2]] = tmpI\n\t\t\t}\n\t\t}\n\t}\n\tif Ss[0][1] == '<' {\n\t\tif !(m[Ss[0][0]] < m[Ss[0][2]]) {\n\t\t\ttmpR = a[m[Ss[0][0]]]\n\t\t\ta[m[Ss[0][0]]] = a[m[Ss[0][2]]]\n\t\t\ta[m[Ss[0][2]]] = tmpR\n\t\t\ttmpI = m[Ss[0][0]]\n\t\t\tm[Ss[0][0]] = m[Ss[0][2]]\n\t\t\tm[Ss[0][2]] = tmpI\n\t\t}\n\t} else {\n\t\tif !(m[Ss[0][0]] > m[Ss[0][2]]) {\n\t\t\ttmpR = a[m[Ss[0][0]]]\n\t\t\ta[m[Ss[0][0]]] = a[m[Ss[0][2]]]\n\t\t\ta[m[Ss[0][2]]] = tmpR\n\t\t\ttmpI = m[Ss[0][0]]\n\t\t\tm[Ss[0][0]] = m[Ss[0][2]]\n\t\t\tm[Ss[0][2]] = tmpI\n\t\t}\n\t}\n\tif Ss[1][1] == '<' {\n\t\tif !(m[Ss[1][0]] < m[Ss[1][2]]) {\n\t\t\tfmt.Println(\"Impossible\")\n\t\t} else {\n\t\t\tfor i := 0; i < 3; i++ {\n\t\t\t\tfmt.Printf(\"%c\", a[i])\n\t\t\t}\n\t\t\tfmt.Println()\n\t\t}\n\t} else {\n\t\tif !(m[Ss[1][0]] > m[Ss[1][2]]) {\n\t\t\tfmt.Println(\"Impossible\")\n\t\t} else {\n\t\t\tfor i := 0; i < 3; i++ {\n\t\t\t\tfmt.Printf(\"%c\", a[i])\n\t\t\t}\n\t\t\tfmt.Println()\n\t\t}\n\t}\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "e6059eba85b96ce5f270f698796854c1", "src_uid": "97fd9123d0fb511da165b900afbde5dc", "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 n := len(s)\n max := 0\n seen := map[string]bool{}\n for i := 0; i < n; i++ {\n for j := i+1; j <= n; j++ {\n if seen[s[i:j]] && j-i > max {\n max = j-i\n }\n seen[s[i:j]] = true\n }\n }\n writer.WriteString(fmt.Sprintf(\"%d\\n\", max))\n}\n", "lang_cluster": "Go", "compilation_error": false, "code_uid": "a128fb7486b6faa4a78e9c442000a6e1", "src_uid": "13b5cf94f2fabd053375a5ccf3fd44c7", "difficulty": 1200.0}