Search is not available for this dataset
problem_id string | problem string | answer string | test_cases string | eval_spec string | source string | source_platform string | original_domain string | category float64 |
|---|---|---|---|---|---|---|---|---|
codecontests__test__code_contests_train.riegeli-00023-of-00128_84 | You are given a grid with 2 rows and 3 columns of squares. The color of the square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated 180 degrees, and prints `NO` otherwise.
Constraints
* C_{i,j}(1 \leq i \leq 2, 1 \leq... | [{"code": "e=input()\nf=input()\nif e[::-1]==f:\n print('YES')\nelse:\n print('NO')", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00023-of-00128_84__ref__0000", "source": "benchmark"}, {"code": "s = input()\nt = input()\nprint('YES' i... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00023-of-00128_84__public__0000", "expected_output": {"kind": "stdout", "value": "NO"}, "input": {"kind": "stdin", "value": "tab\nbet"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00023-of-00128_84__... | {"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-00023-of-00128_86 | On the xy-plane, Snuke is going to travel from the point (x_s, y_s) to the point (x_t, y_t). He can move in arbitrary directions with speed 1. Here, we will consider him as a point without size.
There are N circular barriers deployed on the plane. The center and the radius of the i-th barrier are (x_i, y_i) and r_i, r... | [{"code": "#include <bits/stdc++.h>\nusing namespace std;\n\ntypedef double dbl;\nstruct vec { dbl x, y; };\nvec operator-(vec v1, vec v2) { return { v1.x - v2.x, v1.y - v2.y }; }\ndbl len(vec v) { return hypot(v.x, v.y); }\ndbl dis(vec v1, vec v2) { return len(v2 - v1); }\nstruct cir { vec v; dbl r; };\n\nconst int N ... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00023-of-00128_86__public__0000", "expected_output": {"kind": "stdout", "value": "0.0000000000"}, "input": {"kind": "stdin", "value": "-2 0 2 0\n2\n-1 0 2\n1 0 2"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train... | {"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-00023-of-00128_87 | Sig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the `0` key, the `1` key and the backspace key.
To begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this stri... | [{"code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(){\n char c;\n string s;\n while(~scanf(\"%c\",&c)){\n if(c=='B'){\n if(!s.empty())\n s.pop_back();\n }\n else s+=c;\n }\n cout<<s<<endl;\n return 0;\n}\n", "is_known_correct": true, "lan... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00023-of-00128_87__public__0000", "expected_output": {"kind": "stdout", "value": "00"}, "input": {"kind": "stdin", "value": "01B0"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00023-of-00128_87__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-00024-of-00128_0 | Kattapa, as you all know was one of the greatest warriors of his time. The kingdom of Maahishmati had never lost a battle under him (as army-chief), and the reason for that was their really powerful army, also called as Mahasena.
Kattapa was known to be a very superstitious person. He believed that a soldier is "lucky"... | [{"code": "# Mahasena\n# Problem code: AMR15A\n# https://www.codechef.com/problems/AMR15A\n\nt=int(raw_input())\na=[]\na=map(int,raw_input().split())\neven=int(0)\nodd=int(0)\nfor i in a:\n\tif i%2==0:\n\t\teven+=1\n\telse:\n\t\todd+=1\nif even>odd:\n\tprint(\"READY FOR BATTLE\")\nelse:\n\tprint(\"NOT READY\")", "is_kn... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_0__public__0000", "expected_output": {"kind": "stdout", "value": "NOT READY\n"}, "input": {"kind": "stdin", "value": "5\n1 2 3 4 5"}, "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-00024-of-00128_2 | Some chefs go for a tour lasting N days. They take packages of bread for food. Each package has K pieces of breads. On the i^th day, they eat Ai pieces of bread.
Unfortunately, chefs are very lazy people, and they always forget to close the package of breads, so each day the last piece of bread becomes exposed to mold ... | [{"code": "# your code goes here\nimport math\nt=int(raw_input())\nfor i in range(t):\n\t\n temp=raw_input().split()\n days=int(temp[0])\n capacity=int(temp[1])\n required=raw_input().split()\n required=map(int,required)\n left=0\n packages_consumed=0\n for day in range(days):\n flag=0\n ... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_2__public__0000", "expected_output": {"kind": "stdout", "value": "2\n1\n4\n"}, "input": {"kind": "stdin", "value": "3\n3 4\n3 1 2\n1 1\n1\n2 4\n8 8"}, "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-00024-of-00128_4 | N one dimensional kingdoms are represented as intervals of the form [ai , bi] on the real line.
A kingdom of the form [L, R] can be destroyed completely by placing a bomb at a point x on the real line if L
≤ x ≤ R.
Your task is to determine minimum number of bombs required to destroy all the one dimensional kingdoms.... | [{"code": "t=input()\ndef lsort(l,n): #therefore total order=O(n+2001) :)\n\tc=[0 for x in range(2001)] #O(2001)\n\tfor x in l:c[x[0]]+=1\t\t#O(n)\n\tfor i in range(1,2001):c[i]+=c[i-1]\t\t#O(2001)\n\tb=[None for x in range(n)]\t#O(n)\n\tfor i in range(n):\t\t#O(n)\n\t\tb[c[l[i][0]]-1]=l[i]\n\t\tc[... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_4__public__0000", "expected_output": {"kind": "stdout", "value": "2\n"}, "input": {"kind": "stdin", "value": "1\n3\n1 3\n2 5\n6 9"}, "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-00024-of-00128_5 | Cyael is a teacher at a very famous school in Byteland and she is known by her students for being very polite to them and also to encourage them to get good marks on their tests.
Then, if they get good marks she will reward them with candies :) However, she knows they are all very good at Mathematics, so she decided to... | [{"code": "T = int(raw_input())\nwhile T:\n N,K = map(int,raw_input().split())\n if K == 0: print K,N\n else: print N / K , N % K\n T -= 1", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_5__ref__0000", "source":... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_5__public__0000", "expected_output": {"kind": "stdout", "value": "5 0\n33 1\n"}, "input": {"kind": "stdin", "value": "2\n10 2\n100 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-00024-of-00128_78 | Takahashi the Jumbo will practice golf.
His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive).
If he can achieve the objective, print `OK`; if he cannot, print `NG`.
Constraints
* All values in input are integers.
* 1 \leq A \leq B \... | [{"code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main()\n{\n int k, a, b;\n cin >> k >> a >> b;\n cout << ((b / k) * k >= a ? \"OK\" : \"NG\") << endl;\n}", "is_known_correct": true, "language": "cpp", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_78__... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "NG"}, "input": {"kind": "stdin", "value": "4\n5 7"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_78__pu... | {"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-00024-of-00128_79 | Given is a tree T with N vertices. The i-th edge connects Vertex A_i and B_i (1 \leq A_i,B_i \leq N).
Now, each vertex is painted black with probability 1/2 and white with probability 1/2, which is chosen independently from other vertices. Then, let S be the smallest subtree (connected subgraph) of T containing all th... | [{"code": "import sys\n\nsys.setrecursionlimit(10 ** 6)\nint1 = lambda x: int(x) - 1\np2D = lambda x: print(*x, sep=\"\\n\")\ndef II(): return int(sys.stdin.readline())\ndef MI(): return map(int, sys.stdin.readline().split())\ndef MI1(): return map(int1, sys.stdin.readline().split())\ndef LI(): return list(map(int, sys... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_79__public__0000", "expected_output": {"kind": "stdout", "value": "375000003"}, "input": {"kind": "stdin", "value": "4\n1 2\n2 3\n3 4"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-0002... | {"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-00024-of-00128_80 | We have a sequence p = {p_1,\ p_2,\ ...,\ p_N} which is a permutation of {1,\ 2,\ ...,\ N}.
You can perform the following operation at most once: choose integers i and j (1 \leq i < j \leq N), and swap p_i and p_j. Note that you can also choose not to perform it.
Print `YES` if you can sort p in ascending order in th... | [{"code": "N=int(input())\np=list(map(int,input().split()))\na=0\nfor i in range(N):\n if p[i]!=i+1:\n a+=1\nif a>=3:\n print('NO')\nelse:\n print('YES')", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_80__r... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_80__public__0000", "expected_output": {"kind": "stdout", "value": "NO"}, "input": {"kind": "stdin", "value": "5\n2 4 3 5 1"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_... | {"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-00024-of-00128_82 | In the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.
The pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).
Aoki, an explorer, conducted a survey to identify the center ... | [{"code": "import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int[] x = new int[n];\n int[] y = new int[n];\n int[] h = new int[n];\n for(int i=0; i<n; i++) {\n ... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_82__public__0000", "expected_output": {"kind": "stdout", "value": "0 0 100"}, "input": {"kind": "stdin", "value": "2\n0 0 100\n1 1 98"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-0002... | {"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-00024-of-00128_84 | Find the largest square number not exceeding N. Here, a square number is an integer that can be represented as the square of an integer.
Constraints
* 1 \leq N \leq 10^9
* N is an integer.
Input
Input is given from Standard Input in the following format:
N
Output
Print the largest square number not exceeding N... | [{"code": "import math;print(round((math.sqrt(int(input()))//1))**2)", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_84__ref__0000", "source": "benchmark"}, {"code": "import java.util.Scanner;\n\nclass Main {\n\tpublic stat... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_84__public__0000", "expected_output": {"kind": "stdout", "value": "81"}, "input": {"kind": "stdin", "value": "81"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_84__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-00024-of-00128_85 | Based on some criterion, Snuke divided the integers from 1 through 12 into three groups as shown in the figure below. Given two integers x and y (1 ≤ x < y ≤ 12), determine whether they belong to the same group.
b4ab979900ed647703389d4349eb84ee.png
Constraints
* x and y are integers.
* 1 ≤ x < y ≤ 12
Input
Input i... | [{"code": "L=[1,0,1,2,1,2,1,1,2,1,2,1]\na,b=map(int,input().split())\nif L[a-1]==L[b-1]:\n print(\"Yes\")\nelse:\n print(\"No\")", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_85__ref__0000", "source": "benchmark"}, {"co... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_85__public__0000", "expected_output": {"kind": "stdout", "value": "No"}, "input": {"kind": "stdin", "value": "2 4"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_85__publi... | {"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-00024-of-00128_86 | Takahashi and Aoki are going to together construct a sequence of integers.
First, Takahashi will provide a sequence of integers a, satisfying all of the following conditions:
* The length of a is N.
* Each element in a is an integer between 1 and K, inclusive.
* a is a palindrome, that is, reversing the order of elem... | [{"code": "#include \"bits/stdc++.h\"\nusing namespace std;\ntypedef long long ll;\nconst ll MOD = 1e9 + 7;\nconst int INF = 1 << 30;\n\nll mod_pow(ll a, ll n) {\n\tif (n == 0) return 1;\n\tif (n % 2 == 0) {\n\t\tll tmp = mod_pow(a, n / 2);\n\t\treturn (tmp * tmp) % MOD;\n\t}\n\treturn (a * mod_pow(a, n - 1)) % MOD;\n}... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_86__public__0000", "expected_output": {"kind": "stdout", "value": "875699961"}, "input": {"kind": "stdin", "value": "1000000000 1000000000"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli... | {"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-00024-of-00128_87 | Evi has N integers a_1,a_2,..,a_N. His objective is to have N equal integers by transforming some of them.
He may transform each integer at most once. Transforming an integer x into another integer y costs him (x-y)^2 dollars. Even if a_i=a_j (i≠j), he has to pay the cost separately for transforming each of them (See ... | [{"code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(){\n int n;\n cin >> n;\n vector<int> a(n);\n int sum=0,ave1,ave2,s=0,t=0;\n for(int i=0;i<n;i++){\n cin >> a[i];\n sum+=a[i];\n }\n ave1=sum/n;\n ave2=(sum+n-1)/n;\n for(int i=0;i<n;i++){\n s+=(a[i]-ave1)*(a[i]-ave1);\n t+=(a[i]-a... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_87__public__0000", "expected_output": {"kind": "stdout", "value": "8"}, "input": {"kind": "stdin", "value": "2\n4 8"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00024-of-00128_87__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 | ATCODER | [""] | null |
codecontests__test__code_contests_train.riegeli-00025-of-00128_3 | Chef is the new king of the country Chefland. As first and most important responsibility he wants to reconstruct the road system of Chefland. There are N (1 to N) cities in the country and each city i has a population Pi. Chef wants to build some bi-directional roads connecting different cities such that each city is c... | [{"code": "for _ in xrange(input()):\n n = input()\n p = map(int, raw_input().strip().split())\n p.sort()\n min = p[0]\n print sum([min*p[i] for i in range(1,n)])", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00025-of-00128_3__public__0000", "expected_output": {"kind": "stdout", "value": "50\n266\n"}, "input": {"kind": "stdin", "value": "2\n2\n5 10\n4\n15 10 7 13"}, "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-00025-of-00128_4 | 3:33
It's possible for all the digits displayed on a digital clock in the hours:minutes format to be identical. The time shown above (3:33) is an example of such a situation. Other examples are 2:2 and 1:11. Note that the digits of 33:33 are identical, but it is not a valid time on a usual digital clock.
The above exam... | [{"code": "for _ in xrange(input()):\n H, M = map(int, raw_input().split())\n count = 0\n for i in range(1, H):\n if i < 10 or i % 11 == 0:\n start = str(i)[0]\n while int(start) in range(M):\n count += 1\n start += str(i)[0]\n print count + 1", "is... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00025-of-00128_4__public__0000", "expected_output": {"kind": "stdout", "value": "19\n20\n10\n11\n10\n1\n"}, "input": {"kind": "stdin", "value": "6\n24 60\n34 50\n10 11\n10 12\n11 11\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-00025-of-00128_78 | Takahashi has a deposit of 100 yen (the currency of Japan) in AtCoder Bank.
The bank pays an annual interest rate of 1 % compounded annually. (A fraction of less than one yen is discarded.)
Assuming that nothing other than the interest affects Takahashi's balance, in how many years does the balance reach X yen or abo... | [{"code": "#include <iostream>\n\nint main()\n{\n\tunsigned long long N=100, X;\n\tstd::cin >> X;\n\tint i=0;\n\twhile (N < X) {\n\t\tN *= 1.01;\n\t\ti++;\n\t}\n std::cout << i;\n}", "is_known_correct": true, "language": "cpp", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00025-of-... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00025-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "1706"}, "input": {"kind": "stdin", "value": "1333333333"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00025-of-00128_... | {"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-00025-of-00128_80 | There are N+1 towns. The i-th town is being attacked by A_i monsters.
We have N heroes. The i-th hero can defeat monsters attacking the i-th or (i+1)-th town, for a total of at most B_i monsters.
What is the maximum total number of monsters the heroes can cooperate to defeat?
Constraints
* All values in input are i... | [{"code": "#include<bits/stdc++.h>\nusing namespace std;\ntypedef long long int ll;\ntypedef pair<int, int> P;\nconst int INF = pow(10, 7);\n\nint main(){\n int n;cin>>n;\n ll ans=0;\n vector<int> a(n+1);\n for(int i=0;i<=n;i++){\n \tcin>>a[i];\n }\n for(int i=0;i<n;i++){\n \tint b, d;cin>>b;\n d=min(a[i], b... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00025-of-00128_80__public__0000", "expected_output": {"kind": "stdout", "value": "22"}, "input": {"kind": "stdin", "value": "3\n5 6 3 8\n5 100 8"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00025-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-00025-of-00128_82 | You are given integers N and M.
Consider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N.
Constraints
* All values in input are integers.
* 1 \leq N \leq 10^5
* N \leq M \leq 10^9
Input... | [{"code": "import itertools\nimport math\nimport copy\n\nN,M=map(int, raw_input().split())\n\nM2=copy.deepcopy(M)\n\nA={}\n\na=int( math.sqrt(M) )+2\n\nfor i in range(2,a):\n\twhile M%i==0:\n\t\tif i not in A:\n\t\t\tA[i]=1\n\t\telse:\n\t\t\tA[i]+=1\n\t\tM/=i\nelse:\n\tA[M]=1\n\n\n\nB=[]\n\nfor x in A.values():\n\tB.ap... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00025-of-00128_82__public__0000", "expected_output": {"kind": "stdout", "value": "3"}, "input": {"kind": "stdin", "value": "10 123"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00025-of-00128_82__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 | ATCODER | [""] | null |
codecontests__test__code_contests_train.riegeli-00025-of-00128_84 | Find the smallest possible sum of the digits in the decimal notation of a positive multiple of K.
Constraints
* 2 \leq K \leq 10^5
* K is an integer.
Input
Input is given from Standard Input in the following format:
K
Output
Print the smallest possible sum of the digits in the decimal notation of a positive mu... | [{"code": "import java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.Arrays;\nimport java.util.InputMismatchException;\nimport java.io.IOException;\nimport java.io.InputStream;\n\n/**\n * Built using CHelper plug-in\n * Actual solution is at th... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00025-of-00128_84__public__0000", "expected_output": {"kind": "stdout", "value": "5"}, "input": {"kind": "stdin", "value": "41"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00025-of-00128_84__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-00025-of-00128_85 | You are given a image with a height of H pixels and a width of W pixels. Each pixel is represented by a lowercase English letter. The pixel at the i-th row from the top and j-th column from the left is a_{ij}.
Put a box around this image and output the result. The box should consist of `#` and have a thickness of 1.
... | [{"code": "#include <stdio.h>\n\nint main(void) {\n int i, j, h, w;\n scanf(\"%d%d\", &h, &w);\n char s[w + 10];\n for(i = 0; i < w + 2; ++i) printf(\"#\");\n printf(\"\\n\");\n for(i = 0; i < h; ++i) {\n scanf(\"%s\", s);\n printf(\"#%s#\\n\", s);\n }\n for(i = 0; i < w + 2; ++i) printf(\"#\");\n return... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00025-of-00128_85__public__0000", "expected_output": {"kind": "stdout", "value": "#####\n#abc#\n#arc#\n#####"}, "input": {"kind": "stdin", "value": "2 3\nabc\narc"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_trai... | {"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-00026-of-00128_1 | Chef likes cooking. But more than that, he likes to give gifts. And now he wants to give his girlfriend an unforgettable gift. But unfortunately he forgot the password to the safe where the money he saved for the gift is kept.
But he knows how to hack the safe. To do this, you need to correctly answer questions asked ... | [{"code": "import sys\n\ndef readtestcase():\n n = int(sys.stdin.readline())\n num = map(int, sys.stdin.readline().split())\n mini = num[0]\n maxi = num[0]\n for i in range(1,len(num)):\n omini = mini\n mini = min([ mini-num[i], mini+num[i], mini*num[i], maxi-num[i], maxi+num[i], maxi*num[i... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00026-of-00128_1__public__0000", "expected_output": {"kind": "stdout", "value": "-4\n9"}, "input": {"kind": "stdin", "value": "2\n3\n1 2 3\n1\n9"}, "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-00026-of-00128_5 | Chef recently saw the movie Matrix. He loved the movie overall but he didn't agree with some things in it. Particularly he didn't agree with the bald boy when he declared - There is no spoon. Being a chef, he understands the importance of the spoon and realizes that the universe can't survive without it. Furthermore, h... | [{"code": "tc = int(raw_input()) #number of test cases\nfor t in range(tc):\n r, c = map(int,raw_input().split())\n L = []\n for r1 in range(r):\n L.append(raw_input().strip().lower())\n findCase = False\n for e in L:\n if 'spoon' in e:\n findCase = True\n break\n n... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00026-of-00128_5__public__0000", "expected_output": {"kind": "stdout", "value": "There is a spoon!\nThere is a spoon!\nThere is indeed no spoon!\n"}, "input": {"kind": "stdin", "value": "3\n3 6\nabDefb\nbSpoon\nNIKHil\n6 6\naaaaaa\nssssss\nxuisdP\noooooo\nio... | {"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-00026-of-00128_73 | Here is your task. You are given two strings and you have to merge/compress them in single string with minimum length such that both strings can be found (one at a time) by breaking that merged string into two parts.
NOTE:
String s2 should follow string s1.
INPUT
First line contain number of test cases T. Each test ca... | [{"code": "from sys import stdin\nt = int(stdin.readline())\ndef com(a,b):\n\tl1 = len(a)\n\tl2 = len(b)\n\tl = l1\n\n\tif l2<l:\n\t\tl = l2\n\twhile l>=1:\n\t\t#print \"comparing \",a[-l:],b[:l]\n\t\tif a[-l:] == b[:l]:\n\t\t\treturn l\n\t\tl-=1\n\treturn 0\nfor tt in xrange(t):\n\ta = stdin.readline().strip();\n\tb =... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00026-of-00128_73__public__0000", "expected_output": {"kind": "stdout", "value": "roadshowman\ntarunnum\n"}, "input": {"kind": "stdin", "value": "2\nroadshow\nshowman\ntarun\ntarunnum\n\nSAMPLE"}, "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 | HACKEREARTH | [] | null |
codecontests__test__code_contests_train.riegeli-00026-of-00128_78 | Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ).
Consider a sequence A satisfying the following conditions:
* A is a sequence of N positive integers.
* 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M.
Let us define a score of this sequence as follows:
* The score is the ... | [{"code": "import java.io.*;\nimport java.math.*;\nimport java.util.*;\n\n\npublic class Main{\n static long MOD = 998244353 ;\n static long [] fac;\n static int [] num;\n static int max = 0;\n static int n;\n static int m;\n static int q;\n static int [] a, b, c, d;\n public static void main... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00026-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "110"}, "input": {"kind": "stdin", "value": "3 4 3\n1 3 3 100\n1 2 2 10\n2 3 2 10"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_trai... | {"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-00026-of-00128_80 | Given is a string S. Each character in S is either a digit (`0`, ..., `9`) or `?`.
Among the integers obtained by replacing each occurrence of `?` with a digit, how many have a remainder of 5 when divided by 13? An integer may begin with 0.
Since the answer can be enormous, print the count modulo 10^9+7.
Constraints... | [{"code": "#include<bits/stdc++.h>\nusing namespace std;\nconst int mod=1e9+7;\nint dp[100001][13];\nint main(){\n\tstring s;\n\tcin>>s;\n\tdp[0][0]=1;\n\tfor(int i=0;i<s.size();i++){\n\t\tfor(int j=0;j<13;j++){\n\t\t\tif(s[i]=='?')\n\t\t\t\tfor(int k=0;k<=9;k++)\n\t\t\t\t\t(dp[i+1][(j*10+k)%13]+=dp[i][j])%=mod;\n\t\t\... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00026-of-00128_80__public__0000", "expected_output": {"kind": "stdout", "value": "0"}, "input": {"kind": "stdin", "value": "7?4"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00026-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 |
codecontests__test__code_contests_train.riegeli-00026-of-00128_82 | Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.
You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.
Constraints
* 111 \leq n \leq 999
* ... | [{"code": "s = input()\nprint(s.translate(str.maketrans({\"1\": \"9\", \"9\": \"1\"})))\n", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00026-of-00128_82__ref__0000", "source": "benchmark"}, {"code": "import java.util.*;\nclass Main {\n... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00026-of-00128_82__public__0000", "expected_output": {"kind": "stdout", "value": "991"}, "input": {"kind": "stdin", "value": "119"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00026-of-00128_82__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-00026-of-00128_85 | There is a bar of chocolate with a height of H blocks and a width of W blocks. Snuke is dividing this bar into exactly three pieces. He can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle.
Snuke is trying to divide the bar as evenly as possible. More specifically, he is trying... | [{"code": "h,w = sorted(list(map(int,input().split())))\nif h % 3 == 0 or w % 3 == 0:\n ans = 0\nelse:\n c1 = ((w//3+1)*h)-((w-1-w//3)*(h//2))\n c2 = ((w-w//3)*(h-h//2))-(w//3*h)\n c3 = h\n c4 = ((h//3+1)*w)-((h-1-h//3)*(w//2))\n c5 = ((h-h//3)*(w-w//2))-(h//3*w)\n ans = min(c1,c2,c3,c4,c5)\nprint(ans)", "is_kno... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00026-of-00128_85__public__0000", "expected_output": {"kind": "stdout", "value": "0"}, "input": {"kind": "stdin", "value": "3 5"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00026-of-00128_85__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-00027-of-00128_0 | Chef is playing a game on a sequence of N positive integers, say A1, A2, ... AN. The game is played as follows.
If all the numbers are equal, the game ends.
Otherwise
Select two numbers which are unequal
Subtract the smaller number from the larger number
Replace the larger number with the result from above (see the e... | [{"code": "from fractions import gcd\nt=int(raw_input())\n\nwhile(t>0):\n t-=1\n n=input()\n a=[int(i) for i in raw_input().split()]\n ans=gcd(a[0],a[1])\n for i in range(2,n):\n ans=gcd(ans,a[i])\n print ans", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "code... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00027-of-00128_0__public__0000", "expected_output": {"kind": "stdout", "value": "2\n1\n1\n"}, "input": {"kind": "stdin", "value": "3\n2\n10 12\n2\n5 9\n3\n6 10 15"}, "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-00027-of-00128_1 | Gru has not been in the limelight for a long time and is, therefore, planning something particularly nefarious. Frustrated by his minions' incapability which has kept him away from the limelight, he has built a transmogrifier — a machine which mutates minions.
Each minion has an intrinsic characteristic value (simila... | [{"code": "import sys\nt=int(raw_input(\"\"))\nwhile t:\n m,n=map(int,sys.stdin.readline().split())\n l=list(map(int,sys.stdin.readline().split()))\n count=0\n for i in range(len(l)):\n if (l[i]+n)%7==0:\n count+=1\n print count\n t-=1", "is_known_correct": true, "language": "python"... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00027-of-00128_1__public__0000", "expected_output": {"kind": "stdout", "value": "1\n"}, "input": {"kind": "stdin", "value": "1\n5 10\n2 4 1 35 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-00027-of-00128_2 | The faculty of application management and consulting services (FAMCS) of the Berland State University (BSU) has always been popular among Berland's enrollees. This year, N students attended the entrance exams, but no more than K will enter the university. In order to decide who are these students, there are series of e... | [{"code": "def entExam(N,K,E,M, D):\n scoreSet = []\n for i in range(N-1):\n scoreSet.append(sum(D[i]))\n scoreSet = sorted(scoreSet)\n myScore = sum(D[-1])\n \n if(scoreSet[N-K-1]+1 > myScore+M):\n print \"Impossible\"\n else:\n anw = scoreSet[N-K-1]-myScore+1\n \tif(anw <... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00027-of-00128_2__public__0000", "expected_output": {"kind": "stdout", "value": "4\n"}, "input": {"kind": "stdin", "value": "1\n4 2 3 10\n7 7 7\n4 6 10\n7 10 9\n9 9"}, "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-00027-of-00128_5 | Lo and Behold! For you may be surprised by what our chief chef Noodle has in mind for this season! Today, Noodle announced one of his most extra-ordinary ideas ever - Project Spoon.
Noodle plans to deploy large spoons in the atmosphere so that people all around the world can download food directly from his kitchen th... | [{"code": "#!/usr/bin/python\n\ndef factorial(a):\n res = 1\n for i in range(1, a+1):\n res *= i\n return res\n# end of factorial\n\ndef perestanovki(a,b):\n return factorial(a)/(factorial(b)*factorial(a-b))\n# end of perestanovki\n\ndef getIndex(start, end, a):\n ind = (start + end) / 2\n if m... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00027-of-00128_5__public__0000", "expected_output": {"kind": "stdout", "value": "2\n3\n"}, "input": {"kind": "stdin", "value": "2\n2\n3"}, "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-00027-of-00128_78 | Given are integers A, B, and N.
Find the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N.
Here floor(t) denotes the greatest integer not greater than the real number t.
Constraints
* 1 ≤ A ≤ 10^{6}
* 1 ≤ B ≤ 10^{12}
* 1 ≤ N ≤ 10^{12}
* All values in input are i... | [{"code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(){\n long long A,B,N; cin>>A>>B>>N;\n cout<<(A*min(B-1,N))/B<<endl;\n}", "is_known_correct": true, "language": "cpp", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00027-of-00128_78__ref__0000", "source": "benchmark"... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00027-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "2"}, "input": {"kind": "stdin", "value": "5 7 4"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00027-of-00128_78__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-00027-of-00128_80 | Given are two strings s and t consisting of lowercase English letters. Determine if the number of non-negative integers i satisfying the following condition is finite, and find the maximum value of such i if the number is finite.
* There exists a non-negative integer j such that the concatenation of i copies of t is a... | [{"code": "#include <bits/stdc++.h>\nusing namespace std;\ntypedef long long ll;\n#define rep(i, N) for (int i = 0; i < (int)N; i++)\n#define all(a) (a).begin(), (a).end()\n\nstring s, t;\nint n, m;\nconst int R = 256;\nvector<vector<int>> dfa;\nvector<int> match;\nvector<int> L;\n\nvoid kmp() {\n dfa.resize(R, vector... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00027-of-00128_80__public__0000", "expected_output": {"kind": "stdout", "value": "-1"}, "input": {"kind": "stdin", "value": "aa\naaaaaaa"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00027-of-00128_8... | {"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-00027-of-00128_82 | Kurohashi has never participated in AtCoder Beginner Contest (ABC).
The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.
What is the earliest ABC where Kurohashi can make his debut?
Constraints
* 100 \leq N... | [{"code": "#include <iostream>\nusing namespace std;\n\nint main() {\n\tint N;\n\tcin >> N;\n\tcout << (N - 1 - (N - 1) % 111) + 111 << endl;\n}", "is_known_correct": true, "language": "cpp", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00027-of-00128_82__ref__0000", "source": "benchm... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00027-of-00128_82__public__0000", "expected_output": {"kind": "stdout", "value": "777"}, "input": {"kind": "stdin", "value": "750"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00027-of-00128_82__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-00027-of-00128_84 | In Finite Encyclopedia of Integer Sequences (FEIS), all integer sequences of lengths between 1 and N (inclusive) consisting of integers between 1 and K (inclusive) are listed.
Let the total number of sequences listed in FEIS be X. Among those sequences, find the (X/2)-th (rounded up to the nearest integer) lexicograph... | [{"code": "//2017-11-5\n//miaomiao\n//\n#include <cstdio>\n#include <cstdlib>\n#include <cstring>\n#include <cmath>\n#include <iostream>\n#include <algorithm>\n#include <vector>\n\nusing namespace std;\n\n#define pb push_back\n#define ppb pop_back\n#define For(i, a, b) for(int i = (a); i <= (int)(b); ++i)\n\n#define N ... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00027-of-00128_84__public__0000", "expected_output": {"kind": "stdout", "value": "1 2 2 2"}, "input": {"kind": "stdin", "value": "2 4"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00027-of-00128_84__... | {"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-00027-of-00128_85 | Let N be a positive integer.
There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements. Here, the score of a' is defined as follows: (the sum of the elements ... | [{"code": "def f(x):\n y=x[:n];heapify(y);z=sum(y);s=[z]\n for i in x[n:n*2]:z+=i-heappushpop(y,i);s+=[z]\n return s\nfrom heapq import*;n,*a=map(int,open(0).read().split());print(max(map(sum,zip(f([-i for i in a[n:][::-1]]),f(a)[::-1]))))", "is_known_correct": true, "language": "python", "metadata": {}, "solu... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00027-of-00128_85__public__0000", "expected_output": {"kind": "stdout", "value": "1"}, "input": {"kind": "stdin", "value": "2\n3 1 4 1 5 9"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00027-of-00128... | {"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-00028-of-00128_4 | Phantasialand boasts of its famous theme park. The park is frequently visited. It is quite large park that some tourists visit it more than once to fully appreciate its offerings. One day, our Chefs decided to visit the park. There are total n Chefs, i-th of them wants to visit the park ti times.
Usually, the entry t... | [{"code": "n = input()\nt = map(int, raw_input().split())\n\narr = [2]*n\n\ncount = n\n\nt.sort()\n\nfor i in xrange(0, n):\n if arr[i] - t[i] > 0:\n if i != n-1:\n arr[i+1]+= arr[i] - t[i]\n #print arr\n arr[i] = t[i]\n #print arr\n \n elif arr[i] - t[i] < 0:\n ... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00028-of-00128_4__public__0000", "expected_output": {"kind": "stdout", "value": "2\n"}, "input": {"kind": "stdin", "value": "2\n3 1"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00028-of-00128_4__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-00028-of-00128_78 | You are going to hold a competition of one-to-one game called AtCoder Janken. (Janken is the Japanese name for Rock-paper-scissors.) N players will participate in this competition, and they are given distinct integers from 1 through N. The arena has M playing fields for two players. You need to assign each playing fiel... | [{"code": "n,m=map(int,input().split())\nif n%2==1:\n for i in range(m):\n print(n-i-1,i+1)\nelse:\n cnt=1\n for i in range(m):\n if i%2==0:\n print(n//4-i//2,n//4-i//2+cnt)\n else:\n print(n//2+n//4-i//2,n//2+n//4-i//2+cnt)\n cnt+=1\n", "is_known_correct": true, "language": "python", "metadata... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00028-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "1 6\n2 5\n3 4"}, "input": {"kind": "stdin", "value": "7 3"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00028-of-0012... | {"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-00028-of-00128_84 | There are N non-negative integers written on a blackboard. The i-th integer is A_i.
Takahashi can perform the following two kinds of operations any number of times in any order:
* Select one integer written on the board (let this integer be X). Write 2X on the board, without erasing the selected integer.
* Select two... | [{"code": "#define _CRT_SECURE_NO_WARNINGS\n#define _SCL_SECURE_NO_WARNINGS\n#include <cstdio>\n#include <cstdlib>\n#include <cstring>\n#include <cassert>\n#include <iostream>\n#include <string>\n#include <vector>\n#include <list>\n#include <utility>\n#include <algorithm>\n#include <functional>\n#include <cmath>\n#incl... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00028-of-00128_84__public__0000", "expected_output": {"kind": "stdout", "value": "466025955"}, "input": {"kind": "stdin", "value": "1 111111111111111111111111111111111111111111111111111111111111111\n1"}, "metadata": {}, "visibility": "public"}, {"case_id": "... | {"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-00028-of-00128_85 | There are N squares arranged in a row. The squares are numbered 1, 2, ..., N, from left to right.
Snuke is painting each square in red, green or blue. According to his aesthetic sense, the following M conditions must all be satisfied. The i-th condition is:
* There are exactly x_i different colors among squares l_i, ... | [{"code": "#include <bits/stdc++.h>\n#define int long long\nusing namespace std;\nconst int maxn=305;\nconst int mod=1e9+7;\nvector<pair<int,int> >vec[maxn];\nint n,m,dp[305][305][305],d[4];\nvoid add(int &x,int y)\n{\n\tx+=y;\n\tif(x>=mod)x-=mod;\n}\nbool check(int a,int b,int c)\n{\n\td[1]=a;d[2]=b;d[3]=c;\n\tsort(d+... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00028-of-00128_85__public__0000", "expected_output": {"kind": "stdout", "value": "6"}, "input": {"kind": "stdin", "value": "3 1\n1 3 3"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00028-of-00128_85_... | {"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-00029-of-00128_0 | You are given a sequence of N integer numbers A. Calculate the sum of Ai AND Aj for all the pairs (i, j) where i < j.
The AND operation is the Bitwise AND operation, defined as in here.
Input
The first line of input consists of the integer N.
The second line contains N integer numbers - the sequence A.
Output
Out... | [{"code": "import fileinput\nimport math\n\n\nfoundN = False\nfor line in fileinput.input():\n if not foundN:\n N = int(line)\n foundN = True\n continue\n \n number_list = map(int, line.split())\n bit_count = [0]*31\n \n for number in number_list:\n for i in range(31):\n ... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00029-of-00128_0__public__0000", "expected_output": {"kind": "stdout", "value": "9\n"}, "input": {"kind": "stdin", "value": "5\n1 2 3 4 5"}, "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-00029-of-00128_4 | Did you know that the yummy golden triangle was introduced in India as early as 13th century ? By the way, I'm referring to the popular South Asian snack, Samosa. I guess its hard to code while thinking of Samosa, especially if you are very hungry now ; so lets not get in to any recipe or eating game.
You have N box... | [{"code": "import sys\nfrom operator import itemgetter\n\nnum_tests = int(sys.stdin.readline())\n\n\ndef search(bands, box, lo, hi):\n if lo == hi:\n return None\n\n mid = lo + (hi - lo) / 2\n band = bands[mid][1]\n\n if not mid:\n return mid\n\n if bands[mid - 1][1] < box and band >= box:\... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00029-of-00128_4__public__0000", "expected_output": {"kind": "stdout", "value": "2\n"}, "input": {"kind": "stdin", "value": "1\n4\n10 20 34 55\n4\n7 14\n7 21\n14 21\n7 35"}, "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-00029-of-00128_5 | Euler's phi function for a positive integer N is usually denoted as φ(N) and defined as the number of positive integers less than or equal to N that are coprime with N. Let's call a positive integer N a super number if N can be divided by φ(N) without a remainder.
e.g. 2 is a super number (since 2 mod φ(2) = 0), whi... | [{"code": "t = input()\nwhile t:\n\tL, R = map(int,raw_input().split())\n\tanswer = 0\n\n\tvalue = 2\n\twhile( value <= R ):\n\t current = value\n\t while current <= R:\n\t if L <= current <= R:\n\t answer+=1\n\t current *= 3\n\t value *= 2\n\n\n\tif L <= 1 <= R:\n\t answer+=1\n\n\t... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00029-of-00128_5__public__0000", "expected_output": {"kind": "stdout", "value": "1\n0\n3\n"}, "input": {"kind": "stdin", "value": "3\n2 3\n90 95\n12 21"}, "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-00029-of-00128_78 | We have a tree with N vertices, whose i-th edge connects Vertex u_i and Vertex v_i. Vertex i has an integer a_i written on it. For every integer k from 1 through N, solve the following problem:
* We will make a sequence by lining up the integers written on the vertices along the shortest path from Vertex 1 to Vertex k... | [{"code": "from bisect import bisect_left\n\nn = int(input())\nA = [0] + list(map(int, input().split()))\ngraph = [[] for _ in range(n + 1)]\nfor _ in range(n - 1):\n u, v = map(int, input().split())\n graph[v].append(u)\n graph[u].append(v)\n\nstart = 1\n\nstack = [1]\npar = [-1] * (n + 1)\nans = [0] * (n + 1... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00029-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "1\n2\n3\n3\n4\n4\n5\n2\n2\n3"}, "input": {"kind": "stdin", "value": "10\n1 2 5 3 4 6 7 3 2 4\n1 2\n2 3\n3 4\n4 5\n3 6\n6 7\n1 8\n8 9\n9 10"}, "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 | ATCODER | [""] | null |
codecontests__test__code_contests_train.riegeli-00029-of-00128_82 | Snuke is introducing a robot arm with the following properties to his factory:
* The robot arm consists of m sections and m+1 joints. The sections are numbered 1, 2, ..., m, and the joints are numbered 0, 1, ..., m. Section i connects Joint i-1 and Joint i. The length of Section i is d_i.
* For each section, its mode ... | [{"code": "N = int(input())\npoint = [tuple(map(int, input().split())) for i in range(N)]\npoint_farthest = max(point, key=lambda p: abs(p[0]) + abs(p[1]))\nmod = sum(point_farthest) % 2\nD = [1, 1] if mod == 0 else [1]\nwhile sum(D) < abs(point_farthest[0]) + abs(point_farthest[1]):\n D.append(D[-1] * 2)\nD.reverse... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00029-of-00128_82__public__0000", "expected_output": {"kind": "stdout", "value": "2\n1 1\nRU\nUR"}, "input": {"kind": "stdin", "value": "2\n1 1\n1 1"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-0002... | {"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-00029-of-00128_84 | Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the rating of the user (not necessarily an integer) changes according to the performance of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
... | [{"code": "r=float(input())\ng=float(input())\nprint(int(2*g-r))\n", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00029-of-00128_84__ref__0000", "source": "benchmark"}, {"code": "#include<cstdio>\nint main()\n{\n\tint R,G,P;\n\tscanf(\"%... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00029-of-00128_84__public__0000", "expected_output": {"kind": "stdout", "value": "-4500"}, "input": {"kind": "stdin", "value": "4500\n0"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00029-of-00128_84... | {"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-00029-of-00128_85 | There is a pond with a rectangular shape. The pond is divided into a grid with H rows and W columns of squares. We will denote the square at the i-th row from the top and j-th column from the left by (i,\ j).
Some of the squares in the pond contains a lotus leaf floating on the water. On one of those leaves, S, there ... | [{"code": "#include<bits/stdc++.h>\n#define ll long long\n#define fo(i,x,y) for(int i=x;i<=y;i++)\n#define fd(i,x,y) for(int i=x;i>=y;i--)\nusing namespace std;\n\nconst int maxn=107,maxm=5000007;\nconst int inf=0x1fffffff;\n\nint n,m,fi[maxm],la[maxm],ne[maxm],va[maxm],tot=1;\nchar a[maxn][maxn];\n\n#define Leaf(x,y) ... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00029-of-00128_85__public__0000", "expected_output": {"kind": "stdout", "value": "-1"}, "input": {"kind": "stdin", "value": "4 3\n.S.\n.o.\n.o.\n.T."}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-0002... | {"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-00030-of-00128_0 | N Soldiers are lined up for a memory test. They are numbered from 0 to N-1 from left to right.
In the test, there are M rounds. In each round, Captain selects one position. Soldier at that position will be numbered 0. All the soldiers to the right of selected position will be numbered one greater than the soldier to ... | [{"code": "T = input()\nfor _ in range(T):\n n,m = map(int,raw_input().split())\n arr = map(int,raw_input().split())\n s = min(arr)\n l = max(arr)\n for i in range(n):\n if abs(i-s)>abs(i-l):\n print abs(i-s),\n else:\n print abs(i-l),", "is_known_correct": true, "lang... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00030-of-00128_0__public__0000", "expected_output": {"kind": "stdout", "value": "1\n0\n1\n2\n3\n2\n1\n1 2 3\n"}, "input": {"kind": "stdin", "value": "2\n4 1\n1\n6 2\n2 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-00030-of-00128_1 | Once upon a time chef decided to learn encodings. And, obviously, he started with the easiest one (well, actually the easiest after Caesar cypher) – substitution cypher.
But very soon Chef got bored with encoding/decoding, so he started thinking how to hack this cypher.
He already knows some algorithm, which is not alw... | [{"code": "def cmp(tup):\n\treturn (tup[1], tup[0])\n\n\n\ndef get_decoder(text,freqseq):\n\tmymap = {}\n\tfor ch in text:\n\t\tif ch.isalpha():\n\t\t\tif ch.lower() in mymap:\n\t\t\t\tmymap[ch.lower()] += 1\n\t\t\telse:\n\t\t\t\tmymap[ch.lower()] = 1\n\n\tv = []\n\tfor k in mymap:\n\t\tv.append((k,mymap[k]))\n\n\tv = ... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00030-of-00128_1__public__0000", "expected_output": {"kind": "stdout", "value": "hello!\nhave a nice day!\nHello!"}, "input": {"kind": "stdin", "value": "3\nqwrtyuipasdfgjkzxcvbnmheol\ndummy!\nbfgjklmopqrstuwxzhvnicdyea\nabcd b efgd hbi!\nqwrtyuipasdfgjkzxcv... | {"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-00030-of-00128_2 | Did you know that Chwee kueh, a cuisine of Singapore, means water rice cake ? Its a variety of the most popular South Indian savory cake, only that we call it here idli :). The tastiest idlis are made in Chennai, by none other than our famous chef, Dexter Murugan. Being very popular, he is flown from Marina to Miami, t... | [{"code": "# your code goes here\n# your code goes here\nimport math\nA=[]\nt=int(raw_input())\nfor u in range(0,t):\n\tsize=int(raw_input())\n\tA=map(int,raw_input().split())\n\tidli=[0]*(size+1)\n\tcount=0\n\tfor k in A:\n\t\tidli[k]+=1\n\t\tcount =count+k\n\tif(count%size!=0):\n\t\tprint(\"-1\")\n\telse:\n\t\ti=0\n\... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00030-of-00128_2__public__0000", "expected_output": {"kind": "stdout", "value": "1\n-1\n3\n"}, "input": {"kind": "stdin", "value": "3\n4\n1 2 2 3\n2\n1 2\n7\n1 2 3 4 5 6 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-00030-of-00128_78 | There are S sheep and W wolves.
If the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.
If the wolves will attack the sheep, print `unsafe`; otherwise, print `safe`.
Constraints
* 1 \leq S \leq 100
* 1 \leq W \leq 100
Input
Input is given from Standard Input in the fol... | [{"code": "import java.util.Scanner;\n\npublic class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int sheep = sc.nextInt(), wolf=sc.nextInt();\n if(wolf>=sheep) System.out.println(\"unsafe\");\n else System.out.println(\"safe\");\n }\n}\n\t\t", "is_known_correct": true, "... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00030-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "unsafe"}, "input": {"kind": "stdin", "value": "4 5"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00030-of-00128_78__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-00030-of-00128_82 | You are given a string s of length n. Does a tree with n vertices that satisfies the following conditions exist?
* The vertices are numbered 1,2,..., n.
* The edges are numbered 1,2,..., n-1, and Edge i connects Vertex u_i and v_i.
* If the i-th character in s is `1`, we can have a connected component of size i by rem... | [{"code": "#include<iostream>\n#include<vector>\n#include<algorithm>\nusing namespace std;\nstring s;\nint n;\n\nint main()\n{\n\tcin>>s;\n\tn=s.size();\n\tif(s[n-1]=='1'||s[0]=='0')\n\t{\n\t\tcout<<-1<<endl;\n\t\treturn 0;\n\t}\n\tfor(int i=0;i<n-1;i++)\n\t{\n\t\tif(s[i]!=s[n-i-2])\n\t\t{\n\t\t\tcout<<-1<<endl;\n\t\t\... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00030-of-00128_82__public__0000", "expected_output": {"kind": "stdout", "value": "1 2\n2 3\n3 4"}, "input": {"kind": "stdin", "value": "1110"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00030-of-001... | {"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-00030-of-00128_83 | You planned a trip using trains and buses. The train fare will be A yen (the currency of Japan) if you buy ordinary tickets along the way, and B yen if you buy an unlimited ticket. Similarly, the bus fare will be C yen if you buy ordinary tickets along the way, and D yen if you buy an unlimited ticket.
Find the minimu... | [{"code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n int s, t, v, w;\n cin >> s >> t >> v >> w;\n cout << min(s, t) + min(v, w) << endl;\n \n}\n \n", "is_known_correct": true, "language": "cpp", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00030-of-00128_83... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00030-of-00128_83__public__0000", "expected_output": {"kind": "stdout", "value": "1152"}, "input": {"kind": "stdin", "value": "549\n817\n715\n603"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00030-o... | {"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-00030-of-00128_84 | Square1001 has seen an electric bulletin board displaying the integer 1. He can perform the following operations A and B to change this value:
* Operation A: The displayed value is doubled.
* Operation B: The displayed value increases by K.
Square1001 needs to perform these operations N times in total. Find the min... | [{"code": "#include<iostream>\nusing namespace std;\nint main()\n{\n int a,b,x=1,i;\n cin>>a>>b;\n for(i = 1;i<=a;i++)\n x=min(x*2,x+b);\n cout<<x<<endl;\n}\n", "is_known_correct": true, "language": "cpp", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00030-of-00128_... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00030-of-00128_84__public__0000", "expected_output": {"kind": "stdout", "value": "76"}, "input": {"kind": "stdin", "value": "10\n10"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00030-of-00128_84__pu... | {"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-00030-of-00128_85 | You are given three integers A, B and C. Determine whether C is not less than A and not greater than B.
Constraints
* -100≤A,B,C≤100
* A, B and C are all integers.
Input
Input is given from Standard Input in the following format:
A B C
Output
If the condition is satisfied, print `Yes`; otherwise, print `No`.
... | [{"code": "a,b,c=map(int,input().split());print('YNeos'[a>c or b<c::2])", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00030-of-00128_85__ref__0000", "source": "benchmark"}, {"code": "a,b,c=map(int,input().split())\nprint('Yes' if c>=a a... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00030-of-00128_85__public__0000", "expected_output": {"kind": "stdout", "value": "No"}, "input": {"kind": "stdin", "value": "6 5 4"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00030-of-00128_85__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 | ATCODER | [""] | null |
codecontests__test__code_contests_train.riegeli-00031-of-00128_1 | Chef has N simple polygons (non self intersecting polygons) in which no two of them intersect with each other. For any two polygons P1, P2, either P1 lies inside P2 or vice versa.
Chef wants you to count number of polygons lying strictly inside each of the polygons.
Input
First line of the input contains an integer T... | [{"code": "class One:\n\tdef __init__(self,index,x):\n\t\tself.index=index\n\t\tself.x=x\nt=int(input())\nfor i in range(0,t):\n\tlist=[]\n\tn=int(input())\n\tfor j in range(0,n):\n\t\tp=int(input())\n\t\te1=One(j,0)\n\t\tarr=raw_input().split()\n\t\tfor k in range(0,p):\n\t\t\tif(k==0):\n\t\t\t\te1.x=int(arr[2*k])\n\t... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00031-of-00128_1__public__0000", "expected_output": {"kind": "stdout", "value": "1 0 2"}, "input": {"kind": "stdin", "value": "1\n3\n6\n-2 2 -1 1 2 2 2 -1 1 -2 -2 -2\n3\n-1 -1 1 -1 1 1\n4\n3 3 -3 3 -3 -3 3 -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-00031-of-00128_2 | An equation is an equality containing one or more variables. Solving the equation consists of determining which values of the variables make the equality true. In this situation, variables are also known as unknowns and the values which satisfy the equality are known as solutions. An equation differs from an identity i... | [{"code": "t=input()\n\nfor i in range(t):\n\t\n\tn=input()\n\n\tl=map(int,raw_input().split())\n\n\ts=sum(l)/(n-1)\n\n\tfor x in l:\n\t\n\t\tif(x!=l[len(l)-1]):\n\t\t\tprint s-x,\n\t\telse:\n\t\t\tprint s-x", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_conte... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00031-of-00128_2__public__0000", "expected_output": {"kind": "stdout", "value": "1 4 5\n1 3 4 6\n"}, "input": {"kind": "stdin", "value": "2\n3\n9 6 5\n4\n13 11 10 8"}, "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-00031-of-00128_4 | The Chef's latest idea is that some cooks might work better in pairs. So, he is going to experiment by pairing up some of his employees to see if the quality of the food prepared in his kitchen increases. However, only some pairs of employees are compatible. Two employees that are not compatible cannot be paired togeth... | [{"code": "for _ in range(int(raw_input())):\n n, m = map(int, raw_input().split())\n a = []\n t = []\n ans =[]\n for __ in range(m):\n a.append([map(int, raw_input().split())])\n a.reverse()\n for i in range(len(a)):\n for p, q in a[i]:\n if p not in t and q not in t:\n ... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00031-of-00128_4__public__0000", "expected_output": {"kind": "stdout", "value": "1 4\n2\n"}, "input": {"kind": "stdin", "value": "2\n4 5\n0 1\n1 2\n2 3\n1 3\n3 0\n4 3\n0 1\n2 3\n2 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-00031-of-00128_78 | Takahashi and Aoki will have a battle using their monsters.
The health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.
The two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ... Here, an attack decreases ... | [{"code": "#include <iostream> \nusing namespace std;\nint main()\n{\n\tint a,b,c,d; cin>>a>>b>>c>>d;\n\t((b+c-1)/b) > ((a+d-1)/d) ? cout<<\"No\" : cout<<\"Yes\";\n}\n", "is_known_correct": true, "language": "cpp", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00031-of-00128_78__ref__0... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00031-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "Yes"}, "input": {"kind": "stdin", "value": "46 4 40 5"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00031-of-00128_78... | {"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-00031-of-00128_79 | Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B are both wrong.
Print the correct choice for this problem.
Constraints
* Each of the numbers A and B is 1, 2, or 3.
* ... | [{"code": "A = int(input())\nB = int(input())\nprint(1+2+3 -A-B)", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00031-of-00128_79__ref__0000", "source": "benchmark"}, {"code": "A = input()\nB = input()\nprint list(set([1, 2, 3]) - set([A... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00031-of-00128_79__public__0000", "expected_output": {"kind": "stdout", "value": "3"}, "input": {"kind": "stdin", "value": "1\n2"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00031-of-00128_79__publi... | {"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-00031-of-00128_81 | There are H rows and W columns of white square cells.
You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.
How many white cells will remain?
It can be proved that this count does not depend on what rows and columns are chosen.
Constraints
* All values i... | [{"code": "#include<bits/stdc++.h>\nusing namespace std;\nint main(){\n int a,b,p,q;cin>>a>>b>>p>>q;\n cout<<(a-p)*(b-q)<<endl;\n}", "is_known_correct": true, "language": "cpp", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00031-of-00128_81__ref__0000", "source": "benchmark"}, {"cod... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00031-of-00128_81__public__0000", "expected_output": {"kind": "stdout", "value": "0"}, "input": {"kind": "stdin", "value": "2 4\n2 4"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00031-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-00031-of-00128_82 | You are given a sequence D_1, D_2, ..., D_N of length N. The values of D_i are all distinct. Does a tree with N vertices that satisfies the following conditions exist?
* The vertices are numbered 1,2,..., N.
* The edges are numbered 1,2,..., N-1, and Edge i connects Vertex u_i and v_i.
* For each vertex i, the sum of ... | [{"code": "#include <bits/stdc++.h>\nusing namespace std;\nconst int MX=1e5+5;\npair<long long,int> a[MX];\nmap<long long,int> mp;\nlong long n;\nint p[MX];\nint visit[MX];\nlong long s[MX];\nlong long dp[MX];\nint main(){\n cin.tie(0);\n cout.tie(0);\n ios_base::sync_with_stdio(0);\n cin>>n;\n int i;\n ... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00031-of-00128_82__public__0000", "expected_output": {"kind": "stdout", "value": "1 10\n1 11\n2 8\n2 15\n3 5\n3 9\n4 5\n4 10\n5 15\n6 12\n6 14\n7 13\n9 12\n11 13"}, "input": {"kind": "stdin", "value": "15\n57\n62\n47\n45\n42\n74\n90\n75\n54\n50\n66\n63\n77\n... | {"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-00031-of-00128_83 | Some number of chocolate pieces were prepared for a training camp. The camp had N participants and lasted for D days. The i-th participant (1 \leq i \leq N) ate one chocolate piece on each of the following days in the camp: the 1-st day, the (A_i + 1)-th day, the (2A_i + 1)-th day, and so on. As a result, there were X ... | [{"code": "import java.util.Scanner;\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint N=sc.nextInt();\n\t\tint D=sc.nextInt();\n\t\tint X=sc.nextInt();\n\t\tint[] A=new int[N];\n\t\tfor(int i=0;i<A.length;i++) {\n\t\t\tA[i]=sc.nextInt();\n\t\t}\n\t\tint s... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00031-of-00128_83__public__0000", "expected_output": {"kind": "stdout", "value": "56"}, "input": {"kind": "stdin", "value": "5\n30 44\n26\n18\n81\n18\n6"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-... | {"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-00031-of-00128_84 | E869120 found a chest which is likely to contain treasure.
However, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.
He also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with `?`.
One more t... | [{"code": "#include<iostream>\n#include<string>\n#define loop(i,a,b) for(int i=a;i<b;i++)\n#define rep(i,a) loop(i,0,a)\nusing namespace std;\n\nint main(){\n\tstring s,t;\n\tcin>>s>>t;\n\tbool tmp=false;\n\tfor(int i=s.size()-t.size();i>=0;i--){\n\t\tbool check=true;\n\t\trep(j,t.size()){\n\t\t\tif(s[i+j]=='?' or s[i+... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00031-of-00128_84__public__0000", "expected_output": {"kind": "stdout", "value": "atcoder"}, "input": {"kind": "stdin", "value": "?tc????\ncoder"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00031-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-00031-of-00128_85 | There are N cities and M roads. The i-th road (1≤i≤M) connects two cities a_i and b_i (1≤a_i,b_i≤N) bidirectionally. There may be more than one road that connects the same pair of two cities. For each city, how many roads are connected to the city?
Constraints
* 2≤N,M≤50
* 1≤a_i,b_i≤N
* a_i ≠ b_i
* All input values a... | [{"code": "n,m = map(int,input().split())\nl = [0]*n\nfor i in range(0,m):\n for j in list(map(int,input().split())):\n l[j-1]+=1\nfor i in range(0,n):\n print(l[i])", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00031-of-00128_85__... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00031-of-00128_85__public__0000", "expected_output": {"kind": "stdout", "value": "2\n2\n1\n1"}, "input": {"kind": "stdin", "value": "4 3\n1 2\n2 3\n1 4"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-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-00031-of-00128_87 | Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order.
Iroha is looking for X,Y,Z-Haiku (defined below) in integer sequences.
Consider all integer sequences of length N whose elements are between 1 and 10, inclusive. Out of those 10^N sequences, how many ... | [{"code": "#include <iostream>\n#include <cstring>\nusing namespace std;\n\ntypedef int state_t;\n\nconst int Mod = 1e9 + 7, MaxN = 41, StateLen = 5 + 7 + 5;\nint N, X, Y, Z, p[MaxN], f[MaxN][1 << StateLen];\nstate_t end_state;\n\nstate_t dp(int i, int j) {\n if (i == N) {\n return 0;\n }\n if (~f[i][j]) {\n r... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00031-of-00128_87__public__0000", "expected_output": {"kind": "stdout", "value": "562805100"}, "input": {"kind": "stdin", "value": "40 5 7 5"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00031-of-001... | {"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-00032-of-00128_0 | Problem description
Chef loves circular cakes. He divides them into smaller pieces and sells them. You are to help him in this work.
Today Chef has cooked the brand new circular cake. To split the cake Chef can make several (possibly, zero) cuts. Each cut should be a straight line going from the center of the cake to i... | [{"code": "import math\nimport sys\ndef parseIntList(str):\n return [long(x) for x in str.split()]\ndef printBS(li):\n s=[str(i) for i in li]\n print \" \".join(s)\ncases=input()\nfor i in range(cases):\n n=input()\n if 360%n : print 'n',\n else: print 'y',\n if 360/n : print 'y',\n else: print 'n',\n if n<=26: print '... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00032-of-00128_0__public__0000", "expected_output": {"kind": "stdout", "value": "y y y\nn y y\n"}, "input": {"kind": "stdin", "value": "2\n4\n7"}, "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-00032-of-00128_1 | Chef likes rectangles. Among all possible rectangles, he loves rectangles that can be drawn like a grid, such that they have N rows and M columns. Grids are common in Byteland. Hence, Chef has drawn such a rectangle and plans on moving around in it.
The rows of the rectangle are labeled from 1 to N from top to bottom. ... | [{"code": "i=0\nt=int(raw_input())\nwhile i<t:\n\tn,m,k=map(int,raw_input().split())\n\tif n>m:\n\t\tn=n+m\n\t\tm=n-m\n\t\tn=n-m\n\tif n==1 and m<=2:\n\t\tprint 0\n\telif n==1 and m>2:\n\t\tprint k\n\telse:\n\t\tprint (k+1)/2\n\ti+=1", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "code... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00032-of-00128_1__public__0000", "expected_output": {"kind": "stdout", "value": "1\n1\n12\n"}, "input": {"kind": "stdin", "value": "3\n2 2 1\n3 3 2\n1 5 12"}, "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-00032-of-00128_4 | The citizens of Byteland regularly play a game. They have blocks each denoting some integer from 0 to 9. These are arranged together in a random manner without seeing to form different numbers keeping in mind that the first block is never a 0. Once they form a number they read in the reverse order to check if the numbe... | [{"code": "a = input()\nfor x in range(a):\n n = str(input())\n str1 = ''\n for i in range(len(n)-1,-1,-1):\n str1 += n[i]\n if str1 == n:\n print 'wins'\n else:\n print 'losses'", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__cod... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00032-of-00128_4__public__0000", "expected_output": {"kind": "stdout", "value": "losses\nwins\nwins\n"}, "input": {"kind": "stdin", "value": "3\n331\n666\n343"}, "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-00032-of-00128_72 | Milly loves to eat chocolates. She has N different chocolates. She needs to choose only one of them. At the moment, i^{th} chocolate already has P_{i} pieces. The j^{th} piece of the i^{th} chocolate requires T_{i,j} seconds to eat. Milly knows that she will take K seconds to break one piece from any chocolate and wait... | [{"code": "t = int(raw_input())\nwhile t:\n\tt-=1\n\tn,k,m=map(int,raw_input().split())\n\tp = map(int,raw_input().split())\n\tans = (2*10**5)+(101*10**9)\n\tidx = 0\n\tfor i in xrange(n):\n\t\tfirstTime = True\n\t\tval=0\n\t\tfor j in raw_input().split():\n\t\t\tj = int(j)\n\t\t\tif (firstTime):\n\t\t\t\tval+=(k+j)\n\... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00032-of-00128_72__public__0000", "expected_output": {"kind": "stdout", "value": "1 20\n"}, "input": {"kind": "stdin", "value": "1\n2 10 10\n1 2\n10\n4 2\n\nSAMPLE"}, "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 | HACKEREARTH | [] | null |
codecontests__test__code_contests_train.riegeli-00032-of-00128_77 | Takahashi is meeting up with Aoki.
They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now.
Takahashi will leave his house now and go straight to the place at a speed of S meters per minute.
Will he arrive in time?
Constraints
* 1 \leq D \leq 10000
* 1 \leq T \leq 10... | [{"code": "import java.util.*;\npublic class Main {\n public static void main(String args[]) {\n Scanner in=new Scanner(System.in);\n float d=in.nextFloat(),t=in.nextFloat(),s=in.nextFloat();\n if((d/s)<=t)\n System.out.println(\"Yes\");\n else\n System.out.println(\... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00032-of-00128_77__public__0000", "expected_output": {"kind": "stdout", "value": "Yes"}, "input": {"kind": "stdin", "value": "2000 20 100"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00032-of-00128_... | {"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-00032-of-00128_78 | You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i.
How many kinds of items did you get?
Constraints
* 1 \leq N \leq 2\times 10^5
* S_i consists of lowercase English letters and has a length between 1 and 10 (inclusive).
Input
Input is given from Standard Input in t... | [{"code": "N=int(input())\nJ=[input() for i in range(N)]\n\nprint(len(list(set(J))))", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00032-of-00128_78__ref__0000", "source": "benchmark"}, {"code": "n = int(input())\na = set([input() for i... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00032-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "4"}, "input": {"kind": "stdin", "value": "4\naaaa\na\naaa\naa"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00032-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-00032-of-00128_79 | Given are strings s and t of length N each, both consisting of lowercase English letters.
Let us form a new string by alternating the characters of S and the characters of T, as follows: the first character of S, the first character of T, the second character of S, the second character of T, ..., the N-th character of... | [{"code": "import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint n = s.nextInt();\n\t\tString a = s.next(), b = s.next();\n\t\tfor (int i = 0; i < a.length(); i++) {\n\t\t\tSystem.out.print(a.charAt(i) + \"\" + b.charAt(i));\n\t\... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00032-of-00128_79__public__0000", "expected_output": {"kind": "stdout", "value": "icpc"}, "input": {"kind": "stdin", "value": "2\nip cc"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00032-of-00128_79... | {"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-00032-of-00128_81 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}.
Additionally, you are given integers B_1, B_2, ..., B_M and C.
The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0.
Among the N c... | [{"code": "\n\nimport java.util.Scanner;\n\npublic class Main {\n static Scanner sc = new Scanner(System.in);\n\n\n public static void main(String[] args) {\n int n = sc.nextInt();\n int m = sc.nextInt();\n int c = sc.nextInt();\n int[] b = new int[m];\n for (int i = 0; i < m; i... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00032-of-00128_81__public__0000", "expected_output": {"kind": "stdout", "value": "0"}, "input": {"kind": "stdin", "value": "3 3 0\n100 -100 0\n0 100 100\n100 100 100\n-100 100 100"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__c... | {"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-00032-of-00128_82 | You have decided to give an allowance to your child depending on the outcome of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should constru... | [{"code": "#include<iostream>\n\nusing namespace std;\n\nint main() {\n int a, b, c;\n cin >> a >> b >> c;\n int m = max(max(a, b), c);\n cout << a + b + c + m * 9 << endl;\n}", "is_known_correct": true, "language": "cpp", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00032-of-001... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00032-of-00128_82__public__0000", "expected_output": {"kind": "stdout", "value": "108"}, "input": {"kind": "stdin", "value": "9 9 9"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00032-of-00128_82__pu... | {"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-00032-of-00128_84 | In the year 2168, AtCoder Inc., which is much larger than now, is starting a limited express train service called AtCoder Express.
In the plan developed by the president Takahashi, the trains will run as follows:
* A train will run for (t_1 + t_2 + t_3 + ... + t_N) seconds.
* In the first t_1 seconds, a train must ru... | [{"code": "n = int(input())\nt = list(map(int, input().split()))\nv = list(map(int, input().split()))\ntmp = 0\ne_t = []\nfor i in t:\n tmp+=i\n e_t.append(tmp)\n\ndef calc_end_speed(s):\n end_time = e_t[s]\n ma = 10**10\n for i in range(s+1, n):\n ma = min(e_t[i-1] - end_time + v[i], ma)\n ret... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00032-of-00128_84__public__0000", "expected_output": {"kind": "stdout", "value": "20.250000000000000000"}, "input": {"kind": "stdin", "value": "1\n9\n10"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-... | {"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-00032-of-00128_85 | There is an empty array. The following N operations will be performed to insert integers into the array. In the i-th operation (1≤i≤N), b_i copies of an integer a_i are inserted into the array. Find the K-th smallest integer in the array after the N operations. For example, the 4-th smallest integer in the array \\{1,2... | [{"code": "N, K = map(int, input().split())\narr = [list(map(int, input().split())) for i in range(N)]\narr.sort()\n \nn = 0\nfor i in range(N):\n\tn += arr[i][1]\n\tif n >= K:\n\t\tprint(arr[i][0])\n\t\tbreak", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_con... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00032-of-00128_85__public__0000", "expected_output": {"kind": "stdout", "value": "3"}, "input": {"kind": "stdin", "value": "3 4\n1 1\n2 2\n3 3"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00032-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-00033-of-00128_0 | Mahesh got a beautiful array named A as a birthday gift from his beautiful girlfriend Namratha. There are N positive integers in that array. Mahesh loved the array so much that he started to spend a lot of time on it everyday. One day, he wrote down all possible subsets of the array. Then for each subset, he calculated... | [{"code": "import heapq\ndef func(pq,sum,res,n,flag):\n if n==0:\n if flag:\n heapq.heappush(pq, sum)\n return\n func(pq, sum+res[n-1], res, n-1, True)\n func(pq, sum, res, n-1, flag)\n \n\n\nt=int(raw_input())\nfor i in range(t):\n res=[]\n pq=[]\n \n n=int(raw_input())... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00033-of-00128_0__public__0000", "expected_output": {"kind": "stdout", "value": "10\n1 1"}, "input": {"kind": "stdin", "value": "2\n1\n0 10\n2\n0 1 1 2"}, "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-00033-of-00128_1 | Chef likes shopping, and especially he likes to buy oranges. But right now he is short of money. He has only k rubles. There are n oranges. The i-th one costs costi rubles and has weight equal to weighti. Chef wants to buy a set of oranges with the maximal possible weight. Please help him, and tell him this weight.
In... | [{"code": "test = input()\nfrom itertools import combinations\nwhile test:\n test-=1\n n,k = map(int,raw_input().split())\n weights = []\n costs = []\n index = []\n for i in range(n):\n c,w = map(int,raw_input().split())\n costs.append(c)\n weights.append(w)\n index.append(... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00033-of-00128_1__public__0000", "expected_output": {"kind": "stdout", "value": "2\n5"}, "input": {"kind": "stdin", "value": "2\n1 3\n2 2\n3 4\n2 1\n2 2\n3 5"}, "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-00033-of-00128_3 | Alice and Bob are studying for their class test together. The topic of the test is Prime Numbers. The preparation is getting too boring for their liking. To make it interesting, they turn it into a game. The winner will get an ice-cream treat from the other.
The game is called Count K-Primes. A number is a k-prime if ... | [{"code": "import sys\n\nmax_num = 100001\n\n\ndef count_primes(num_lines):\n is_prime = [1] * max_num\n counts = [0] * max_num\n \n #print \"is_prime: \", is_prime\n\n for p in range(2, max_num):\n if is_prime[p]:\n counts[p] = 1\n j = 2\n while p * j < max_num:\n... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00033-of-00128_3__public__0000", "expected_output": {"kind": "stdout", "value": "4\n2\n2\n0"}, "input": {"kind": "stdin", "value": "4\n2 5 1\n4 10 2\n14 15 2\n2 20 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-00033-of-00128_77 | Given are two strings S and T.
Let us change some of the characters in S so that T will be a substring of S.
At least how many characters do we need to change?
Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
Constraints
* The lengths of ... | [{"code": "#include<bits/stdc++.h>\nusing namespace std;\nint main(){\n string s,t;\n cin >> s >> t;\n int i,j;\n int ans=10000;\n for(i=0;i<s.size()-t.size()+1;i++){\n int x=0;\n for(j=0;j<t.size();j++){\n if(s[i+j]!=t[j]){\n x++;\n }\n }\n ans=min(ans,x);\n }\n cout << ans << endl;... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00033-of-00128_77__public__0000", "expected_output": {"kind": "stdout", "value": "6"}, "input": {"kind": "stdin", "value": "codeforces\natcoder"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00033-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-00033-of-00128_78 | Given is a string S consisting of digits from `1` through `9`.
Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:
Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
Constraints
* 1 ≤ |S| ≤ 200000
* S is a string c... | [{"code": "#include<bits//stdc++.h>\nusing namespace std;\n#define rrep(i,n) for(int i = n -1;i >= 0;i--)\ntypedef long long int ll;\nll ans = 0, h = 1, now = 0;\nint main() {\n string s; cin >> s;\n vector<int> as(2020, 0); as[0]++;\n rrep(i, s.size()) {\n now = (now + (s[i] - '0') * h) % 2019;\n ... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00033-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "3"}, "input": {"kind": "stdin", "value": "1817181712114"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00033-of-00128_... | {"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-00033-of-00128_79 | Takahashi is organizing a party.
At the party, each guest will receive one or more snack pieces.
Takahashi predicts that the number of guests at this party will be A or B.
Find the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.
We assume that a piece cannot be ... | [{"code": "import math\nA,B=map(int,input().split())\nprint(int((A*B)/math.gcd(A,B)))\n", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00033-of-00128_79__ref__0000", "source": "benchmark"}, {"code": "from fractions import gcd\na,b=map(in... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00033-of-00128_79__public__0000", "expected_output": {"kind": "stdout", "value": "9999900000"}, "input": {"kind": "stdin", "value": "100000 99999"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00033-o... | {"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-00033-of-00128_81 | Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks.
There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each.
What is the minimum amount of money with which he can bu... | [{"code": "import java.util.ArrayList;\nimport java.util.List;\nimport java.util.Scanner;\n\npublic class Main {\n static class Data {\n public final long cost;\n public final long count;\n\n public Data(long cost, long count) {\n this.cost = cost;\n this.count = count;\n }\n }\n\n public stati... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00033-of-00128_81__public__0000", "expected_output": {"kind": "stdout", "value": "130"}, "input": {"kind": "stdin", "value": "4 30\n6 18\n2 5\n3 10\n7 9"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-... | {"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-00033-of-00128_82 | Our world is one-dimensional, and ruled by two empires called Empire A and Empire B.
The capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.
One day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes incli... | [{"code": "N,M,X,Y=map(int,input().split())\nx=list(map(int,input().split()))\ny=list(map(int,input().split()))\nif max(max(x),X)<min(min(y),Y):\n print('No War')\nelse:\n print(\"War\")", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riege... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00033-of-00128_82__public__0000", "expected_output": {"kind": "stdout", "value": "No War"}, "input": {"kind": "stdin", "value": "3 2 10 20\n8 15 13\n16 22"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegel... | {"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-00033-of-00128_83 | You are given two integers A and B.
Print a grid where each square is painted white or black that satisfies the following conditions, in the format specified in Output section:
* Let the size of the grid be h \times w (h vertical, w horizontal). Both h and w are at most 100.
* The set of the squares painted white is ... | [{"code": "#include<bits/stdc++.h>\nusing namespace std;\ntypedef long long ll;\nconst int mod=1e9+7;\n\nchar ans[105][105];\nint main()\n{\n\tint a,b;\n\tcin>>a>>b;\n\tfor(int i=0;i<100;i++)\n\t{\n\t\tfor(int j=0;j<100;j++)\n\t\t{\n\t\t\tif(i<50)\n\t\t\tans[i][j]='#';\n\t\t\telse\n\t\t\tans[i][j]='.';\n\t\t}\n\t}\n\tf... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00033-of-00128_83__public__0000", "expected_output": {"kind": "stdout", "value": "8 18\n..................\n..................\n....##.......####.\n....#.#.....#.....\n...#...#....#.....\n..#.###.#...#.....\n.#.......#..#.....\n.........#..####."}, "input": ... | {"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-00033-of-00128_85 | There is a directed graph with N vertices and M edges. The i-th edge (1≤i≤M) points from vertex a_i to vertex b_i, and has a weight c_i. We will play the following single-player game using this graph and a piece.
Initially, the piece is placed at vertex 1, and the score of the player is set to 0. The player can move t... | [{"code": "\nimport java.io.*;\nimport java.util.*;\n\nclass Graph\n{\n //開始,ゴール,頂点,辺\n int s, g, n, e;\n //無向の場合もコンストラクタでうまくやってくれるはず\n int[] f, t;\n long[] c;\n long d[];/*sからの最短距離*/\n long d2[][];/*2点間の最短距離*/\n\n public Graph(int s, int N, int[] f, int[] t, long[] c)\n {\n this.s = s... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00033-of-00128_85__public__0000", "expected_output": {"kind": "stdout", "value": "inf"}, "input": {"kind": "stdin", "value": "2 2\n1 2 1\n2 1 1"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00033-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-00033-of-00128_87 | Iroha loves Haiku. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order.
To create a Haiku, Iroha has come up with three different phrases. These phrases have A, B and C syllables, respectively. Determine whether she can construct a Haiku by using each of... | [{"code": "import java.util.*;\nclass Main {\n public static void main(String[] args) {\n Scanner sc= new Scanner(System.in);\n int a= sc.nextInt();\n int b=sc.nextInt();\n int c = sc.nextInt();\n \n if(a+b+c ==17) {\n System.out.println(\"YES\");\n } else {\n System.out.... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00033-of-00128_87__public__0000", "expected_output": {"kind": "stdout", "value": "YES"}, "input": {"kind": "stdin", "value": "5 5 7"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00033-of-00128_87__pu... | {"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-00034-of-00128_0 | Problem description
As a holiday gift, Tojo received a probability problem. The problem read as follows
Consider an N by M grid. Rows are numbered 1 to N, from top to bottom. Columns are numbered 1 to M, from left to right. You are initially at cell (1, 1) and want to go to cell (N, M). From any cell you can move to th... | [{"code": "t=int(raw_input())\n\nwhile(t>0):\n t-=1\n n,m=[int(i) for i in raw_input().split()]\n print (\"%.6f\" % (n+m-1))", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00034-of-00128_0__ref__0000", "source": "benchmark"}, {"... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00034-of-00128_0__public__0000", "expected_output": {"kind": "stdout", "value": "3.000000\n6.000000\n"}, "input": {"kind": "stdin", "value": "2\n2 2\n1 6"}, "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-00034-of-00128_1 | Chef likes playing with strings. The most interesting game are named "CHEF in string". The move of the game consists of the following: Chef takes a subsequence of string's letters that form the word "CHEF" and then he removes that symbols. The goal of the game is to make the maximal number of moves. Please, help Chef a... | [{"code": "chef = raw_input()\n\ndef find_index(chef, index):\n c1,h1,e1,f1 = index\n c = chef.find('C', c1+1)\n if c<0:\n return None\n h = chef.find('H', max(c+1, h1+1))\n if h<0:\n return None\n e = chef.find('E', max(h+1, e1+1))\n if e<0:\n return None\n f = chef.find('F... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00034-of-00128_1__public__0000", "expected_output": {"kind": "stdout", "value": "2\n"}, "input": {"kind": "stdin", "value": "CHEFCHEFFFF"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00034-of-00128_1... | {"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-00034-of-00128_2 | Lots of geeky customers visit our chef's restaurant everyday. So, when asked to fill the feedback form, these customers represent the feedback using a binary string (i.e a string that contains only characters '0' and '1'.
Now since chef is not that great in deciphering binary strings, he has decided the following crit... | [{"code": "# your code goes here\nt=int(raw_input())\nwhile t>0:\n\t\n\ts=str(raw_input())\n\t\n\t\n\tf1=s.find('010')\n\t\n\tf2=s.find('101')\n\t\n\t\n\tif f1>-1 and f2>-1:\n\t\tprint \"Good\"\n\telif (f1 > -1 and f2== -1) or (f1==-1 and f2 > -1):\n\t\tprint \"Good\"\n\telse: \n\t\tprint \"Bad\"\t\n\t\t\n\tt=t-1", "is... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00034-of-00128_2__public__0000", "expected_output": {"kind": "stdout", "value": "Bad\nGood\n"}, "input": {"kind": "stdin", "value": "2\n11111110\n10101010101010"}, "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-00034-of-00128_77 | Given are N integers A_1,\ldots,A_N.
Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7).
Constraints
* 2 \leq N \leq 2\times 10^5
* 0 \leq A_i \leq 10^9
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
N
A_1 \ldot... | [{"code": "s =0\nr =0\n\nn = int(input())\nl = list( map( int , input().split() ))\n\nfor e in l:\n\tr += e*s\n\ts += e\n\nmod =int(1e9+7)\nprint( r %mod )", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00034-of-00128_77__ref__0000", "so... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00034-of-00128_77__public__0000", "expected_output": {"kind": "stdout", "value": "11"}, "input": {"kind": "stdin", "value": "3\n1 2 3"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00034-of-00128_77__... | {"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-00034-of-00128_78 | There are N cities numbered 1 to N, connected by M railroads.
You are now at City 1, with 10^{100} gold coins and S silver coins in your pocket.
The i-th railroad connects City U_i and City V_i bidirectionally, and a one-way trip costs A_i silver coins and takes B_i minutes. You cannot use gold coins to pay the fare.... | [{"code": "n,m,s = map(int,input().split())\nimport collections\ng = [[] for _ in range(n+1)]\ndic = {}\nfor _ in range(m):\n u,v,a,b = map(int,input().split())\n g[u].append(v)\n g[v].append(u)\n dic[(u,v)]=(a,b)\n dic[(v,u)]=(a,b)\narr = [[0,0]]+[list(map(int,input().split())) for _ in range(n)]\ncost ... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00034-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "1000000001"}, "input": {"kind": "stdin", "value": "2 1 0\n1 2 1 1\n1 1000000000\n1 1"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_... | {"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-00034-of-00128_79 | We have N bricks arranged in a row from left to right.
The i-th brick from the left (1 \leq i \leq N) has an integer a_i written on it.
Among them, you can break at most N-1 bricks of your choice.
Let us say there are K bricks remaining. Snuke will be satisfied if, for each integer i (1 \leq i \leq K), the i-th of t... | [{"code": "#include<bits/stdc++.h>\nusing namespace std;\n#define rep(i,n) for(int i=0; i<(n); i++)\nint n, a, c = 1;\nint main(){\n\tscanf(\"%d\", &n);\n\trep(i,n){\n\t\tscanf(\"%d\", &a);\n\t\tif(a == c) c++;\n\t}\n\tprintf(\"%d\\n\", c == 1 ? -1 : n-c+1);\n}", "is_known_correct": true, "language": "cpp", "metadata":... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00034-of-00128_79__public__0000", "expected_output": {"kind": "stdout", "value": "-1"}, "input": {"kind": "stdin", "value": "3\n2 2 2"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00034-of-00128_79__... | {"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-00034-of-00128_80 | It is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.
Given an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.
Constraints
* 1 \leq r \leq 100
* r is an integer.
Input
Input is given from Standard Input in the following format:
r
Output
... | [{"code": "x = int(input())\nprint(3*pow(x,2))\n", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00034-of-00128_80__ref__0000", "source": "benchmark"}, {"code": "import java.util.Scanner;\n\n\npublic class Main {\n\n\tpublic static void m... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00034-of-00128_80__public__0000", "expected_output": {"kind": "stdout", "value": "48"}, "input": {"kind": "stdin", "value": "4"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00034-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 |
codecontests__test__code_contests_train.riegeli-00034-of-00128_81 | Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.
How many times will he h... | [{"code": "A,B,C = map(int,input().split())\nprint(min((B//A),C))", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00034-of-00128_81__ref__0000", "source": "benchmark"}, {"code": "#A\na, b, c = map(int, input().split())\nprint(min(c, b // ... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00034-of-00128_81__public__0000", "expected_output": {"kind": "stdout", "value": "3"}, "input": {"kind": "stdin", "value": "3 9 5"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00034-of-00128_81__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-00034-of-00128_82 | You are given strings S and T consisting of lowercase English letters.
You can perform the following operation on S any number of times:
Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.
Determine if S and T can ... | [{"code": "#include<bits/stdc++.h>\nusing namespace std;\nint fr1[150];\nint fr2[130];\nint main()\n{\n string s,t;\n cin>>s>>t;int y=1;\n map<char,int> mp;\n for(int i=0;i<s.size();i++)\n {\n fr1[s[i]]++;\n fr2[t[i]]++;\n if(fr1[s[i]]!=fr2[t[i]])\n {\n y=0;\n break... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00034-of-00128_82__public__0000", "expected_output": {"kind": "stdout", "value": "Yes"}, "input": {"kind": "stdin", "value": "azzel\napple"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00034-of-00128... | {"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-00034-of-00128_83 | We have an undirected weighted graph with N vertices and M edges. The i-th edge in the graph connects Vertex U_i and Vertex V_i, and has a weight of W_i. Additionally, you are given an integer X.
Find the number of ways to paint each edge in this graph either white or black such that the following condition is met, mo... | [{"code": "import sys\ninput=sys.stdin.readline\n\ndef find_parent(x):\n y=parent[x]\n if y<0:\n return x\n parent[x]=find_parent(y)\n return parent[x]\n\ndef connect(a,b):\n c=find_parent(a)\n d=find_parent(b)\n if c==d:\n return\n if parent[c]<parent[d]:\n parent[c]+=paren... | [{"case_id": "codecontests__test__code_contests_train.riegeli-00034-of-00128_83__public__0000", "expected_output": {"kind": "stdout", "value": "0"}, "input": {"kind": "stdin", "value": "5 4\n1\n1 2 3\n1 3 3\n2 4 6\n2 5 8"}, "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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.