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-00082-of-00128_79
It's now the season of TAKOYAKI FESTIVAL! This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The deliciousness of the i-th takoyaki is d_i. As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points. There are \frac{N...
[{"code": "#include<bits/stdc++.h>\nusing namespace std;\nint n,d[55],ans;\nint main(){\n\tcin>>n;\n\tfor(int i=1;i<=n;i++) cin>>d[i];\n\tfor(int i=1;i<n;i++)\n\t for(int j=i+1;j<=n;j++)\n\t ans+=d[i]*d[j];\n\tcout<<ans;\n\treturn 0;\n}", "is_known_correct": true, "language": "cpp", "metadata": {}, "solution_...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00082-of-00128_79__public__0000", "expected_output": {"kind": "stdout", "value": "11"}, "input": {"kind": "stdin", "value": "3\n3 1 2"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00082-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-00082-of-00128_84
Snuke lives at position x on a number line. On this line, there are two stores A and B, respectively at position a and b, that offer food for delivery. Snuke decided to get food delivery from the closer of stores A and B. Find out which store is closer to Snuke's residence. Here, the distance between two points s and...
[{"code": "#include<bits/stdc++.h>\nusing namespace std;\nint main()\n{\nint a,b,x;\ncin>>x>>a>>b;\nif(abs(x-a)<abs(x-b))cout<<'A'<<endl;\nelse cout<<'B'<<endl;\nreturn 0;\n}\n\n", "is_known_correct": true, "language": "cpp", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00082-of-00128...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00082-of-00128_84__public__0000", "expected_output": {"kind": "stdout", "value": "A"}, "input": {"kind": "stdin", "value": "1 999 1000"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00082-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-00082-of-00128_85
AtCoDeer the deer found N rectangle lying on the table, each with height 1. If we consider the surface of the desk as a two-dimensional plane, the i-th rectangle i(1≤i≤N) covers the vertical range of [i-1,i] and the horizontal range of [l_i,r_i], as shown in the following figure: <image> AtCoDeer will move these rect...
[{"code": "#include <bits/stdc++.h>\n#define db double\n#define ls rt << 1\n#define rs rt << 1 | 1\n#define pb push_back\n#define ll long long\n#define mp make_pair\n#define pii pair<int, int>\n#define X first\n#define Y second\n#define pcc pair<char, char>\n#define vi vector<int>\n#define vl vector<ll>\n#define rep(i,...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00082-of-00128_85__public__0000", "expected_output": {"kind": "stdout", "value": "0"}, "input": {"kind": "stdin", "value": "3\n2 5\n4 6\n1 4"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00082-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-00083-of-00128_76
Find a*b, for all given number pairs SAMPLE INPUT 5 4 6 3 7 SAMPLE OUTPUT 24 21
[{"code": "import sys\nfor line in sys.stdin:\n\ta = line.split()\n\tif(len(a)==2):\n\t\tprint int(a[0])*int(a[1])", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00083-of-00128_76__ref__0000", "source": "benchmark"}, {"code": "t=input()\...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00083-of-00128_76__public__0000", "expected_output": {"kind": "stdout", "value": "24\n21\n"}, "input": {"kind": "stdin", "value": "5\n4 6\n3 7\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-00083-of-00128_77
Given an integer a as input, print the value a + a^2 + a^3. Constraints * 1 \leq a \leq 10 * a is an integer. Input Input is given from Standard Input in the following format: a Output Print the value a + a^2 + a^3 as an integer. Examples Input 2 Output 14 Input 10 Output 1110
[{"code": "import java.util.Scanner;\n\npublic class Main {\n\n public static void main(final String[] args) {\n final var scanner = new Scanner(System.in);\n final int a = scanner.nextInt();\n\n System.out.println(a + a * a + a * a * a);\n }\n}\n", "is_known_correct": true, "language": "java", "metadata": {...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00083-of-00128_77__public__0000", "expected_output": {"kind": "stdout", "value": "14"}, "input": {"kind": "stdin", "value": "2"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00083-of-00128_77__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-00083-of-00128_79
There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S. Adjacent slimes with the same color will fuse into one larger slime withou...
[{"code": "#include \"bits/stdc++.h\"\nusing namespace std;\nstring a;\nint n,ans;\nint main()\n{\n\tcin>>n>>a;\n\tfor(int i=1;i<a.size();i++)\n\t\tif(a[i]!=a[i-1]) ans++;\n\tcout<<ans+1;\n}", "is_known_correct": true, "language": "cpp", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00083-of-00128_79__public__0000", "expected_output": {"kind": "stdout", "value": "10"}, "input": {"kind": "stdin", "value": "20\nxxzaffeeeeddfkkkkllq"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-000...
{"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-00083-of-00128_84
We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. Constraints * 4 \leq N \leq 10^5 * 1 \leq A_i \leq ...
[{"code": "#include <bits/stdc++.h>\nusing namespace std;\n\nlong v[1<<20],n,e1=0;\n\nint main(){\n cin>>n;\n for(int i=0;i < n;i++)\n {\n cin>>v[i];v[i]*=-1;\n }\n\n sort(v,v+n);\n\n for(int i=0;i < n-1;i++)\n {\n if(v[i]==v[i+1]){\n if(e1){\n cout<<e1*v[i];...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00083-of-00128_84__public__0000", "expected_output": {"kind": "stdout", "value": "20"}, "input": {"kind": "stdin", "value": "10\n3 3 3 3 4 4 4 5 5 5"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-0008...
{"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-00084-of-00128_0
The Chef is having a dinner party and invited over all his friends. His guests being fairly health conscious have exact protein requirements, and The Chef wishes to oblige them all. The Chef will cook dishes for each individual guest using the ingredients in his kitchen. Each ingredient has a specific amount of pro...
[{"code": "import sys\n\ndef create_meal_from_rawinput():\n\ttemp = sys.stdin.readline()\n\tproteinsStr = temp.split()[1:]\n\tproteins = [int(i) for i in proteinsStr]\n\tingredients = sys.stdin.readline().strip()\n\tdesiredProteins = int(sys.stdin.readline())\n\n\treturn Meal(\n\t\tproteins,\n\t\tingredients,\n\t\tdesi...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00084-of-00128_0__public__0000", "expected_output": {"kind": "stdout", "value": "IMPOSSIBLE\naaa\nab"}, "input": {"kind": "stdin", "value": "3\n5 12 1 12 4 4\nacccdadceb\n2\n3 5 4 6\nabcbacbabcc\n15\n2 3 4\nbaba\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-00084-of-00128_77
Given are strings S and T. Consider changing S to T by repeating the operation below. Find the minimum number of operations required to do so. Operation: Choose one character of S and replace it with a different character. Constraints * S and T have lengths between 1 and 2\times 10^5 (inclusive). * S and T consists ...
[{"code": "S=input()\nT=input()\ncc=0\nfor i in range(len(S)):\n cc+=int(S[i]!=T[i])\n\nprint(cc)", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00084-of-00128_77__ref__0000", "source": "benchmark"}, {"code": "print(sum(s!=t for s,t i...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00084-of-00128_77__public__0000", "expected_output": {"kind": "stdout", "value": "0"}, "input": {"kind": "stdin", "value": "apple\napple"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00084-of-00128_7...
{"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-00084-of-00128_78
In AtCoder City, there are three stations numbered 1, 2, and 3. Each of these stations is operated by one of the two railway companies, A and B. A string S of length 3 represents which company operates each station. If S_i is `A`, Company A operates Station i; if S_i is `B`, Company B operates Station i. To improve t...
[{"code": "#include <bits/stdc++.h>\nusing namespace std;\n\nstring s;\n\nint main() {\n cin >> s;\n if (s == \"BBB\" or s == \"AAA\") cout << \"No\";\n else cout << \"Yes\";\n}", "is_known_correct": true, "language": "cpp", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00084-of-001...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00084-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "Yes"}, "input": {"kind": "stdin", "value": "ABA"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00084-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-00084-of-00128_79
Takahashi has N sticks that are distinguishable from each other. The length of the i-th stick is L_i. He is going to form a triangle using three of these sticks. Let a, b, and c be the lengths of the three sticks used. Here, all of the following conditions must be satisfied: * a < b + c * b < c + a * c < a + b How...
[{"code": "#include<bits/stdc++.h>\nusing namespace std;\n\nint main()\n{\n\tint n;\n\tcin>>n;\n\tint a[n];\n\tfor(int i=0;i<n;i++)\n\t{\n\t\tcin>>a[i];\n\t}\n\tsort(a,a+n);\n\tint ans=0;\n\tfor(int i=0;i<n-2;i++)\n\t{\n\t\tfor(int j=i+1;j<n-1;j++)\n\t\t{\n\t\t\tfor(int k=j+1;k<n;k++)\n\t\t\t{\n\t\t\t\tif(a[i]+a[j]>a[k...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00084-of-00128_79__public__0000", "expected_output": {"kind": "stdout", "value": "1"}, "input": {"kind": "stdin", "value": "4\n3 4 2 1"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00084-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-00085-of-00128_0
Your friend Сhef has prepared a rectangular cake for you. Both of you want to divide the cake among yourselves. Your friend is generous enough to let you choose your share first. You have decided to take two pieces.For the first piece you make a rectangular cut (each side of this cut is parallel to the corresponding si...
[{"code": "for t in xrange(int(raw_input())):\n\tr1=map(int,raw_input().split())\n\tr2=map(int,raw_input().split())\n\tarea1=(r1[2]-r1[0])*(r1[3]-r1[1])\n\tarea2=(r2[2]-r2[0])*(r2[3]-r2[1])\n\tr3=[]\n\tr3.append(max(r1[0],r2[0]))\n\tr3.append(max(r1[1],r2[1]))\n\tr3.append(min(r1[2],r2[2]))\n\tr3.append(min(r1[3],r2[3]...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00085-of-00128_0__public__0000", "expected_output": {"kind": "stdout", "value": "162\n641\n"}, "input": {"kind": "stdin", "value": "2\n1 1 10 10\n11 11 20 20\n1 1 20 20\n11 11 30 30"}, "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-00085-of-00128_1
There are 100 houses located on a straight line. The first house is numbered 1 and the last one is numbered 100. Some M houses out of these 100 are occupied by cops. Thief Devu has just stolen PeePee's bag and is looking for a house to hide in. PeePee uses fast 4G Internet and sends the message to all the cops that a t...
[{"code": "t = int(input())\nfor test in xrange(t):\n chk = [1]*101\n m,x,y = map(int,raw_input().split())\n arr = map(int,raw_input().split())\n for v in xrange(m):\n for e in xrange(arr[v]-(x*y),arr[v]+(x*y)+1,1):\n try:\n if e>=0:\n chk[e] = 0\n ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00085-of-00128_1__public__0000", "expected_output": {"kind": "stdout", "value": "0\n18\n9\n"}, "input": {"kind": "stdin", "value": "3\n4 7 8\n12 52 56 8\n2 10 2\n21 75\n2 5 8\n10 51"}, "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-00085-of-00128_77
We have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it. It takes us A_i minutes to read the i-th book from the top on Desk A (1 \leq i \leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \leq i \leq M). Consider the following action: * Ch...
[{"code": "#include<bits/stdc++.h>\nusing namespace std;\n\nint main() {\n int n, m, k;\n cin >> n >> m >> k;\n vector<int> a(n), b(m);\n for (int &i : a) cin >> i;\n for (int &i : b) cin >> i;\n long long t = 0;\n for (int i = 0; i < m; i++) t += b[i];\n int j = m;\n int ans = 0;\n for (int i = 0; i <= n; i+...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00085-of-00128_77__public__0000", "expected_output": {"kind": "stdout", "value": "0"}, "input": {"kind": "stdin", "value": "5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000"}, "metadata": {}, "visibil...
{"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-00085-of-00128_78
Takahashi has many red balls and blue balls. Now, he will place them in a row. Initially, there is no ball placed. Takahashi, who is very patient, will do the following operation 10^{100} times: * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row. How ...
[{"code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(){\n int64_t N,A,B;cin>>N>>A>>B;\n int64_t ans = (N/(A+B))*A + min(N%(A+B),A);\n cout<<ans<<endl;\n}\n \n", "is_known_correct": true, "language": "cpp", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00085-of-0012...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00085-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "0"}, "input": {"kind": "stdin", "value": "8 0 4"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00085-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-00085-of-00128_79
There are N towns numbered 1 to N and M roads. The i-th road connects Town A_i and Town B_i bidirectionally and has a length of C_i. Takahashi will travel between these towns by car, passing through these roads. The fuel tank of his car can contain at most L liters of fuel, and one liter of fuel is consumed for each u...
[{"code": "#include<iostream>\n#include<algorithm>\n#include<vector>\n#include<map>\n#include<queue>\n#include<stack>\n#include<string>\n#include<string.h>\n#include<math.h>\nusing namespace std;\nconst int maxn=3e2+7;\ntypedef long long ll;\nconst ll INF=1e18;\nint n,m;\nll l,dis[maxn][maxn];\nint main()\n{\n\tscanf(\...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00085-of-00128_79__public__0000", "expected_output": {"kind": "stdout", "value": "-1"}, "input": {"kind": "stdin", "value": "4 0 1\n1\n2 1"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00085-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-00085-of-00128_82
You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N. Constraints * 1 \leq N \leq 10^9 * All values in input are integers. Input Input is given from Standard Input in the following format: N Output Print the minimum positive integer divisible by both 2 and N. Example...
[{"code": "n = int(input())\nif n % 2 == 0:\n print(n)\nelse:\n print(2*n)", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00085-of-00128_82__ref__0000", "source": "benchmark"}, {"code": "import java.util.Scanner;\npublic class Main\n{\...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00085-of-00128_82__public__0000", "expected_output": {"kind": "stdout", "value": "1999999998"}, "input": {"kind": "stdin", "value": "999999999"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00085-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-00085-of-00128_84
A subsequence of a string S is a string that can be obtained by deleting zero or more characters from S without changing the order of the remaining characters. For example, `arc`, `artistic` and (an empty string) are all subsequences of `artistic`; `abc` and `ci` are not. You are given a string A consisting of lowerca...
[{"code": "#include <bits/stdc++.h>\n\nusing namespace std;\n#define FOR(i,a,b) for(int i=(a);i<(b);i++)\n#define REP(i,a) FOR(i,0,a)\n\nconst int MAX_LEN=2e5,INF=1e6;\nstring A;\n\nchar dp[MAX_LEN+1];\nint dp2[MAX_LEN+1];\nmap<char,int> mp[MAX_LEN+1];\n\nint main(){\n\tcin>>A;\n\tA.insert(A.begin(),'$');\n\tdp[A.size(...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00085-of-00128_84__public__0000", "expected_output": {"kind": "stdout", "value": "aca"}, "input": {"kind": "stdin", "value": "frqnvhydscshfcgdemurlfrutcpzhopfotpifgepnqjxupnskapziurswqazdwnwbgdhyktfyhqqxpoidfhjdakoxraiedxskywuepzfniuyskxiyjpjlxuqnfgmnjcvtlpn...
{"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-00086-of-00128_3
Chef Po has given an online advertisement to provide Event organizing services. Chef got a huge response for his advertisement. He got various orders to conduct the events from different organizations. In turn, Chef will receive a compensation depend upon the type of event and the total numbers of persons in the event....
[{"code": "from sys import stdin\nfrom collections import defaultdict\n\nclass Event(object):\n\tdef __init__(self, start, end, value):\n\t\tself.start = start\n\t\tself.end = end\n\t\tself.value = value\n\nT = int(stdin.readline())\n\nfor _ in range(T):\n\tnumber_of_events = int(stdin.readline())\n\tevents = defaultdi...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00086-of-00128_3__public__0000", "expected_output": {"kind": "stdout", "value": "3700\n2000"}, "input": {"kind": "stdin", "value": "2\n4\n1 2 100\n2 3 200\n3 4 1600\n1 3 2100\n3\n1 10 2000\n2 5 100\n6 9 400"}, "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-00086-of-00128_4
Chef loves arrays. But he really loves a specific kind of them - Rainbow Arrays. The array is a Rainbow Array if it has such a structure: The first a1 elements equal to 1. The next a2 elements equal to 2. The next a3 elements equal to 3. The next a4 elements equal to 4. The next a5 elements equal to 5. The n...
[{"code": "import sys\n \nf=sys.stdin\n \nmod=1000000007\n \nn=int(f.readline())\n \nif n<13:\n print 0\nelse :\n n+=1\n n/=2\n n-=1\n ans=n*(n-1)*(n-2)*(n-3)*(n-4)*(n-5)\n ans/=720\n ans%=mod\n print ans", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00086-of-00128_4__public__0000", "expected_output": {"kind": "stdout", "value": "1\n"}, "input": {"kind": "stdin", "value": "14"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00086-of-00128_4__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-00086-of-00128_77
For a positive integer X, let f(X) be the number of positive divisors of X. Given a positive integer N, find \sum_{K=1}^N K\times f(K). Constraints * 1 \leq N \leq 10^7 Input Input is given from Standard Input in the following format: N Output Print the value \sum_{K=1}^N K\times f(K). Examples Input 4 O...
[{"code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n long long n, ans = 0; cin >> n;\n for(long long i = 1; i <= n; ++i) for(long long j = 1; i*j <= n; ++j) ans += i*j;\n cout << ans << \"\\n\";\n return 0;\n}", "is_known_correct": true, "language": "cpp", "metadata": {}, "solution_id": "codeco...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00086-of-00128_77__public__0000", "expected_output": {"kind": "stdout", "value": "23"}, "input": {"kind": "stdin", "value": "4"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00086-of-00128_77__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-00086-of-00128_78
Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.) Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded d...
[{"code": "A,B=map(int,input().split());v=max(A*25+1>>1,B*10);print(v if v<min(A*25+26>>1,B*10+10)else-1)", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00086-of-00128_78__ref__0000", "source": "benchmark"}, {"code": "#include <bits/stdc...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00086-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "-1"}, "input": {"kind": "stdin", "value": "19 99"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00086-of-00128_78__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-00086-of-00128_79
Takahashi has N cards. The i-th of these cards has an integer A_i written on it. Takahashi will choose an integer K, and then repeat the following operation some number of times: * Choose exactly K cards such that the integers written on them are all different, and eat those cards. (The eaten cards disappear.) For...
[{"code": "#include<bits/stdc++.h>\nusing namespace std;\nint a[300001],b[300001]={0},c[300001]={0};\nint u=0;\nint n;\nint k;\nint judge(int q,int k)\n{\n\tint l=1,r=n,mid,ans;\n\twhile(l<=r)\n\t{\n\t\tmid=(l+r)/2;\n\t\tif(b[mid]<q&&(mid==n||b[mid+1]>=q))\n\t\t{\n\t\t\tans=mid;\n\t\t\tbreak;\n\t\t}\n\t\telse if(b[mid]...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00086-of-00128_79__public__0000", "expected_output": {"kind": "stdout", "value": "5\n2\n1\n1\n1"}, "input": {"kind": "stdin", "value": "5\n1 2 3 4 5"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-0008...
{"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-00086-of-00128_84
We have a board with an H \times W grid. Each square in the grid is painted in black or white. The square at the i-th row from the top and j-th column from the left is black if the j-th character in S_i is `#`, and white if that character is `.`. Snuke can perform the following operation on the grid any number of time...
[{"code": "import java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.UncheckedIOException;\nimport java.io.Closeable;\nimport java.io.Writer;\nimport java.io.OutputStreamWriter;\nimport java.io.InputStream;\n\n/**\n ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00086-of-00128_84__public__0000", "expected_output": {"kind": "stdout", "value": "6"}, "input": {"kind": "stdin", "value": "3 3\n..#\n.\n.#."}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00086-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-00087-of-00128_2
Chef has learned a new technique for comparing two recipes. A recipe contains a list of ingredients in increasing order of the times they will be processed. An ingredient is represented by a letter 'a'-'z'. The i-th letter in a recipe denotes the i-th ingredient. An ingredient can be used multiple times in a recipe. Th...
[{"code": "import sys\n\ndef main():\n for (r, s) in testcases():\n if pseudo_granama(r, s):\n print \"NO\"\n else:\n print \"YES\"\n\ndef testcases(cin = sys.stdin):\n nc = int(cin.next())\n for _ in xrange(nc):\n r, s = cin.next().split()\n yield (r, s)\n\ndef pseudo_granama(r, s):\n r, s = ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00087-of-00128_2__public__0000", "expected_output": {"kind": "stdout", "value": "YES\nNO\nYES\n"}, "input": {"kind": "stdin", "value": "3\nalex axle\nparadise diapers\nalice bob"}, "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-00087-of-00128_3
Chef has gone shopping with his 5-year old son. They have bought N items so far. The items are numbered from 1 to N, and the item i weighs Wi grams. Chef's son insists on helping his father in carrying the items. He wants his dad to give him a few items. Chef does not want to burden his son. But he won't stop bothering...
[{"code": "t = int(raw_input())\nwhile t:\n N,K = map(int,raw_input().split())\n L = [int(i) for i in raw_input().split()]; L.sort()\n m = max(K,N-K); print sum(L[-m:]) - sum(L[:-m])\n t-=1", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_tr...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00087-of-00128_3__public__0000", "expected_output": {"kind": "stdout", "value": "17\n2\n"}, "input": {"kind": "stdin", "value": "2\n5 2\n8 4 5 2 10\n8 3\n1 1 1 1 1 1 1 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-00087-of-00128_77
Count the pairs of length-N sequences consisting of integers between 1 and M (inclusive), A_1, A_2, \cdots, A_{N} and B_1, B_2, \cdots, B_{N}, that satisfy all of the following conditions: * A_i \neq B_i, for every i such that 1\leq i\leq N. * A_i \neq A_j and B_i \neq B_j, for every (i, j) such that 1\leq i < j\leq N...
[{"code": "'''\n完全順列(derangement)\nモンモール数(Montmort number)\n'''\n\nMOD = 10**9+7\nN, M = map(int, input().split())\n\n# 片方の順列の総数を求める\nans = 1\nfor i in range(N):\n ans *= M-i\n ans %= MOD\n\n# M枚からN枚選ぶ完全順列を計算\nd = [1, M-N]\nfor i in range(2, N+1):\n # 1がk番目にある\n # 1番目にkがある\n t = (i-1)*d[-2] % MOD\n # ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00087-of-00128_77__public__0000", "expected_output": {"kind": "stdout", "value": "881613484"}, "input": {"kind": "stdin", "value": "141421 356237"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00087-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-00087-of-00128_78
Takahashi has a string S consisting of lowercase English letters. Starting with this string, he will produce a new one in the procedure given as follows. The procedure consists of Q operations. In Operation i (1 \leq i \leq Q), an integer T_i is provided, which means the following: * If T_i = 1: reverse the string S...
[{"code": "\nimport java.io.PrintWriter;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.LinkedList;\nimport java.util.Scanner;\n\npublic class Main {\n void run() {\n Scanner sc = new Scanner(System.in);\n LinkedList<Character> l = new LinkedList<>();\n boolean isR = ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00087-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "xy"}, "input": {"kind": "stdin", "value": "y\n1\n2 1 x"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00087-of-00128_7...
{"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-00087-of-00128_83
On some day in January 2018, Takaki is writing a document. The document has a column where the current date is written in `yyyy/mm/dd` format. For example, January 23, 2018 should be written as `2018/01/23`. After finishing the document, she noticed that she had mistakenly wrote `2017` at the beginning of the date col...
[{"code": "#include<iostream>\nusing namespace std;\n\nint main(){\n string s;\n cin>>s;\n cout<<\"2018/01/\"<<s[8]<<s[9];\n}", "is_known_correct": true, "language": "cpp", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00087-of-00128_83__ref__0000", "source": "benchmark"}, {"code": ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00087-of-00128_83__public__0000", "expected_output": {"kind": "stdout", "value": "2018/01/07"}, "input": {"kind": "stdin", "value": "2017/01/07"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00087-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-00087-of-00128_84
You are given a three-digit positive integer N. Determine whether N is a palindromic number. Here, a palindromic number is an integer that reads the same backward as forward in decimal notation. Constraints * 100≤N≤999 * N is an integer. Input Input is given from Standard Input in the following format: N Output...
[{"code": "N = input()\n\nprint('Yes' if N == N[-1::-1] else 'No')", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00087-of-00128_84__ref__0000", "source": "benchmark"}, {"code": "#include <iostream>\nusing namespace std;\n\nint main(){\n...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00087-of-00128_84__public__0000", "expected_output": {"kind": "stdout", "value": "No"}, "input": {"kind": "stdin", "value": "812"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00087-of-00128_84__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-00088-of-00128_0
Problem Statement Past In the year of 2048, the Virtual Reality Massively Multiplayer Online Role-Playing Game (VRMMORPG), Code Art Online (CAO), is released. With the Chef Gear, a virtual reality helmet that stimulates the user's five senses via their brain, players can experience and control their in-game characters ...
[{"code": "for _ in xrange(input()):\n r,c = map(int,raw_input().split())\n a = [list(raw_input()) for _ in range(r)]\n tot = 0\n for i in range(r):\n for j in range(c):\n if a[i][j] != '^':\n continue\n L = 0\n for k in range(i-1,-1,-1):\n ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00088-of-00128_0__public__0000", "expected_output": {"kind": "stdout", "value": "0\n1\n"}, "input": {"kind": "stdin", "value": "2\n5 5\n^^^^^\n^^^^^\n^^^^#\n^^^^^\n^^^^^\n5 7\n^^#^^^^\n^^#^#^#\n#^^^^^^\n^^#^^#^\n^^^^^^^"}, "metadata": {}, "visibility": "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
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00088-of-00128_2
The Gray code (see wikipedia for more details) is a well-known concept. One of its important properties is that every two adjacent numbers have exactly one different digit in their binary representation. In this problem, we will give you n non-negative integers in a sequence A[1..n] (0<=A[i]<2^64), such that every tw...
[{"code": "import sys\n\ndef main():\n s = sys.stdin.readline\n n = int(s())\n if n>=135:\n print \"Yes\"\n return\n nums = map(int, s().split())\n for i in xrange(n):\n for j in xrange(i+1,n):\n for k in xrange(j+1,n):\n for l in xrange(k+1, n):\n ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00088-of-00128_2__public__0000", "expected_output": {"kind": "stdout", "value": "Yes"}, "input": {"kind": "stdin", "value": "5\n1 0 2 3 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-00088-of-00128_4
Chef likes trees a lot. Today he has an infinte full binary tree (each node has exactly two childs) with special properties. Chef's tree has the following special properties : Each node of the tree is either colored red or black. Root of the tree is black intially. Both childs of a red colored node are black and both ...
[{"code": "Q = int(raw_input())\nflag = False\nwhile Q != 0:\n s = raw_input()\n s = s.split()\n q = s[0]\n if q != 'Qi':\n x = int(s[1])\n y = int(s[2])\n n = 0\n start = 'b'\n while True:\n if x > y:\n x /= 2\n n += 1\n ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00088-of-00128_4__public__0000", "expected_output": {"kind": "stdout", "value": "2\n1\n1\n2\n"}, "input": {"kind": "stdin", "value": "5\nQb 4 5\nQr 4 5\nQi\nQb 4 5\nQr 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-00088-of-00128_5
A tourist is visiting Byteland. The tourist knows English very well. The language of Byteland is rather different from English. To be exact it differs in following points: Bytelandian alphabet has the same letters as English one, but possibly different in meaning. Like 'A' in Bytelandian may be 'M' in English. However...
[{"code": "# cook your code here\nimport string\n\ntestcases, KEY = map(str, raw_input().split())\nKEYUP = string.swapcase(KEY)\nDic = {'_':' '}\nLower = string.ascii_lowercase\nUpper = string.ascii_uppercase\nfor i in xrange(len(KEY)) :\n Dic[Lower[i]] = KEY[i]\n Dic[Upper[i]] = KEYUP[i]\n#print Dic\n\nfor teste...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00088-of-00128_5__public__0000", "expected_output": {"kind": "stdout", "value": "Hi\nHello\nWhat are these people doing?\nThey are solving TOTR in Codechef March long contest.\nOhh!\n"}, "input": {"kind": "stdin", "value": "5 qwertyuiopasdfghjklzxcvbnm\nPh\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
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00088-of-00128_77
There are N piles of stones. The i-th pile has A_i stones. Aoki and Takahashi are about to use them to play the following game: * Starting with Aoki, the two players alternately do the following operation: * Operation: Choose one pile of stones, and remove one or more stones from it. * When a player is unable to do t...
[{"code": "#include <bits/stdc++.h>\n#define int long long\n#define rep(i, n) for(int i = 0; i < (int)(n); i++)\n#define all(x) (x).begin(),(x).end()\n#define pb push_back\n#define F first\n#define S second\n\nusing namespace std;\ntypedef pair<int,int> P;\ntypedef vector<int> ivec;\n\nconst int MOD=1000000007;\nint IN...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00088-of-00128_77__public__0000", "expected_output": {"kind": "stdout", "value": "-1"}, "input": {"kind": "stdin", "value": "2\n3 5"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00088-of-00128_77__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-00088-of-00128_78
Takahashi has a string S of length N consisting of digits from `0` through `9`. He loves the prime number P. He wants to know how many non-empty (contiguous) substrings of S - there are N \times (N + 1) / 2 of them - are divisible by P when regarded as integers written in base ten. Here substrings starting with a `0`...
[{"code": "n,m=map(int,input().split());s=input();l=[0]*m;a,t,p=0,0,1\nif 10%m:\n for i in s[::-1]:l[t%m]+=1;t+=int(i)*p;a+=l[t%m];p=p*10%m\nelse:a=sum(i+1 for i in range(n) if int(s[i])%m<1)\nprint(a)", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_t...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00088-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "6"}, "input": {"kind": "stdin", "value": "4 3\n3543"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00088-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-00088-of-00128_82
There is an integer sequence of length 2^N: A_0, A_1, ..., A_{2^N-1}. (Note that the sequence is 0-indexed.) For every integer K satisfying 1 \leq K \leq 2^N-1, solve the following problem: * Let i and j be integers. Find the maximum value of A_i + A_j where 0 \leq i < j \leq 2^N-1 and (i or j) \leq K. Here, or denot...
[{"code": "#include<bits/stdc++.h>\nusing namespace std;\ntypedef long long ll;\n#define pb push_back\n#define fi first\n#define se second\ntypedef pair<ll,ll> P;\nusing VP = vector<P>; using VVP = vector<VP>;\nusing VI = vector<int>; using VVI = vector<VI>; using VVVI = vector<VVI>;\nconst int inf=1e9+7;\nconst ll INF...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00088-of-00128_82__public__0000", "expected_output": {"kind": "stdout", "value": "3\n4\n5"}, "input": {"kind": "stdin", "value": "2\n1 2 3 1"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00088-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-00088-of-00128_83
An X-layered kagami mochi (X ≥ 1) is a pile of X round mochi (rice cake) stacked vertically where each mochi (except the bottom one) has a smaller diameter than that of the mochi directly below it. For example, if you stack three mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, you have...
[{"code": "#include <bits/stdc++.h>\n\nusing namespace std;\n\nint main(){\n\tint n, x;\n\tset<int> him;\n\tcin >> n;\n\tfor (int i = 0; i < n; i++){\n\t\tcin >> x;\n\t\thim.insert(x);\n\t}\n\tcout << (int) him.size() << \"\\n\";\n}", "is_known_correct": true, "language": "cpp", "metadata": {}, "solution_id": "codecont...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00088-of-00128_83__public__0000", "expected_output": {"kind": "stdout", "value": "4"}, "input": {"kind": "stdin", "value": "7\n50\n30\n50\n100\n50\n80\n30"}, "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-00088-of-00128_84
Alice and Bob are controlling a robot. They each have one switch that controls the robot. Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up. Bob started holding down his button C second after the start-up, and released his button D second...
[{"code": "a,b,c,d=map(int,input().split())\nprint(max(0,min(d,b)-max(a,c)))", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00088-of-00128_84__ref__0000", "source": "benchmark"}, {"code": "#include<bits/stdc++.h>\nusing namespace std;\ni...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00088-of-00128_84__public__0000", "expected_output": {"kind": "stdout", "value": "60"}, "input": {"kind": "stdin", "value": "10 90 20 80"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00088-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-00089-of-00128_0
Chef loves to prepare delicious dishes. This time, Chef has decided to prepare a special dish for you, and needs to gather several apples to do so. Chef has N apple trees in his home garden. Each tree has a certain (non-zero) number of apples on it. In order to create his dish, Chef wants to pluck every apple from ever...
[{"code": "t=int(raw_input())\nfor asd in range(t):\n\tn=int(raw_input())\n\ta=map(int,raw_input().split())\n\ta=sorted(a)\n\tc=1\n\tfor i in range(1,n):\n\t\tif a[i]!=a[i-1]:\n\t\t\tc+=1\n\tprint c", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00089-of-00128_0__public__0000", "expected_output": {"kind": "stdout", "value": "1\n3\n"}, "input": {"kind": "stdin", "value": "2\n3\n3 3 3\n4\n1 2 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-00089-of-00128_3
You are given two integer arrays A and B each of size N. Let us define interaction of arrays A and B to be the sum of A[i] * B[i] for each i from 1 to N. You want to maximize the value of interaction of the arrays. You are allowed to make at most K (possibly zero) operations of following kind. In a single operation,...
[{"code": "# /cc/2016/March/Long/MAXISUM\n\nfor tc in xrange(input()):\n\tn_nums, n_ops = map(long, raw_input().strip().split())\n\tnums1 = map(long, raw_input().strip().split())\n\tnums2 = map(long, raw_input().strip().split())\n\tprint sum(num1 * num2 for num1, num2 in zip(nums1, nums2)) + (n_ops * max(map(abs, nums2...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00089-of-00128_3__public__0000", "expected_output": {"kind": "stdout", "value": "10\n44\n"}, "input": {"kind": "stdin", "value": "2\n2 2\n1 2\n-2 3\n3 5\n1 2 -3\n-2 3 -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-00089-of-00128_5
Sridhar was a seasoned traveler. He liked to visit new places. More than all he was a meticulous planner. This time he was planning to visit Europe. He wrote down his travel itinerary like as follows: If he wanted to visit Madrid, Paris, Munich, Warsaw and Kiev in this order, he would write it down like as: Madrid P...
[{"code": "from sys import stdin\nt=input()\nfor i in range(0,t):\n d={}\n src=[]\n dest=[]\n n=input()\n for j in range(0,n-1):\n b = stdin.readline().split()\n d[b[0]]=b[1]+\"%\"+b[2]\n dest.append(b[1])\n\n tmp=list(set(d)-set(dest)) \n s=tmp[0]\n cost=0\n for j in ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00089-of-00128_5__public__0000", "expected_output": {"kind": "stdout", "value": "Madrid Paris 100$\nParis Munich 200$\nMunich Warsaw 150$\nWarsaw Kiev 120$\n570$\n"}, "input": {"kind": "stdin", "value": "1\n5\nWarsaw Kiev 120$\nMadrid Paris 100$\nMunich Wars...
{"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-00089-of-00128_74
As you all know, Sansa is trying to escape from the Boltons' specially from Ramsey! Winterfell is divided in an straight line of ice. In the line, each block has some thickness value. Ramsey would catch Sansa and Theon in an interval of ice if the XOR of all thickness of ice in that interval is greater than some valu...
[{"code": "n=int(raw_input())\na=list(map(int,raw_input().split()))\nxor=[0]*n\nxor[0]=a[0]\nfor i in range(1,n):\n\txor[i]=a[i]^xor[i-1]\n#print(xor)\nfor i in range(int(raw_input())):\n\tx,y=map(int,raw_input().split())\n\tprint( xor[x-1]^xor[y] if (x!=0) else xor[y])", "is_known_correct": true, "language": "python",...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00089-of-00128_74__public__0000", "expected_output": {"kind": "stdout", "value": "2\n0"}, "input": {"kind": "stdin", "value": "10\n1 2 3 4 5 6 24 8 9 10\n2\n2 4\n0 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-00089-of-00128_77
An uppercase or lowercase English letter \alpha will be given as input. If \alpha is uppercase, print `A`; if it is lowercase, print `a`. Constraints * \alpha is an uppercase (`A` - `Z`) or lowercase (`a` - `z`) English letter. Input Input is given from Standard Input in the following format: α Output If \alph...
[{"code": "import java.util.Scanner;\n\nclass Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString alpha = sc.next();\n\t\tString regex = \"[A-Z]\";\n\t\tif(alpha.matches(regex)){\n\t\t\tSystem.out.println(\"A\");\n\t\t}else {\n\t\t\tSystem.out.println(\"a\");\n\t\t}\...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00089-of-00128_77__public__0000", "expected_output": {"kind": "stdout", "value": "a"}, "input": {"kind": "stdin", "value": "a"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00089-of-00128_77__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-00089-of-00128_78
There are N robots numbered 1 to N placed on a number line. Robot i is placed at coordinate X_i. When activated, it will travel the distance of D_i in the positive direction, and then it will be removed from the number line. All the robots move at the same speed, and their sizes are ignorable. Takahashi, who is a misc...
[{"code": "#include<bits/stdc++.h>\n#define STDIO\nusing namespace std;\nstack<pair<int,int> > stk;\nint MOD=998244353;\nint n;\npair<int,int> robo[200100];\nint dp[200100];\nint main(){\n\t#ifndef STDIO\n\t\tfreopen(\"input.in\",\"r\",stdin);\n\t\tfreopen(\"output.out\",\"w\",stdout);\n\t#endif\n\tios::sync_with_stdio...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00089-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "3"}, "input": {"kind": "stdin", "value": "2\n1 5\n3 3"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00089-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-00089-of-00128_84
We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? Constraints * 1≤...
[{"code": "import java.util.*;\n\npublic class Main {\n\n static final int MOD = 1000000007;\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long t[]= new long[n];\n for(int i=0;i<n;i++)t[i]=sc.nextLong();\n for(int...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00089-of-00128_84__public__0000", "expected_output": {"kind": "stdout", "value": "1000000000000000000"}, "input": {"kind": "stdin", "value": "5\n2\n5\n10\n1000000000000000000\n1000000000000000000"}, "metadata": {}, "visibility": "public"}, {"case_id": "codec...
{"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-00090-of-00128_0
Most problems on CodeChef highlight chef's love for food and cooking but little is known about his love for racing sports. He is an avid Formula 1 fan. He went to watch this year's Indian Grand Prix at New Delhi. He noticed that one segment of the circuit was a long straight road. It was impossible for a car to overtak...
[{"code": "# cook your code here\nfor testcases in xrange(int(raw_input() ) ) :\n n = int(raw_input())\n Arr = map(int, raw_input().split() )\n m = Arr[0]\n c = 1\n for i in xrange(1, len(Arr)):\n if (Arr[i] <= m ):\n c += 1\n m = Arr[i]\n print c", "is_known_correct": tru...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00090-of-00128_0__public__0000", "expected_output": {"kind": "stdout", "value": "1\n2\n2\n"}, "input": {"kind": "stdin", "value": "3\n1\n10\n3\n8 3 6\n5\n4 5 1 2 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-00090-of-00128_2
Sherlock is stuck. There is a N X N grid in which some cells are empty (denoted by ‘.’), while some cells have rocks in them (denoted by ‘#’). Sherlock is on the South of the grid. He has to watch what is happening on the East of the grid. He can place a mirror at 45 degrees on an empty cell in the grid, so that he'll ...
[{"code": "def proc(a):\n n=len(a)\n j=n-1\n l=0\n ans=0\n hsh=[True]*n\n for j in range(n-1,-1,-1):\n i=n-1\n flag=True\n while i>=0:\n if a[i][j]=='#':\n hsh[i]=False\n flag=False\n elif hsh[i] and flag: ans+=1\n i-=...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00090-of-00128_2__public__0000", "expected_output": {"kind": "stdout", "value": "6\n0\n"}, "input": {"kind": "stdin", "value": "2\n3\n#..\n#..\n#..\n3\n#.#\n#.#\n#.#"}, "metadata": {}, "visibility": "public"}]
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00090-of-00128_3
A new school in Byteland is now in the process of renewing some classrooms with new, stronger and better chairs, so that the students can stay still and pay attention to class :) However, due to budget and logistic reasons, it's only possible to carry a chair at a time to the classroom, which means that for a long time...
[{"code": "t=input()\nwhile t>0:\n n=input()\n print pow(2,n,1000000007)-1\n t-=1", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00090-of-00128_3__ref__0000", "source": "benchmark"}, {"code": "t=int(raw_input())\nmod=10**9+7\nwh...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00090-of-00128_3__public__0000", "expected_output": {"kind": "stdout", "value": "1\n3\n"}, "input": {"kind": "stdin", "value": "2\n1\n2"}, "metadata": {}, "visibility": "public"}]
{"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": null, "eval_mode": "stdin_stdout", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null}
CodeContests
CODECHEF
[]
null
codecontests__test__code_contests_train.riegeli-00090-of-00128_5
Given a complete binary tree with the height of H, we index the nodes respectively top-down and left-right from 1. The i-th node stores a positive integer Vi. Define Pi as follows: Pii if the i-th node is a leaf, otherwise Pii*PL, Vi*PR), where L and R are the indices of the left and right children of i, respectively. ...
[{"code": "# tree product - trproduct.py\n\ntry:\n import psyco\n psyco.full()\nexcept ImportError:\n pass \n\n\nmod = 1000000007\nh = int(raw_input())\nwhile h>0:\n v = map(int, raw_input().split())\n\n if h>1:\n level = 1<<(h-2)\n while level>=1:\n for i in xrange(level-1,...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00090-of-00128_5__public__0000", "expected_output": {"kind": "stdout", "value": "3\n105\n"}, "input": {"kind": "stdin", "value": "2\n1 2 3\n3\n3 1 5 2 6 4 7\n0"}, "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-00090-of-00128_74
What if we Unite against the Difference between ourselves ? Welcome into the Brother-Hood town. Citizens of Brother-Hood town are feeling very happy that you came for their help. But what is the problem they have ? There is one very crucial problem in the town now. Years ago people of town were living together , and w...
[{"code": "n = int(input())\ne = [0]*501\nfor i in range(n):\n\tm = int(input())\n\ta = map(int,raw_input().split())\n\tf = [0]*501\n\tfor j in a:\n\t\tf[j] = 1\n\tfor j in range(501):\n\t\te[j]+=f[j]\nans = 0\nfor i in range(501):\n\tif e[i]==n: ans-=i\nprint ans", "is_known_correct": true, "language": "python", "meta...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00090-of-00128_74__public__0000", "expected_output": {"kind": "stdout", "value": "-1\n"}, "input": {"kind": "stdin", "value": "3\n5\n1 1 2 3 7\n5\n3 5 2 1 6\n5\n1 5 7 8 9\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-00090-of-00128_77
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits. Constraints * 1 \leq K \leq N \leq 1000 * 1 \leq...
[{"code": "import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = Integer.parseInt(sc.next());\n\t\tint k = Integer.parseInt(sc.next());\n\n\t\tint[] array = new int[n];\n\t\tfor (int i = 0; i < n;...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00090-of-00128_77__public__0000", "expected_output": {"kind": "stdout", "value": "1000"}, "input": {"kind": "stdin", "value": "1 1\n1000"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00090-of-00128_7...
{"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-00090-of-00128_78
Takahashi wants to print a document with N pages double-sided, where two pages of data can be printed on one sheet of paper. At least how many sheets of paper does he need? Constraints * N is an integer. * 1 \leq N \leq 100 Input Input is given from Standard Input in the following format: N Output Print the a...
[{"code": "import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n Double N = sc.nextDouble();\n\n int ans = (int) Math.ceil(N/2);\n\n System.out.println(ans);\n\n\n }\n}\n", "is_known_correct": true, "language": "j...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00090-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "3"}, "input": {"kind": "stdin", "value": "5"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00090-of-00128_78__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-00090-of-00128_80
We have A apples and P pieces of apple. We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan. Find the maximum number of apple pies we can make with what we have now. Constraints * All values in input are integers. * 0 \leq A, P \leq 100 Input Input is g...
[{"code": "import java.util.Scanner;\n \nclass Main {\n public static void main(String args[]){\n\tScanner sc = new Scanner(System.in);\n\tint a,p,maxap;\n \n\ta = sc.nextInt();\n\tp = sc.nextInt();\n \n\tmaxap = (3*a + p) /2;\n \n\tSystem.out.println(maxap);\n }\n}", "is_known_correct": true, "language": "java",...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00090-of-00128_80__public__0000", "expected_output": {"kind": "stdout", "value": "3"}, "input": {"kind": "stdin", "value": "1 3"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00090-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-00090-of-00128_82
There is always an integer in Takahashi's mind. Initially, the integer in Takahashi's mind is 0. Takahashi is now going to eat four symbols, each of which is `+` or `-`. When he eats `+`, the integer in his mind increases by 1; when he eats `-`, the integer in his mind decreases by 1. The symbols Takahashi is going t...
[{"code": "#include<bits/stdc++.h>\nusing namespace std;\nint main(){\n char s[5];\n cin >> s;\n int o=0;\n for(int i=0;i<4;i++){\n if(s[i]=='-')----o;\n o++;\n }\n cout << o;\n}\n", "is_known_correct": true, "language": "cpp", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00090-of-00128_82__public__0000", "expected_output": {"kind": "stdout", "value": "2"}, "input": {"kind": "stdin", "value": "+-++"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00090-of-00128_82__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-00090-of-00128_83
You are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and can perform the following two kinds of attacks in any order: * Wield one of the katana you have. When you wield Katana i (1 ≤ i ≤ N), the monster receives a_i points of dam...
[{"code": "#include<bits/stdc++.h>\nusing namespace std;\nint main(){\n int n,h;\n cin>>n>>h;\n int a[n],b[n];\n int normal=0;//通常攻撃の最大値\n for(int i=0;i<n;i++){\n cin>>a[i]>>b[i];\n normal=max(normal,a[i]);\n }\n sort(b,b+n,greater<int>());\n int x=0;\n while(x<n && b[x]>normal ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00090-of-00128_83__public__0000", "expected_output": {"kind": "stdout", "value": "860000004"}, "input": {"kind": "stdin", "value": "4 1000000000\n1 1\n1 10000000\n1 30000000\n1 99999999"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__t...
{"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-00090-of-00128_84
You are given a tree with N vertices. Here, a tree is a kind of graph, and more specifically, a connected undirected graph with N-1 edges, where N is the number of its vertices. The i-th edge (1≤i≤N-1) connects Vertices a_i and b_i, and has a length of c_i. You are also given Q queries and an integer K. In the j-th qu...
[{"code": "import java.io.*;\nimport java.util.*;\n\nclass Main {\n static class Pair {\n int to;\n long w;\n Pair(int t, long wt) {\n to = t;\n w = wt;\n }\n }\n static long[] depth;\n static ArrayList<Pair>[] v;\n static boolean[] visited;\n public s...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00090-of-00128_84__public__0000", "expected_output": {"kind": "stdout", "value": "3\n2\n4"}, "input": {"kind": "stdin", "value": "5\n1 2 1\n1 3 1\n2 4 1\n3 5 1\n3 1\n2 4\n2 3\n4 5"}, "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-00091-of-00128_77
1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\...
[{"code": "n = int(input())\ns = ''\nwhile n > 0:\n n -= 1\n s = chr(ord('a') + n % 26) + s\n n //= 26\nprint(s)", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00091-of-00128_77__ref__0000", "source": "benchmark"}, {"code": "N,a...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00091-of-00128_77__public__0000", "expected_output": {"kind": "stdout", "value": "aa"}, "input": {"kind": "stdin", "value": "27"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00091-of-00128_77__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-00091-of-00128_78
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
[{"code": "import java.util.ArrayList;\nimport java.util.List;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String... args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint[] a = new int[9];\n\t\tfor (int i = 0; i < 9; i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t}\n\t\tint n = scan.n...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00091-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "Yes"}, "input": {"kind": "stdin", "value": "60 88 34\n92 41 43\n65 73 48\n10\n60\n43\n88\n11\n48\n73\n65\n41\n92\n34"}, "metadata": {}, "visibility": "public"}, {"case_id": "co...
{"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-00091-of-00128_80
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
[{"code": "n = int(input())\n\nSP = []\nfor i in range(n):\n s,p = input().split()\n SP.append((s,-int(p),i+1))\n\nSP.sort()\n\nfor s,p,i in SP:\n print(i)", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00091-of-00128_80__ref__0...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00091-of-00128_80__public__0000", "expected_output": {"kind": "stdout", "value": "3\n4\n6\n1\n5\n2"}, "input": {"kind": "stdin", "value": "6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40"}, "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
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00091-of-00128_83
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output...
[{"code": "l = int(raw_input())\nprint 48 - l\n", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00091-of-00128_83__ref__0000", "source": "benchmark"}, {"code": "import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(S...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00091-of-00128_83__public__0000", "expected_output": {"kind": "stdout", "value": "36"}, "input": {"kind": "stdin", "value": "12"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00091-of-00128_83__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-00091-of-00128_84
The word `internationalization` is sometimes abbreviated to `i18n`. This comes from the fact that there are 18 letters between the first `i` and the last `n`. You are given a string s of length at least 3 consisting of lowercase English letters. Abbreviate s in the same way. Constraints * 3 ≤ |s| ≤ 100 (|s| denotes ...
[{"code": "import java.util.*;\nclass Main{\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString str = sc.next();\n\t\tSystem.out.println(str.charAt(0)+\"\"+(str.length()-2)+str.charAt(str.length()-1));\n\t}\n}", "is_known_correct": true, "language": "java", "metadata": {}, ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00091-of-00128_84__public__0000", "expected_output": {"kind": "stdout", "value": "s4s"}, "input": {"kind": "stdin", "value": "smiles"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00091-of-00128_84__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-00091-of-00128_86
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he migh...
[{"code": "import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint result = 0;\n\t\tint a = sc.nextInt(),b = sc.nextInt(),c = sc.nextInt();\n\t\tif(a != b) result++;\n\t\tif(a != c) result++;\n\t\tif(b != c) result++;\n\t\tif(a ==...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00091-of-00128_86__public__0000", "expected_output": {"kind": "stdout", "value": "3"}, "input": {"kind": "stdin", "value": "3 1 4"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00091-of-00128_86__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-00092-of-00128_2
Alice and Bob, both have to drink water. But they both don't want to go, so they will play a game to decide who will fetch water for both of them. Alice will choose a number randomly between 1 and N (both inclusive) and Bob will choose a number randomly between 1 and M (both inclusive). Both will write their numbers on...
[{"code": "import fractions as fs\nN = input()\nA = []\nfor i in range(N):\n\tt = raw_input().split()\n\tt2=[]\n\tt2.append(int(t[0]))\n\tt2.append(int(t[1]))\n\tA.append(t2)\n\t\ndef getOdd(n,m):\n\tif (n*m)&1 :\n\t\treturn n*m/2\n\telse:\n\t\treturn ((n*m-1)/2)+1\n\t\t\ndef solve(x):\n\tn = x[0]\n\tm = x[1]\n\todd = ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00092-of-00128_2__public__0000", "expected_output": {"kind": "stdout", "value": "0/1\n1/2\n1/2\n"}, "input": {"kind": "stdin", "value": "3\n1 1\n1 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-00092-of-00128_5
Chef likes to travel very much. He plans some travel routes and wants to know their lengths. He hired you to make these calculations. But be careful, some of the routes are incorrect. There may be some misspelling in city names or there will be no road between some two consecutive cities in the route. Also note that Ch...
[{"code": "def main():\n #read no of cities\n n = input()\n #read cities\n city = raw_input().split()\n #read no of routes\n m = input()\n mapp = {}\n #zero out map of routes\n for c in city:\n mapp[c] = [0]*n\n #populate map with available routes by index\n while m:\n m -...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00092-of-00128_5__public__0000", "expected_output": {"kind": "stdout", "value": "9859\nERROR\nERROR\nERROR\n1768\n1764\n3500\nERROR\nERROR\n0\nERROR\nERROR\nERROR"}, "input": {"kind": "stdin", "value": "5\nDonetsk Kiev New-York Miami Hollywood\n9\nDonetsk Ki...
{"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-00092-of-00128_77
You have a sequence A composed of N positive integers: A_{1}, A_{2}, \cdots, A_{N}. You will now successively do the following Q operations: * In the i-th operation, you replace every element whose value is B_{i} with C_{i}. For each i (1 \leq i \leq Q), find S_{i}: the sum of all elements in A just after the i-th...
[{"code": "import java.util.*;\nimport java.io.*;\n \npublic class Main{\n \n\tpublic static void main(String[] $){\n\t\tScanner s = new Scanner(System.in);\n\t\tint N = s.nextInt();\n\t\tlong sum = 0;\n\t\tlong[] S = new long[100000+1];\n\t\tfor(int i = 0; i < N; i++){\n\t\t\tint A = s.nextInt();\n\t\t\tsum += A;\n...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00092-of-00128_77__public__0000", "expected_output": {"kind": "stdout", "value": "102\n200\n2000"}, "input": {"kind": "stdin", "value": "2\n1 2\n3\n1 100\n2 100\n100 1000"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_conte...
{"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-00092-of-00128_78
If there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print `-1`. * The integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.) * The s_i-th digit from the left is c_i. \left(i ...
[{"code": "#include<bits/stdc++.h>\nusing namespace std;\nint n,m;\nint a[10];\nint main(){\n\tcin>>n>>m;\n\tmemset(a,-1,sizeof a);\n\tint f=1;\n\twhile(m--){\n\t\tint pos,c;\n\t\tcin>>pos>>c;\n\t\tif(a[pos]!=-1&&c!=a[pos]){\n\t\t\tf=0;\n\t\t\tbreak;\n\t\t}\n\t\telse a[pos]=c;\n\t}\n\tif(n==1){\n\t\tif(a[1]==-1)a[1]=0;...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00092-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "-1"}, "input": {"kind": "stdin", "value": "3 1\n1 0"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00092-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-00092-of-00128_80
We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ...
[{"code": "#include<iostream>\nusing namespace std;\nint N_MAX = 10;\nint main()\n{\n int n,nn,m,i,j,kk,t,res=0;\n int k[N_MAX],s[N_MAX][N_MAX],p[N_MAX],ss[N_MAX];\n cin >> n >> m;\n for(i=0;i<m;i++){\n cin >> k[i];\n for(j=0;j<k[i];j++)\n cin >> s[i][j];\n }\n for(i=0;i<m;i++)\n cin >> p[i];\n nn=...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00092-of-00128_80__public__0000", "expected_output": {"kind": "stdout", "value": "1"}, "input": {"kind": "stdin", "value": "2 2\n2 1 2\n1 2\n0 1"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00092-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-00092-of-00128_82
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6. We will call an integer n a Snuke number when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds. Given an integer K, list the K smallest Snuke numbers. Constraints * 1 \leq K...
[{"code": "#include <iostream>\n#include <vector>\n#include <algorithm>\nusing namespace std;\n\nlong long f(long long n) {\n long long res = 0;\n while (n > 0) {\n res += n%10;\n n /= 10;\n }\n return res;\n}\n\ndouble g(long long n) {\n return (double)(n)/f(n);\n}\n\nint main() {\n vector<long long> res;\...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00092-of-00128_82__public__0000", "expected_output": {"kind": "stdout", "value": "1\n2\n3\n4\n5\n6\n7\n8\n9\n19"}, "input": {"kind": "stdin", "value": "10"}, "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
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00092-of-00128_83
The postal code in Atcoder Kingdom is A+B+1 characters long, its (A+1)-th character is a hyphen `-`, and the other characters are digits from `0` through `9`. You are given a string S. Determine whether it follows the postal code format in Atcoder Kingdom. Constraints * 1≤A,B≤5 * |S|=A+B+1 * S consists of `-` and di...
[{"code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\tint a,b,i,j,n,cur=1;\n\tcin >> a >> b;\n\tstring s;\n\tcin >> s;\n\tfor(i=0; i<a+b+1; i++){\n\t\tif((i!=a && s[i]=='-')||(i==a && s[i]!='-')){\n\t\t\tcout << \"No\"; return 0;\n\t\t}\n\t}\n\t\n\tcout << \"Yes\";\n}", "is_known_correct": true, ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00092-of-00128_83__public__0000", "expected_output": {"kind": "stdout", "value": "No"}, "input": {"kind": "stdin", "value": "1 2\n7444"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00092-of-00128_83_...
{"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-00092-of-00128_84
We have a sequence of length N, a = (a_1, a_2, ..., a_N). Each a_i is a positive integer. Snuke's objective is to permute the element in a so that the following condition is satisfied: * For each 1 ≤ i ≤ N - 1, the product of a_i and a_{i + 1} is a multiple of 4. Determine whether Snuke can achieve his objective. ...
[{"code": "N=int(input())\na=list(map(int,input().split()))\nodd=0\nm2=0\nm4=0\nfor n in a:\n if n%2==1:\n odd+=1\n elif n%4!=0:\n m2+=1\n else:\n m4+=1\nif m4>=odd or (m2==0 and m4>=odd-1):\n print('Yes')\nelse:\n print('No')\n", "is_known_correct": true, "language": "python", "meta...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00092-of-00128_84__public__0000", "expected_output": {"kind": "stdout", "value": "Yes"}, "input": {"kind": "stdin", "value": "6\n2 7 1 8 2 8"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00092-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-00092-of-00128_86
There are N balls placed in a row. AtCoDeer the deer is painting each of these in one of the K colors of his paint cans. For aesthetic reasons, any two adjacent balls must be painted in different colors. Find the number of the possible ways to paint the balls. Constraints * 1≦N≦1000 * 2≦K≦1000 * The correct answer i...
[{"code": "a, b = [int(i) for i in input().split()]\n\nprint(b * (b-1) ** (a - 1))", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00092-of-00128_86__ref__0000", "source": "benchmark"}, {"code": "input_line = map(int,raw_input().split(\"...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00092-of-00128_86__public__0000", "expected_output": {"kind": "stdout", "value": "2"}, "input": {"kind": "stdin", "value": "2 2"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00092-of-00128_86__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-00093-of-00128_3
Everybody loves magic, especially magicians who compete for glory on the Byteland Magic Tournament. Magician Cyael is one such magician. Cyael has been having some issues with her last performances and today she’ll have to perform for an audience of some judges, who will change her tournament ranking, possibly increasi...
[{"code": "from sys import stdin\n\nfor trial in xrange(int(stdin.readline())):\n N = int(stdin.readline())\n S = [map(int,stdin.readline().split()) for i in range(N)]\n dp = [[0 for i in xrange(N)] for j in xrange(N)]\n for i in xrange(1,N): dp[i][0] = dp[i-1][0]+S[i][0]\n for i in xrange(1,N): dp[0][i]...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00093-of-00128_3__public__0000", "expected_output": {"kind": "stdout", "value": "8.000000\nBad Judges\n"}, "input": {"kind": "stdin", "value": "2\n2\n0 -4\n8 0\n2\n0 -45\n-3 0"}, "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-00093-of-00128_4
The chef has a recipe he wishes to use for his guests, but the recipe will make far more food than he can serve to the guests. The chef therefore would like to make a reduced version of the recipe which has the same ratios of ingredients, but makes less food. The chef, however, does not like fractions. The original rec...
[{"code": "from fractions import gcd as g\n\ndef gcdN(l):\n\tl.sort()\n\ttemp=l[0]\n\tfor i in l[1:]:\n\t\ttemp=g(temp,i)\n\treturn temp\n\n# print gcdN([12,6,3,4,2])\nfor testcases in xrange(int(raw_input())):\n\ttemp=map(int,raw_input().split())\n\tn=gcdN(temp[1:])\n\tfor i in temp[1:]:\n\t\tprint (i/n),\n\tprint ''"...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00093-of-00128_4__public__0000", "expected_output": {"kind": "stdout", "value": "1 1\n2 3 4\n1 5 3 2\n"}, "input": {"kind": "stdin", "value": "3\n2 4 4\n3 2 3 4\n4 3 15 9 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-00093-of-00128_5
Let's define a good tree: It is a tree with k * n nodes labeled from 0 to k * n - 1 Node i and node j are not adjacent, for all 0 <= i, j < k * n such that i div k = j div k (here div means integer division. E.g. 7 div 2 = 3) Given n and k, how many different good trees are there? Input Two integers n(1 <= n <= 10...
[{"code": "# a dive into the deep, a lot of concepts here\n# Kirchoff's Matrix Tree Theorem, Laplacian matrix, cofactors, a revision into \n# determinants\n# Revision: replacing a row by itself minus a multiple of another row: \n#\t\t\tdoesn't change determinant\n\n\n# k=3, A = \n# 0,0,0,1,1,1,1,1,1.......1\n# 0,0,0,1,...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00093-of-00128_5__public__0000", "expected_output": {"kind": "stdout", "value": "0\n"}, "input": {"kind": "stdin", "value": "1 2"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00093-of-00128_5__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-00093-of-00128_76
After Governor's attack on prison, Rick found himself surrounded by walkers. They are coming towards him from all sides. Now, suppose Rick have infinite number of bullets with him. Suppose Rick need 1 bullet to kill each walker (yeah he is good in killing walkers. They need to be shot at head. See, how good he is). Now...
[{"code": "T = int(raw_input());\nwhile T > 0:\n T = T-1;\n N = int(raw_input());\n arr = raw_input().split(' ');\n A = map(int, arr);\n A.sort();\n index = 0;\n minute = 1;\n myR = 1;\n while index < N:\n if minute > A[index]:\n print 'Goodbye Rick';\n print inde...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00093-of-00128_76__public__0000", "expected_output": {"kind": "stdout", "value": "Rick now go and save Carl and Judas\nGoodbye Rick\n2\n"}, "input": {"kind": "stdin", "value": "2\n5\n2 4 2 5 6\n4\n2 2 2 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-00093-of-00128_77
There are N Snuke Cats numbered 1, 2, \ldots, N, where N is even. Each Snuke Cat wears a red scarf, on which his favorite non-negative integer is written. Recently, they learned the operation called xor (exclusive OR). What is xor? For n non-negative integers x_1, x_2, \ldots, x_n, their xor, x_1~\textrm{xor}~x_2~\...
[{"code": "\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] a = new int[n]; //a_max = 10^9\n int XORsum = 0;\n for(int i=0;i<n;i++){\n a[i] = sc.nextInt(...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00093-of-00128_77__public__0000", "expected_output": {"kind": "stdout", "value": "26 5 7 22"}, "input": {"kind": "stdin", "value": "4\n20 11 9 24"}, "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
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00093-of-00128_78
An SNS has N users - User 1, User 2, \cdots, User N. Between these N users, there are some relationships - M friendships and K blockships. For each i = 1, 2, \cdots, M, there is a bidirectional friendship between User A_i and User B_i. For each i = 1, 2, \cdots, K, there is a bidirectional blockship between User C_i...
[{"code": "#include <bits/stdc++.h>\n\nusing namespace std;\n\n#define N 100100\n#define SIGMA 26\n\nvector <int> a[N];\nvector <int> b[N];\nint cnt[N], c[N];\nint x, y, n, m, k, i, nr, curr, j;\nvoid df (int nod, int comp){\n c[nod] = comp;\n ++cnt[comp];\n for (int it = 0; it < a[nod].size(); ++it)\n ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00093-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "0 1 0 1"}, "input": {"kind": "stdin", "value": "4 4 1\n2 1\n1 3\n3 2\n3 4\n4 1"}, "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-00093-of-00128_79
Given is an integer N. Takahashi chooses an integer a from the positive integers not greater than N with equal probability. Find the probability that a is odd. Constraints * 1 \leq N \leq 100 Input Input is given from Standard Input in the following format: N Output Print the probability that a is odd. Your ...
[{"code": "N = input()\nprint \"%.10f\"%((N+1)/2/float(N))\n", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00093-of-00128_79__ref__0000", "source": "benchmark"}, {"code": "n = int(raw_input())\nif n ==1:\n\tprint 1\nelse:\n\tif not n%2:...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00093-of-00128_79__public__0000", "expected_output": {"kind": "stdout", "value": "0.5000000000"}, "input": {"kind": "stdin", "value": "4"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00093-of-00128_7...
{"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-00093-of-00128_80
Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The values of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You can perform at most K operations on...
[{"code": "import java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.InputMismatchException;\nimport java.io.IOException;\nimport java.util.Collections;\nimport java.util.ArrayList;\nimport java.io.InputStream;\n\n/**\n * Built using CHelper pl...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00093-of-00128_80__public__0000", "expected_output": {"kind": "stdout", "value": "14"}, "input": {"kind": "stdin", "value": "6 4\n-10 8 2 1 2 6"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00093-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-00093-of-00128_82
In the State of Takahashi in AtCoderian Federation, there are N cities, numbered 1, 2, ..., N. M bidirectional roads connect these cities. The i-th road connects City A_i and City B_i. Every road connects two distinct cities. Also, for any two cities, there is at most one road that directly connects them. One day, it ...
[{"code": "#define _USE_MATH_DEFINES\n#include <bits/stdc++.h>\nusing namespace std;\n\n//template\n#define rep(i,a,b) for(int i=(a);i<(b);i++)\n#define rrep(i,a,b) for(int i=(a);i>(b);i--)\n#define ALL(v) (v).begin(),(v).end()\ntypedef long long int ll;\nconst int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; c...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00093-of-00128_82__public__0000", "expected_output": {"kind": "stdout", "value": "4"}, "input": {"kind": "stdin", "value": "5 5\n1 2\n1 3\n3 4\n3 5\n4 5"}, "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-00093-of-00128_83
A railroad running from west to east in Atcoder Kingdom is now complete. There are N stations on the railroad, numbered 1 through N from west to east. Tomorrow, the opening ceremony of the railroad will take place. On this railroad, for each integer i such that 1≤i≤N-1, there will be trains that run from Station i t...
[{"code": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main(){\n int N;\n vector<int> C(510), S(510), F(510);\n\n cin >> N;\n for(int i=0; i<N-1; i++) cin >> C[i] >> S[i] >> F[i];\n\n for(int j=0; j<N; j++){\n int t = 0;\n for(int i=j; i<N-1; i++){\n if(t < S[i]){\n t = S[i];\n } els...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00093-of-00128_83__public__0000", "expected_output": {"kind": "stdout", "value": "12\n11\n0"}, "input": {"kind": "stdin", "value": "3\n6 5 1\n1 10 1"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-0009...
{"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-00093-of-00128_85
Snuke loves working out. He is now exercising N times. Before he starts exercising, his power is 1. After he exercises for the i-th time, his power gets multiplied by i. Find Snuke's power after he exercises N times. Since the answer can be extremely large, print the answer modulo 10^{9}+7. Constraints * 1 ≤ N ≤ 10...
[{"code": "a = 1\nfor i in range(1,int(input())+1):\n a = (a*i)%(10**9+7)\nprint(a)\n\n", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00093-of-00128_85__ref__0000", "source": "benchmark"}, {"code": "MOD = 1000000007\nimport math\n\nN...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00093-of-00128_85__public__0000", "expected_output": {"kind": "stdout", "value": "457992974"}, "input": {"kind": "stdin", "value": "100000"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00093-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-00093-of-00128_86
AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c...
[{"code": "n = input()\n\nt, a = 1, 1\n\nfor i in range(n):\n xs = map(int, raw_input().split())\n m = max((t + xs[0] - 1) / xs[0], (a + xs[1] - 1) / xs[1])\n t, a = xs[0] * m, xs[1] * m\n\nprint t + a\n", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00093-of-00128_86__public__0000", "expected_output": {"kind": "stdout", "value": "6930"}, "input": {"kind": "stdin", "value": "5\n3 10\n48 17\n31 199\n231 23\n3 2"}, "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-00094-of-00128_0
Little Churu is a naughty child, who likes to play with balls. He has N buckets. Each bucket contains one or more balls. He has numbered his buckets 1 to N (both inclusive). He has an infinite supply of extra balls, apart from the ones already in the buckets. He wants to add zero or more number of balls to each of the ...
[{"code": "T = int(raw_input())\nn = []\na = []\nm = []\n\nfor t in xrange(T):\n\tn.append(int(raw_input()))\n\ta.append(map(int, raw_input().split()))\n\tm.append(max(a[-1]))\n\nM = max(m)\nl = [False, False] + [True] * (M-1)\n\nfor i in xrange(2,M+1):\n\tif (l[i]):\n\t\tfor j in range(2*i, M+1, i):\n\t\t\tl[j]=False\...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00094-of-00128_0__public__0000", "expected_output": {"kind": "stdout", "value": "3"}, "input": {"kind": "stdin", "value": "1\n3\n11 13 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-00094-of-00128_3
Mike is given a matrix A, N and M are numbers of rows and columns respectively. A1, 1 is the number in the top left corner. All the numbers in A are non-negative integers. He also has L pairs of integers (ik, jk). His task is to calculate Ai1, j1 + Ai2, j2 + ... + AiL, jL. Unfortunately, Mike forgot if Ai, j was a nu...
[{"code": "# codeChef problem Code: MIKE1\nm, n = map(int, raw_input().split() )\nGiven = []\nfor i in xrange( m ) :\n Given.append( map(int, raw_input().split() ) )\nk = int( raw_input() )\nflag1 = flag2 = 0\nE1 = E2 = 0\nfor i in xrange( k ) :\n point = map(int, raw_input().split() )\n if ( flag1 == 1 or poi...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00094-of-00128_3__public__0000", "expected_output": {"kind": "stdout", "value": "9\n"}, "input": {"kind": "stdin", "value": "3 2\n1 2\n4 5\n7 0\n2\n1 2\n2 2"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.rieg...
{"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-00094-of-00128_5
Chef has a binary tree. The binary tree consists of 1 or more nodes. Each node has a unique integer id. Each node has up to 2 children, which are identified by their ids, and each node is the child of at most 1 other node. A node X is considered to be an ancestor of node Y if node Y is a child of node X or if there is ...
[{"code": "t=input()\nfor i in range(t):\n n=input()\n a=0\n b=0\n for j in range(n):\n x,y=map(int,raw_input().split())\n a+=x\n b+=y\n print a-b", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00094-o...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00094-of-00128_5__public__0000", "expected_output": {"kind": "stdout", "value": "4\n6\n"}, "input": {"kind": "stdin", "value": "2\n1\n4 0\n6\n1 5\n2 0\n3 0\n4 0\n5 5\n6 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-00094-of-00128_77
How many strings can be obtained by applying the following operation on a string S exactly K times: "choose one lowercase English letter and insert it somewhere"? The answer can be enormous, so print it modulo (10^9+7). Constraints * K is an integer between 1 and 10^6 (inclusive). * S is a string of length between 1...
[{"code": "import sys,queue,math,copy,itertools,bisect,collections,heapq\n\ndef main():\n MOD = 10**9 + 7\n NI = lambda : int(sys.stdin.readline())\n SI = lambda : sys.stdin.readline().rstrip()\n\n K = NI()\n S = SI()\n LS = len(S)\n\n f = [1] * (K+LS)\n r = [1] * (K+LS)\n c = 1\n for i in...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00094-of-00128_77__public__0000", "expected_output": {"kind": "stdout", "value": "575111451"}, "input": {"kind": "stdin", "value": "5\noof"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00094-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-00094-of-00128_78
You are given a string S of length N consisting of lowercase English letters. Process Q queries of the following two types: * Type 1: change the i_q-th character of S to c_q. (Do nothing if the i_q-th character is already c_q.) * Type 2: answer the number of different characters occurring in the substring of S betwee...
[{"code": "import java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.io.PrintWriter;\nimport java.util.Arrays;\nimport java.util.InputMismatchException;\nimport java.util.Iterator;\nimport java.util.NoSuchElementException;\nimport java.util.function.LongBinaryOperator;\n\npubli...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00094-of-00128_78__public__0000", "expected_output": {"kind": "stdout", "value": "3\n1\n5"}, "input": {"kind": "stdin", "value": "7\nabcdbbd\n6\n2 3 6\n1 5 z\n2 1 1\n1 4 a\n1 7 d\n2 1 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
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00094-of-00128_79
N friends of Takahashi has come to a theme park. To ride the most popular roller coaster in the park, you must be at least K centimeters tall. The i-th friend is h_i centimeters tall. How many of the Takahashi's friends can ride the roller coaster? Constraints * 1 \le N \le 10^5 * 1 \le K \le 500 * 1 \le h_i \le 5...
[{"code": "n, k = map(int, input().split())\nh = list(map(int, input().split()))\n\nprint(sum(x >= k for x in h))", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00094-of-00128_79__ref__0000", "source": "benchmark"}, {"code": "N,K=map(int...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00094-of-00128_79__public__0000", "expected_output": {"kind": "stdout", "value": "5"}, "input": {"kind": "stdin", "value": "5 1\n100 200 300 400 500"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-0009...
{"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-00094-of-00128_80
There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5. Q people are standing at coordinate 0. The i-th person will start the coordinate 0 ...
[{"code": "from collections import deque, defaultdict\nfrom heapq import heappush, heappop\nimport sys\ninput = sys.stdin.readline\n\nN, Q = map(int, input().split())\nevents = [None] * (2*N)\nfor i in range(N):\n S, T, X = map(int, input().split())\n events[2*i] = (S-X, X)\n events[2*i+1] = (T-X, -X)\nevents....
[{"case_id": "codecontests__test__code_contests_train.riegeli-00094-of-00128_80__public__0000", "expected_output": {"kind": "stdout", "value": "2\n2\n10\n-1\n13\n-1"}, "input": {"kind": "stdin", "value": "4 6\n1 3 2\n7 13 10\n18 20 13\n3 4 2\n0\n1\n2\n3\n5\n8"}, "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
ATCODER
[""]
null
codecontests__test__code_contests_train.riegeli-00094-of-00128_83
We say that a odd number N is similar to 2017 when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i. Constraints * 1≤Q≤10^5 * 1≤l_i≤r_i≤10^5 * l_i and r_i are odd. * All input values ...
[{"code": "#include<bits/stdc++.h>\nusing namespace std;\n#define ran 100001\nbool f[ran];int p[ran],s[ran];int lp;\nint main(){\n\tf[0] = f[1] = true;\n\tfor(int i=2; i<ran; i++){\n\t\tif(!f[i]){\n\t\t\tp[lp++] = i;\n\t\t}\n\t\tfor(int j=0; j<lp; j++){\n\t\t\tint x = i*p[j];\n\t\t\tif(x>=ran)break;\n\t\t\tf[x] = true;...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00094-of-00128_83__public__0000", "expected_output": {"kind": "stdout", "value": "2"}, "input": {"kind": "stdin", "value": "1\n3 7"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00094-of-00128_83__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-00094-of-00128_84
Let N be a positive even number. We have a permutation of (1, 2, ..., N), p = (p_1, p_2, ..., p_N). Snuke is constructing another permutation of (1, 2, ..., N), q, following the procedure below. First, let q be an empty sequence. Then, perform the following operation until p becomes empty: * Select two adjacent elem...
[{"code": "#include<bits/stdc++.h>\nusing namespace std;\n#define cl(a,b) memset(a,b,sizeof(a))\n#define ll long long\n#define pb push_back\n#define gcd __gcd\n\n#define For(i,j,k) for(int i=(j);i<k;i++)\n#define lowbit(i) (i&(-i))\n#define _(x) printf(\"%d\\n\",x)\n\n\nconst int maxn = 2e5+100;\n\nint Log[maxn], dp[2]...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00094-of-00128_84__public__0000", "expected_output": {"kind": "stdout", "value": "1 2"}, "input": {"kind": "stdin", "value": "2\n1 2"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00094-of-00128_84__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-00094-of-00128_85
Snuke, who loves animals, built a zoo. There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered...
[{"code": "N = int(input())\ns = input()\nfor t in [\"SS\",\"SW\",\"WS\",\"WW\"]:\n for i in range(1,N-1):\n if (s[i] ==\"o\" and t[i]==\"S\") or (s[i]==\"x\" and t[i]==\"W\"):\n t += t[i-1]\n else:\n if t[i-1] ==\"S\":\n t += \"W\"\n else:\n t...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00094-of-00128_85__public__0000", "expected_output": {"kind": "stdout", "value": "SSWWSSSWWS"}, "input": {"kind": "stdin", "value": "10\noxooxoxoox"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00094...
{"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-00094-of-00128_86
AtCoDeer the deer and his friend TopCoDeer is playing a game. The game consists of N turns. In each turn, each player plays one of the two gestures, Rock and Paper, as in Rock-paper-scissors, under the following condition: (※) After each turn, (the number of times the player has played Paper)≦(the number of times the ...
[{"code": "\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tString s = in.next();\n\t\tint N = s.length();\n\t\tint count_p = 0, count_g = 0, score = 0;\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tchar top = s.charAt(i);\n\t\t\ti...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00094-of-00128_86__public__0000", "expected_output": {"kind": "stdout", "value": "0"}, "input": {"kind": "stdin", "value": "gpg"}, "metadata": {}, "visibility": "public"}, {"case_id": "codecontests__test__code_contests_train.riegeli-00094-of-00128_86__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-00095-of-00128_0
Recently Chef has decided to make some changes in our beloved Codechef. As you know, each problem at Codechef has its memory and time limits. To make problems even more challenging, he decided to measure allocated memory in a different way. Now judge program will be calculating not the maximum memory usage during the e...
[{"code": "t = int(raw_input())\nwhile t:\n t -= 1\n raw_input()\n arr = [0] + map(int, raw_input().split(' '))\n o = 0\n for i in range(1, len(arr)):\n o += max(0, arr[i] - arr[i-1])\n print o", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test_...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00095-of-00128_0__public__0000", "expected_output": {"kind": "stdout", "value": "1\n5\n3\n"}, "input": {"kind": "stdin", "value": "3\n2\n1 1\n5\n1 2 3 4 5\n3\n1 3 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-00095-of-00128_3
Mike takes part in olympiads in informatics. You think he is a rookie? Wrong! He is an experienced and well-prepared competitor! He participated in many important contests and won some of them. Now his level is rather high. In order to keep fit, Mike decided to improve his training sessions. He downloaded N task pack...
[{"code": "def opt(par,data):\n fail,total=par\n success=0\n data=sorted(data)\n for a in data:\n if(a%2==0):\n half=a/2\n if(total-half<0):\n break\n else:\n total-=half\n fail-=1\n else:\n half=a/2+1\n ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00095-of-00128_3__public__0000", "expected_output": {"kind": "stdout", "value": "0 2"}, "input": {"kind": "stdin", "value": "3 10\n3 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-00095-of-00128_5
Triangle classification is an important problem in modern mathematics. Mathematicians have developed many criteria according to which a triangle can be classified. In this problem, you will be asked to classify some triangles according to their sides and angles. According to their measure, angles may be: Acute — an ...
[{"code": "from math import sqrt, fabs\nsubid = input()\n\nT = input()\ncompare = float(10**-6)\n\nfor hell in range(T):\n\n x1,y1,x2,y2,x3,y3 = map(float, raw_input().split())\n\n tside1 = sqrt( (x1 - x2)**2 + (y1 - y2)**2 )\n tside2 = sqrt( (x2 - x3)**2 + (y2 - y3)**2 )\n tside3 = sqrt( (x3 - x1)**2 + (y3...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00095-of-00128_5__public__0000", "expected_output": {"kind": "stdout", "value": "Scalene acute triangle\nScalene right triangle\nScalene obtuse triangle\nIsosceles acute triangle\nIsosceles right triangle\nIsosceles obtuse triangle"}, "input": {"kind": "stdi...
{"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-00095-of-00128_68
Alice has N boxes, and each box has certain non zero number of chocolates. These boxes are numbered from 1 to N. Alice is planning to go to wonderland. She wants to carry exactly K number of chocolates and she can carry only 2 boxes. So she wants to know the number of ways in which she can select 2 boxes such that t...
[{"code": "for t in range(int(raw_input())):\n n = int(raw_input())\n xs = [int(i) for i in raw_input().split()]\n k = int(raw_input())\n counts = [0] * 101\n for x in xs:\n counts[x] += 1\n total = 0\n for i in range(1, k):\n if k-i < 0 or i > 100 or k-i > 100:\n continue\...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00095-of-00128_68__public__0000", "expected_output": {"kind": "stdout", "value": "2\n10\n4\n"}, "input": {"kind": "stdin", "value": "3\n5\n1 2 3 4 3\n6\n5\n1 1 1 1 1\n2\n5\n1 5 3 3 3\n6\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-00095-of-00128_75
Bimal decided to join a non Hill'ffair club because he is not interested in cultural activities at all. He thought that joining a technical club would help him in gaining technical prowess. However, on joining the most technical club that he could find, he realised that most of the work in all technical clubs is not te...
[{"code": "t=input()\nfor _ in range(0,t):\n\tinput()\n\tn=input()\n\tprint n%1000000007", "is_known_correct": true, "language": "python", "metadata": {}, "solution_id": "codecontests__test__code_contests_train.riegeli-00095-of-00128_75__ref__0000", "source": "benchmark"}, {"code": "for _ in range(input()):\n\t\tdigit ...
[{"case_id": "codecontests__test__code_contests_train.riegeli-00095-of-00128_75__public__0000", "expected_output": {"kind": "stdout", "value": "121\n1\n"}, "input": {"kind": "stdin", "value": "2\n3\n121\n10\n1000000008\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