The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
Job manager crashed while running this job (missing heartbeats).
Error code:   JobManagerCrashedError

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

problem_id
string
problem
string
answer
string
test_cases
string
eval_spec
string
source
string
source_platform
string
original_domain
string
category
null
codecontests__test__code_contests_train.riegeli-00000-of-00128_0
Alice and Johnny are playing a simple guessing game. Johnny picks an arbitrary positive integer n (1 ≤ n ≤ 10^9) and gives Alice exactly k hints about the value of n. It is Alice's task to guess n, based on the received hints. Alice often has a serious problem guessing the value of n, and she's beginning to suspect t...
[{"code": "from collections import Counter\nminr = 1\nmaxr = 10 ** 9 + 1\nt = int(raw_input())\nfor i in xrange(t):\n k = int(raw_input())\n cnt = Counter()\n for j in xrange(k):\n op, num, ans = raw_input().split()\n ans = ans.upper()\n num = int(num)\n if op == '<':\n i...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00000-of-00128_0__public__0000", "expected_output": {"kind": "stdout", "value": "0\n1\n2"}, "input": {"kind": "stdin", "value": "3\n2\n< 100 No\n> 100 No\n3\n< 2 Yes\n> 4 Yes\n= 3 No\n6\n< 2 Yes\n> 1 Yes\n= 1 Yes\n= 1 Yes\n> 1 Yes\n= 1 Yes"}, "metadata": {},...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00000-of-00128_1
Spring is interesting season of year. Chef is thinking about different things, but last time he thinks about interesting game - "Strange Matrix". Chef has a matrix that consists of n rows, each contains m elements. Initially, the element aij of matrix equals j. (1 ≤ i ≤ n, 1 ≤ j ≤ m). Then p times some element aij is...
[{"code": "n,m,p=map(int,raw_input().split())\nb=[]\nfor x in xrange(p):\n a=map(int,raw_input().split())\n b.append(a)\nb.sort()\npos=0\nfor i in xrange(1,n+1):\n if b[pos][0]!=i:\n ans=m-1\n else:\n count=0\n prev=0\n ans=m-1\n while b[pos][0]==i and m!=1:\n c...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00000-of-00128_1__public__0000", "expected_output": {"kind": "stdout", "value": "3\n3\n-1\n4"}, "input": {"kind": "stdin", "value": "4 4 6\n2 2\n3 2 \n3 2 \n4 3\n4 4\n4 3"}, "metadata": {}, "visibility": "public"}]
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00000-of-00128_2
Chef loves games! But he likes to invent his own. Now he plays game "Digit Jump". Chef has sequence of digits S1, S2,..., SN,. He is staying in the first digit (S1) and want to reach the last digit (SN) in the minimal number of jumps. While staying in some digit x with index i (digit Si) Chef can jump into digits with...
[{"code": "import sys\n\ns = raw_input().strip()\n\ndigits = [[] for i in xrange(10)]\ndist = [-1] * (len(s))\nused = [False] * 10\n\nfor i in xrange(len(s)):\n digits[int(s[i])].append(i)\n\ndist[0] = 0\nq = [0]\n\nwhile True:\n v = q.pop(0)\n cur = dist[v]\n\n if v == len(s)-1:\n print cur\n ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00000-of-00128_2__public__0000", "expected_output": {"kind": "stdout", "value": "1\n"}, "input": {"kind": "stdin", "value": "01234567890"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00000-of-00128_2...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00000-of-00128_80
You will be given an integer a and a string s consisting of lowercase English letters as input. Write a program that prints s if a is not less than 3200 and prints `red` if a is less than 3200. Constraints * 2800 \leq a < 5000 * s is a string of length between 1 and 10 (inclusive). * Each character of s is a lowerca...
[{"code": "a,s = int(input()),input()\nprint(s if a>=3200 else \"red\")", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00000-of-00128_80__ref__0000", "source": "benchmark"}, {"code": "import java.util.*;\n \npublic class Main {\n \tpubli...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00000-of-00128_80__public__0000", "expected_output": {"kind": "stdout", "value": "red"}, "input": {"kind": "stdin", "value": "4049\nred"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00000-of-00128_80...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00000-of-00128_82
You are given an integer N. Among the integers between 1 and N (inclusive), how many Shichi-Go-San numbers (literally "Seven-Five-Three numbers") are there? Here, a Shichi-Go-San number is a positive integer that satisfies the following condition: * When the number is written in base ten, each of the digits `7`, `5` ...
[{"code": "\timport java.util.*;\n\timport java.util.Map.Entry;\n\t \n\t \n\t class Main {\n\t//\t static int mod = (int) (Math.pow(10,9)+7);\n\t\t static int mod = 2019;\n\t\t static List<ArrayList<Integer>> list = new ArrayList<ArrayList<Integer>>();\n\t public static void main(String[] args) {\n\t \t\n\t ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00000-of-00128_82__public__0000", "expected_output": {"kind": "stdout", "value": "4"}, "input": {"kind": "stdin", "value": "575"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00000-of-00128_82__public...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00000-of-00128_83
We have a canvas divided into a grid with H rows and W columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Initially, all the squares are white. square1001 wants to draw a picture with black paint. His specific objective is to make Square (i, j) black when s_{i, ...
[{"code": "#include <iostream>\nusing namespace std;\nint h, w, fl=1, a[55][55];\nstring s;\nint main() {\n\tint i, j;\n\tcin>>h>>w;\n\tfor(i=1; i<=h; i++) {\n\t\tcin>>s;\n\t\tfor(j=1; j<=w; j++) a[i][j] = s[j-1]=='.' ? 0:1;\n\t}\n\tfor(i=1; i<=h; i++) for(j=1; j<=w; j++) {\n\t\tif(a[i][j]==1 && a[i-1][j] + a[i+1][j] +...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00000-of-00128_83__public__0000", "expected_output": {"kind": "stdout", "value": "Yes"}, "input": {"kind": "stdin", "value": "3 3\n.#.\n###\n.#."}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00000-of...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00000-of-00128_87
Alice, Bob and Charlie are playing Card Game for Three, as below: * At first, each of the three players has a deck consisting of some number of cards. Alice's deck has N cards, Bob's deck has M cards, and Charlie's deck has K cards. Each card has a letter `a`, `b` or `c` written on it. The orders of the cards in the d...
[{"code": "#include<bits/stdc++.h>\nusing namespace std ;\n#define Next( i, x ) for( register int i = head[x]; i; i = e[i].next )\n#define rep( i, s, t ) for( register int i = (s); i <= (t); ++ i )\n#define drep( i, s, t ) for( register int i = (t); i >= (s); -- i )\n#define re register\n#define int long long\nint gi()...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00000-of-00128_87__public__0000", "expected_output": {"kind": "stdout", "value": "1227"}, "input": {"kind": "stdin", "value": "4 2 2"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00000-of-00128_87__p...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00001-of-00128_2
For any positive integer, we define a digit rotation as either moving the first digit to the end of the number (left digit rotation), or the last digit to the front of the number (right digit rotation). For example, the number 12345 could be left digit rotated to 23451, or right digit rotated to 51234. If there are any...
[{"code": "# code chef - easy - digit rotation\n\ndef left(s):\n return str(int(s[-1]+s[:-1]))\n\ndef right(s):\n return str(int(s[1:]+s[0]))\n\nnCases = int(raw_input())\n\nfor iter in range(nCases):\n number = raw_input()\n\n if len(number)==1:\n print number\n continue\n\n best = max(in...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00001-of-00128_2__public__0000", "expected_output": {"kind": "stdout", "value": "51234\n54321\n11090\n211011\n7\n9\n"}, "input": {"kind": "stdin", "value": "6\n12345\n54321\n10901\n211011\n7\n90"}, "metadata": {}, "visibility": "public"}]
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00001-of-00128_5
Alok-nath is man of equality. He needs your help to divide his “sanskars” evenly amongst all his followers. By doing this, Alok-nath can create equality amongst his followers and he'll be called a true “sanskari”. Alok-nath has N sanskars, and K followers. Each sanskar is given a numerical value which shows its intensi...
[{"code": "def possible(A, e, n):\n def rec(i, r):\n if r == 0:\n return True\n if i == n:\n return False\n if A[i] > 0 and r >= A[i]:\n p = rec(i + 1, r - A[i])\n if p:\n A[i] = 0\n return True\n p = rec(i + 1, r)\...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00001-of-00128_5__public__0000", "expected_output": {"kind": "stdout", "value": "yes\nno"}, "input": {"kind": "stdin", "value": "2\n5 3\n1 2 4 5 6\n5 3\n1 2 4 5 7"}, "metadata": {}, "visibility": "public"}]
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00001-of-00128_80
Given is a sequence of N integers A_1, \ldots, A_N. Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}. Constraints * 1 \leq N \leq 100 * 1 \leq A_i \leq 1000 Input Input is given from Standard Input in the following format: N A_1 A_2 \...
[{"code": "n,a=open(0)\nprint(1/sum(1/int(i)for i in a.split()))", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00001-of-00128_80__ref__0000", "source": "benchmark"}, {"code": "import java.util.Scanner;\n\npublic class Main {\n public s...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00001-of-00128_80__public__0000", "expected_output": {"kind": "stdout", "value": "7.5"}, "input": {"kind": "stdin", "value": "2\n10 30"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00001-of-00128_80_...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00001-of-00128_81
There are two buttons, one of size A and one of size B. When you press a button of size X, you get X coins and the size of that button decreases by 1. You will press a button twice. Here, you can press the same button twice, or press both buttons once. At most how many coins can you get? Constraints * All values i...
[{"code": "\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint A = sc.nextInt();\n\t\tint B = sc.nextInt();\n\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < 2; i++) {\n\t\t\tif(A < B) {\n\t\t\t\tsum...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00001-of-00128_81__public__0000", "expected_output": {"kind": "stdout", "value": "7"}, "input": {"kind": "stdin", "value": "3 4"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00001-of-00128_81__public...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00001-of-00128_82
You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many Shichi-Go numbers (literally "Seven-Five numbers") are there? Here, a Shichi-Go number is a positive integer that has exactly 75 divisors. Constraints * 1 \leq N \leq 100 * N is an integer. Input Input is given from S...
[{"code": "N = int(input())\ne = [0 for _ in range(N + 1)]\n\nfor i in range(2, N + 1):\n for j in range(2, i + 1):\n while i % j == 0:\n i //= j\n e[j] += 1\n\nc = tuple(filter(lambda x: x > 0, e)) # 素因数の指数\n\ndp = [[0 for _ in range(75 + 1)] for _ in range(len(c) + 1)] # dp[素因数のidx][...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00001-of-00128_82__public__0000", "expected_output": {"kind": "stdout", "value": "0"}, "input": {"kind": "stdin", "value": "9"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00001-of-00128_82__public__...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00001-of-00128_85
Snuke is playing a puzzle game. In this game, you are given a rectangular board of dimensions R × C, filled with numbers. Each integer i from 1 through N is written twice, at the coordinates (x_{i,1},y_{i,1}) and (x_{i,2},y_{i,2}). The objective is to draw a curve connecting the pair of points where the same integer i...
[{"code": "import sys\n\ndef main():\n # res = []\n inps = map(lambda s: s.strip(), sys.stdin.readlines())\n iid = 0\n r, c, n = map(int, inps[iid].split())\n iid += 1\n\n def boundary(x,y):\n if x==0 or y==0 or x==r or y==c:\n return True\n return False\n\n def downright(x...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00001-of-00128_85__public__0000", "expected_output": {"kind": "stdout", "value": "YES"}, "input": {"kind": "stdin", "value": "4 2 3\n0 1 3 1\n1 1 4 1\n2 0 2 2"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.ri...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00002-of-00128_1
Chef had a hard day and want to play little bit. The game is called "Chain". Chef has the sequence of symbols. Each symbol is either '-' or '+'. The sequence is called Chain if each two neighboring symbols of sequence are either '-+' or '+-'. For example sequence '-+-+-+' is a Chain but sequence '-+-+--+' is not. H...
[{"code": "testCases = int(raw_input())\nfor testCase in range(testCases):\n\toriginalString = raw_input()\n\tlenOfOriginalString = len(originalString)\n\t# count variables to find the difference between the new string and original one\n\tcount1 = 0 # for \"-+-+-+....\"\n\tcount2 = 0 # for \"+-+-+-....\"\n\tfor pos in ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00002-of-00128_1__public__0000", "expected_output": {"kind": "stdout", "value": "2\n3\n"}, "input": {"kind": "stdin", "value": "2\n---+-+-+++\n-------"}, "metadata": {}, "visibility": "public"}]
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00002-of-00128_2
Chef recently printed directions from his home to a hot new restaurant across the town, but forgot to print the directions to get back home. Help Chef to transform the directions to get home from the restaurant. A set of directions consists of several instructions. The first instruction is of the form "Begin on XXX", i...
[{"code": "t = int(raw_input())\nwhile t:\n n = int(raw_input())\n directions = []\n for i in range(n):\n directions.append(raw_input().split())\n if i:\n directions[i-1][0]=\"Left\" if directions[i][0]==\"Right\" else \"Right\"\n directions[n-1][0]=\"Begin\"\n while n:\n ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00002-of-00128_2__public__0000", "expected_output": {"kind": "stdout", "value": "Begin on Road D\nRight on Road C\nLeft on Road B\nLeft on Road A\nBegin on Ganapathi Temple Road\nLeft on Hosur Road\nLeft on Sarjapur Road\nLeft on 100 Feet Road\nRight on Doml...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00002-of-00128_80
You have a pot and N ingredients. Each ingredient has a real number parameter called value, and the value of the i-th ingredient (1 \leq i \leq N) is v_i. When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where...
[{"code": "#include<bits/stdc++.h>\nusing namespace std;\nint main(){\n\tint n;\n\tcin>>n;\n\tfloat a[n];\n\tfor(int i=0;i<n;i++) cin>>a[i];\n\tsort(a,a+n);\n\tif(n==1){\n\t\tcout<<a[0]<<endl;\n\t\treturn 0;\n\t}\n\tdouble c=(a[0]+a[1])/2;\n\tfor(int i=2;i<n;i++){\n\t\tc=(c+a[i])/2;\n\t}\n\tcout<<c<<endl;\n}", "is_know...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00002-of-00128_80__public__0000", "expected_output": {"kind": "stdout", "value": "3.5"}, "input": {"kind": "stdin", "value": "2\n3 4"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00002-of-00128_80__p...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00002-of-00128_81
There are N mountains ranging from east to west, and an ocean to the west. At the top of each mountain, there is an inn. You have decided to choose where to stay from these inns. The height of the i-th mountain from the west is H_i. You can certainly see the ocean from the inn at the top of the westmost mountain. F...
[{"code": "import java.util.*;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint[] h = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\th[i] = sc.nextInt();\n\t\t}\n\t\tint count = 1, max = h[0];\n\t\tfor (int i = 1; i...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00002-of-00128_81__public__0000", "expected_output": {"kind": "stdout", "value": "3"}, "input": {"kind": "stdin", "value": "4\n6 5 6 8"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00002-of-00128_81_...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00002-of-00128_85
There are M chairs arranged in a line. The coordinate of the i-th chair (1 ≤ i ≤ M) is i. N people of the Takahashi clan played too much games, and they are all suffering from backaches. They need to sit in chairs and rest, but they are particular about which chairs they sit in. Specifically, the i-th person wishes to...
[{"code": "#include <cstdio>\n#include <algorithm>\n#include <iostream>\n#include <vector>\n#include <cstring>\n#include <set>\n#include <utility>\n#include <cstdlib>\n#include <cmath>\n#include <queue>\n#include <stack>\n#include <string>\n#include <map>\n#include <cmath>\n#include <deque>\n#include <bitset>\n#include...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00002-of-00128_85__public__0000", "expected_output": {"kind": "stdout", "value": "2"}, "input": {"kind": "stdin", "value": "6 6\n1 6\n1 6\n1 5\n1 5\n2 6\n2 6"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.rie...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00003-of-00128_0
You are given a uniformly randomly generated string S, consisting of letters from the set {"A", "B"}. Your task is to find a string T that appears in S as a subsequence exactly twice. In other words, you need to find such a string T, that there exist exactly two sets of indexes i1, i2, ..., i|T| and j1, j2, ..., j|T| s...
[{"code": "for t in xrange(int(raw_input())):\n\ts = raw_input()\n\tn = len(s)\n\ta = s.count('A')\n\tb = n-a \n\tif (a==2):\n\t\tprint \"A\"\n\telif (b==2):\n\t\tprint \"B\"\n\telif (n<4):\n\t\tprint -1\n\telse:\n\t\tif (s[0]==\"A\"):\n\t\t\ts = \"B\"+s\n\t\telse:\n\t\t\ts = \"A\"+s\n\t\tif (s[-1]==\"A\"):\n\t\t\ts = ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00003-of-00128_0__public__0000", "expected_output": {"kind": "stdout", "value": "-1\nB"}, "input": {"kind": "stdin", "value": "2\nAAAA\nBAB"}, "metadata": {}, "visibility": "public"}]
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00003-of-00128_1
Chef has a box full of infinite number of identical coins. One day while playing, he made N piles each containing equal number of coins. Chef suddenly remembered an important task and left the room for sometime. While he was away, his newly hired assistant came across the piles and mixed them up while playing. When Che...
[{"code": "import sys\n\ndef getMaxRep(list):\n \n count = 0\n maxRep = None\n \n currRep = list[0]\n currCount = 1\n \n i = 1\n while i < len(list):\n if list[i] == currRep:\n currCount += 1\n else:\n if currCount > count:\n count = currC...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00003-of-00128_1__public__0000", "expected_output": {"kind": "stdout", "value": "3\n"}, "input": {"kind": "stdin", "value": "1\n4\n1 2 3 4"}, "metadata": {}, "visibility": "public"}]
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00003-of-00128_5
Recently Chef become very much interested in perfect squares. We all know Chef and his weird interests. Anyways Chef will be soon writing his masters thesis on perfect squares revealing what-not-known properties of perfect squares. While doing his research, he happened to be confronted with some interesting perfect squ...
[{"code": "'''\nfrom collections import Counter\nimport string,sys\nN = int(raw_input()); s = raw_input();\nif N == 1: print s; sys.exit(0)\nsc = Counter(s)\nfor i in range(N-1):\n st = raw_input(); stc = Counter(st)\n for i in list(string.ascii_lowercase):\n if sc.get(i) != None and stc.get(i) == None: sc...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00003-of-00128_5__public__0000", "expected_output": {"kind": "stdout", "value": "3\n9\n"}, "input": {"kind": "stdin", "value": "2\n1 10\n100 10000"}, "metadata": {}, "visibility": "public"}]
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00003-of-00128_80
Given is a rooted tree with N vertices numbered 1 to N. The root is Vertex 1, and the i-th edge (1 \leq i \leq N - 1) connects Vertex a_i and b_i. Each of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0. Now, the following Q operations will be performed: * Operation...
[{"code": "import java.util.*;\nimport java.io.*;\n \npublic class Main {\n\tpublic static long[] ans;\n\tpublic static Map<Integer, List<Integer>> map;\n public static void main(String[] args) throws Exception {\n FastScanner sc = new FastScanner();\n PrintWriter out = new PrintWriter(System.out);\n\t...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00003-of-00128_80__public__0000", "expected_output": {"kind": "stdout", "value": "20 20 20 20 20 20"}, "input": {"kind": "stdin", "value": "6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00003-of-00128_81
N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a...
[{"code": "S = str(raw_input())\nn = len(S)\n\npattern0 = (\"10\" * (n//2 + 1))\npattern1 = (\"01\" * (n//2 + 1))\ncount0 = 0\ncount1 = 0\n\nfor i in range(n):\n if pattern0[i] != S[i]:\n count0 += 1\n if pattern1[i] != S[i]:\n count1 += 1\n\nprint min(count0, count1)", "is_known_correct": true, "la...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00003-of-00128_81__public__0000", "expected_output": {"kind": "stdout", "value": "3"}, "input": {"kind": "stdin", "value": "10010010"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00003-of-00128_81__p...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00004-of-00128_1
Our hardworking chef is bored of sleeping in his restaurants. He has decided to settle down. The first thing he must do is to find a suitable location to build a palatial home. Think of the city as a two-dimensional grid. There are N restaurants in the city. Each of the chef's restaurant is a point denoted by (X , ...
[{"code": "t = int(raw_input())\nwhile t > 0:\n\tt-=1\n\tn = int(raw_input())\n\tx=[]\n\ty=[]\n\tfor i in range(n):\n\t\tl = map(int,raw_input().split())\n\t\tx.append(l[0])\n\t\ty.append(l[1])\n\tif n % 2 == 1: \n\t\tprint 1\n\telse : \n\t\tx.sort()\n\t\ty.sort()\n\t\tprint (x[n/2]-x[n/2-1]+1)*(y[n/2]-y[n/2-1]+1)", "i...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00004-of-00128_1__public__0000", "expected_output": {"kind": "stdout", "value": "1\n1\n4\n"}, "input": {"kind": "stdin", "value": "3\n5\n0 0\n-1 0\n1 0\n0 1\n0 -1\n5\n31 11\n30 -41\n20 14\n25 18\n25 38\n2\n0 0\n1 1"}, "metadata": {}, "visibility": "public"}]
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00004-of-00128_2
You have initially a string of N characters, denoted by A1,A2...AN. You have to print the size of the largest subsequence of string A such that all the characters in that subsequence are distinct ie. no two characters in that subsequence should be same. A subsequence of string A is a sequence that can be derived from A...
[{"code": "t=int(raw_input())\nwhile(t):\n d={}\n s=(raw_input())\n for i in s:\n if i in d :\n d[i]+=1\n else:\n d[i]=1\n\n t-=1\n #print d\n print len(d.keys())", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__c...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00004-of-00128_2__public__0000", "expected_output": {"kind": "stdout", "value": "3\n2\n"}, "input": {"kind": "stdin", "value": "2\nabc\naba"}, "metadata": {}, "visibility": "public"}]
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00004-of-00128_3
Chef has an array of N integers. He wants to play a special game. In this game he needs to make all the integers in the array greater than or equal to 0. Chef can use two types of operations. The first type is to increase all the integers of the given array by 1, but it costs X coins. The operation of the second type...
[{"code": "n = input()\na = []\nm = raw_input().split()\ntotal = 0\nfor i in range(n):\n k = int(m[i])\n if k < 0:\n a.append(k)\n total += -k\nX = input()\nif X >= len(a):\n print total\nelse:\n a.sort()\n ans = bar = 0; last = len(a)-1\n while True:\n j = None\n for i in ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00004-of-00128_3__public__0000", "expected_output": {"kind": "stdout", "value": "5\n"}, "input": {"kind": "stdin", "value": "3\n-1 -2 -3\n2"}, "metadata": {}, "visibility": "public"}]
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00004-of-00128_5
Sereja and Dima play the game. The rules are as follows: Initially, there are n cards on the table, each card has a positive integer written on it. At the beginning Sereja writes down the number 0 on the sheet of paper. Then players pick cards from the table alternately. When a player picks a card, he writes down the g...
[{"code": "from fractions import gcd\n\na = []\nn = 0\n\ndp1 = [[-1 for i in range(101)] for i in range(101)]\ndp2 = [[-1.0 for i in range(101)] for i in range(101)]\n\ndef iswinning(g,taken):\n\tglobal n, a, dp1\n\t\n\tif dp1[g][taken]!= -1:\n\t\treturn dp1[g][taken]\n\t\n\tif g==1:\n\t\tdp1[g][taken] = 1\n\t\n\telif ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00004-of-00128_5__public__0000", "expected_output": {"kind": "stdout", "value": "0 0.4000\n1 1.0000\n0 0.0000\n1 0.5833"}, "input": {"kind": "stdin", "value": "4\n5\n6 10 15 22 28\n5\n2 4 8 16 32\n4\n2 4 8 16\n4\n1 2 3 4"}, "metadata": {}, "visibility": "pub...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00004-of-00128_79
Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order. Constraints * C is a lowercase English letter that is not `z`. Input Input is given from Standard Input in the following format: C Output Print the letter that follows C in alphabetical order. Example...
[{"code": "#include <stdio.h>\n\n\nint main ()\n{\nchar K;\n\nscanf (\"%c\", &K);\n\nK=K+1;\nprintf(\"%c\", K);\n\n\n\n\treturn 0;\n\t}", "is_known_correct": true, "language": "cpp", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00004-of-00128_79__ref__0000", "source": "benchmark"}, {"...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00004-of-00128_79__public__0000", "expected_output": {"kind": "stdout", "value": "z"}, "input": {"kind": "stdin", "value": "y"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00004-of-00128_79__public__...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00004-of-00128_80
Given are two strings s and t consisting of lowercase English letters. Determine if there exists an integer i satisfying the following condition, and find the minimum such i if it exists. * Let s' be the concatenation of 10^{100} copies of s. t is a subsequence of the string {s'}_1{s'}_2\ldots{s'}_i (the first i chara...
[{"code": "s=input()\nt=input()\n\nans=0\ns_inx=0\nt_inx=0\ns_l=len(s)\nt_l=len(t)\n\nc=0\nwhile t_inx<=t_l-1:\n try:\n temp_inx=s[s_inx:].index(t[t_inx])\n s_inx+=temp_inx+1\n t_inx+=1\n c=0\n except:\n c+=1\n s_inx=0\n ans+=s_l\n\n if c==2:\n print(-1)\n exit()\nelse:\n ans+=s_inx\n\npr...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00004-of-00128_80__public__0000", "expected_output": {"kind": "stdout", "value": "33"}, "input": {"kind": "stdin", "value": "contest\nsentence"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00004-of-0...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00004-of-00128_81
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
[{"code": "n, k = map(int, input().split())\ns = input()\nl = [0] * (k * 2 + 1)\nc = '1'\np = 0\nret = 0\nfor i in range(len(s)):\n if s[i] != c:\n ret = max(ret, i - l[p])\n l.append(i)\n if c == '1':\n l.pop(0)\n l.pop(0)\n c = s[i]\nret = max(ret, n - l[p])\nprint...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00004-of-00128_81__public__0000", "expected_output": {"kind": "stdout", "value": "4"}, "input": {"kind": "stdin", "value": "5 1\n00010"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00004-of-00128_81_...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00005-of-00128_1
Chef wants to hire a new assistant. He published an advertisement regarding that in a newspaper. After seeing the advertisement, many candidates have applied for the job. Now chef wants to shortlist people for the interviews, so he gave all of them one problem which they must solve in order to get shortlisted. The pro...
[{"code": "from math import *\ndef lcm(n):\n x,c, t,f= 1,0,0,False\n while (n%2 == 0):\n c+=2**t\n f = True\n t+=1\n n = n/2\n if f == True:\n x = c+2**t\n i = 3\n while i<=sqrt(n):\n f = False\n c = 0\n t = 0\n while (n%i == 0):\n ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00005-of-00128_1__public__0000", "expected_output": {"kind": "stdout", "value": "1\n3\n"}, "input": {"kind": "stdin", "value": "2\n1\n2"}, "metadata": {}, "visibility": "public"}]
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00005-of-00128_2
This summer, there is a worldwide competition being held in Chef Town and some of the best chefs of the world are participating. The rules of this competition are quite simple. Each participant needs to bring his or her best dish. The judges will initially assign a score to each of the dishes. Now, several rounds wil...
[{"code": "#!/usr/bin/env python\n\nimport sys\n\nparent = None\n#child = dict()\n\ndef find_set(x):\n global parent\n while parent[x] != x:\n parent[x] = parent[parent[x]]\n x = parent[x]\n return parent[x]\n\nT = int(sys.stdin.readline()) \n\nwhile T > 0:\n \n N = int(sys.stdin.readlin...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00005-of-00128_2__public__0000", "expected_output": {"kind": "stdout", "value": "2\n"}, "input": {"kind": "stdin", "value": "1\n2\n1 2\n2\n0 1 2\n1 1"}, "metadata": {}, "visibility": "public"}]
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00005-of-00128_3
The purpose of this problem is to verify whether the method you are using to read input data is sufficiently fast to handle problems branded with the enormous Input/Output warning. You are expected to be able to process at least 2.5MB of input data per second at runtime. Input The input begins with two positive integ...
[{"code": "# cook your code here\nn,k=map(int,raw_input().split())\ncount=0\nfor i in range(0,n):\n if (int(raw_input()))%k==0:\n count+=1\nprint count", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00005-of-00128_3__ref__0000"...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00005-of-00128_3__public__0000", "expected_output": {"kind": "stdout", "value": "4\n"}, "input": {"kind": "stdin", "value": "7 3\n1\n51\n966369\n7\n9\n999996\n11"}, "metadata": {}, "visibility": "public"}]
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00005-of-00128_5
Sereja is playing a game called Winner Eats Sandwich with his friends. There are N persons in total, including Sereja. Sereja is allotted the number 1, while his friends are allotted numbers from 2 to N. A set of this game consists of M parts. Probability that a player numbered i wins part j of any set is p[i][j]. Sere...
[{"code": "from operator import mul\n\nparse = lambda: [25*i for i in map(float, raw_input().split())]\n\nfor _ in xrange(int(raw_input())):\n\tn, m = map(int, raw_input().split())\n\tnum = reduce(mul, parse())\n\tden = num\n\tfor _ in xrange(n - 1):\n\t\tden += reduce(mul, parse())\n\tif num == 0:\n\t\tden = 1\n\tprin...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00005-of-00128_5__public__0000", "expected_output": {"kind": "stdout", "value": "1.000000\n0.500000\n"}, "input": {"kind": "stdin", "value": "2\n2 2\n1.0000 1.0000\n0.0000 0.0000\n2 3\n0.5000 0.5000 0.5000\n0.5000 0.5000 0.5000"}, "metadata": {}, "visibility...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00005-of-00128_70
ACT I Handi Bhaiya is a very notorious kid and always troubles his parents and friends. One day his naughtiness lead him to a demon Kali(THE COBRA COMMANDER) who trapped him into a triangular magic cell. Handi Bhaiya parents want their kid back and asks for your help. ACT II You knew that the entire humanity will hate...
[{"code": "t = int(raw_input())\nfor _ in range(t):\n l = []\n l = map(int, raw_input().split())\n if l[0]+l[1]>l[2] and l[1]+l[2]>l[0] and l[2]+l[0]>l[1]:\n if l[0]==l[1] and l[1]==l[2]:\n print 'YES. It is a equilateral triangle.'\n elif l[0]==l[1] or l[1]==l[2] or l[2]==l[0]:\n ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00005-of-00128_70__public__0000", "expected_output": {"kind": "stdout", "value": "YES. It is a equilateral triangle.\nYES. It is a isosceles triangle.\nYES. It is a scalene triangle.\nNO"}, "input": {"kind": "stdin", "value": "4\n15 15 15\n13 13 14\n3 4 5\n1...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
HACKEREARTH
[]
null
codecontests__test__code_contests_train.riegeli-00005-of-00128_79
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `A...
[{"code": "#include <iostream>\n#include <vector>\n\nusing namespace std;\n\nint main() {\n\tint n, m; cin >> n >> m;\n\tvector<bool> flag(n);\n\tvector<int> cnt(n);\n\tint ac = 0, wa = 0;\n\tfor (int i = 0; i < m; ++i) {\n\t\tint p; cin >> p;\n\t\t--p;\n\t\tstring s; cin >> s;\n\t\tif (flag[p]) continue;\n\t\tif (s ==...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00005-of-00128_79__public__0000", "expected_output": {"kind": "stdout", "value": "0 0"}, "input": {"kind": "stdin", "value": "6 0"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00005-of-00128_79__publ...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00005-of-00128_80
Given are integers L and R. Find the number, modulo 10^9 + 7, of pairs of integers (x, y) (L \leq x \leq y \leq R) such that the remainder when y is divided by x is equal to y \mbox{ XOR } x. What is \mbox{ XOR }? The XOR of integers A and B, A \mbox{ XOR } B, is defined as follows: * When A \mbox{ XOR } B is writte...
[{"code": "#include<bits/stdc++.h>\n\n#define ll long long\nusing namespace std; \nll f[64][2][2][2][2];ll l,r;ll ans1=0;int l1[64],r1[64];ll mod=1e9+7;\nll dfs(int pos,int tl,int tr,int ts,int th){\n\tif(pos<0) return 1;ll &ans=f[pos][tl][tr][ts][th];\n\tif(ans) return ans;\n\t\n\tfor(int i=0;i<=1;i++){\n\t\tfor(int j...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00005-of-00128_80__public__0000", "expected_output": {"kind": "stdout", "value": "3"}, "input": {"kind": "stdin", "value": "2 3"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00005-of-00128_80__public...
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
ATCODER
[""]
null
End of preview.