source
stringclasses
4 values
task_type
stringclasses
1 value
in_source_id
stringlengths
0
138
instruction_seed
stringlengths
216
14.3k
gold_standard_solution
stringlengths
0
289k
⌀
verification_info
stringlengths
88
74M
metadata
stringlengths
19
221
problem_id
stringlengths
5
10
_source
stringclasses
1 value
code_contests
verifiable_code
p00731 Cliff Climbing
Solve the following coding problem using the programming language rust: At 17:00, special agent Jack starts to escape from the enemy camp. There is a cliff in between the camp and the nearest safety zone. Jack has to climb the almost vertical cliff by stepping his feet on the blocks that cover the cliff. The cliff has...
{'test_cases': [{'type': 'stdin_stdout', 'input': '6 6\n4 4 X X T T\n4 7 8 2 X 7\n3 X X X 1 8\n1 2 X X X 6\n1 1 2 4 4 7\nS S 2 3 X X\n2 10\nT 1\n1 X\n1 X\n1 X\n1 1\n1 X\n1 X\n1 1\n1 X\nS S\n2 10\nT X\n1 X\n1 X\n1 X\n1 1\n1 X\n1 X\n1 1\n1 X\nS S\n10 10\nT T T T T T T T T T\nX 2 X X X X X 3 4 X\n9 8 9 X X X 2 9 X 9\n7 7 ...
{'difficulty': 0, 'time_limit': {'seconds': 3, 'nanos': 0}, 'memory_limit_bytes': 134217728}
vfc_53723
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://www.codechef.com/problems/PINS
Solve the following coding problem using the programming language javascript: Chef's company wants to make ATM PINs for its users, so that they could use the PINs for withdrawing their hard-earned money. One of these users is Reziba, who lives in an area where a lot of robberies take place when people try to withdraw ...
{'test_cases': [{'type': 'stdin_stdout', 'input': '1\n1\n', 'output': '1 1\n'}], 'language': 'javascript'}
{'difficulty': 'EASY', 'problem_url': 'https://www.codechef.com/problems/PINS', 'time_limit': '1.5 seconds', 'memory_limit': '50000 bytes'}
vfc_125304
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://codeforces.com/problemset/problem/251/B
Solve the following coding problem using the programming language rust: Little Petya likes permutations a lot. Recently his mom has presented him permutation q_1, q_2, ..., q_{n} of length n. A permutation a of length n is a sequence of integers a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ n), all integers there are distinct. ...
{'test_cases': [{'type': 'stdin_stdout', 'input': '4 1\n2 3 4 1\n1 2 3 4\n', 'output': 'NO\n'}, {'type': 'stdin_stdout', 'input': '4 1\n4 3 1 2\n3 4 2 1\n', 'output': 'YES\n'}, {'type': 'stdin_stdout', 'input': '4 3\n4 3 1 2\n3 4 2 1\n', 'output': 'YES\n'}, {'type': 'stdin_stdout', 'input': '4 2\n4 3 1 2\n2 1 4 3\n', '...
{'difficulty': 'MEDIUM_HARD', 'problem_url': 'https://codeforces.com/problemset/problem/251/B', 'time_limit': None, 'memory_limit': None}
vfc_110541
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
kjcc08
Solve the following coding problem using the programming language javascript: Clash of clans is a very popular game. Each player in the game is allocated a base with certain hit points the player can train a limited number of troops on the base. There are three types of troops: Barbarian, Archers and Giants. The Cost ...
{'test_cases': [{'type': 'stdin_stdout', 'input': '3\n1\n60', 'output': '300'}, {'type': 'stdin_stdout', 'input': '5\n3\n2475', 'output': '7500'}, {'type': 'stdin_stdout', 'input': '9\n2\n1530', 'output': '3300'}], 'language': 'javascript'}
{'difficulty': 6, 'time_limit': None, 'memory_limit_bytes': 0}
vfc_43794
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
Solve the following coding problem using the programming language javascript: HackerMan loves playing Age of Empire. A few days ago, he discovered a variant of that game which is equally adventurous. Here, he has to capture a castle before his enemy. The map consists of several interconnected paths in a grid pattern....
{'test_cases': [{'type': 'stdin_stdout', 'input': '10\n50 26\n2 3 2 1 2 4 8 9 10 3 3 5 5 3 5 8 3 1 7 10 9 1 10 2 4 5\n6 10 1 2 6 9 7 1 7 1 4 1 3 8 3 7 10 7 10 3 3 8 6 2 2 10\n2 6 2 6 2 1 10 7 3 2 2 7 9 9 4 1 2 4 5 8 6 6 1 4 3 9\n10 2 8 2 1 2 10 4 4 1 2 4 4 5 6 10 5 8 1 4 9 1 5 8 2 9\n10 7 5 1 9 4 1 1 3 4 9 10 9 2 9 2 1...
{'difficulty': 'MEDIUM', 'problem_url': None, 'time_limit': None, 'memory_limit': None}
vfc_139675
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://codeforces.com/problemset/problem/1191/D
Solve the following coding problem using the programming language cpp: Tokitsukaze and CSL are playing a little game of stones. In the beginning, there are n piles of stones, the i-th pile of which has a_i stones. The two players take turns making moves. Tokitsukaze moves first. On each turn the player chooses a none...
{'test_cases': [{'type': 'stdin_stdout', 'input': '2\n0 1\n', 'output': 'cslnb\n'}, {'type': 'stdin_stdout', 'input': '5\n0 1 3 3 4\n', 'output': 'sjfnb\n'}, {'type': 'stdin_stdout', 'input': '3\n87145686 87145684 87145685\n', 'output': 'cslnb\n'}, {'type': 'stdin_stdout', 'input': '3\n52412886 52412886 52412884\n', 'o...
{'difficulty': 'MEDIUM_HARD', 'problem_url': 'https://codeforces.com/problemset/problem/1191/D', 'time_limit': '1.0 seconds', 'memory_limit': '256.0 megabytes'}
vfc_137715
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://www.codechef.com/problems/FORGETPW
Solve the following coding problem using the programming language rust: Chef changed the password of his laptop a few days ago, but he can't remember it today. Luckily, he wrote the encrypted password on a piece of paper, along with the rules for decryption. The encrypted password is a string S consists of ASCII print...
{'test_cases': [{'type': 'stdin_stdout', 'input': '4\n2\n5 3\n3 1\n5\n0\n01800.00\n0\n0.00100\n3\nx 0\nd 3\n# .\n0xd21#dd098x\n\n\n', 'output': '3\n1800\n.001\n321.33098\n'}, {'type': 'stdin_stdout', 'input': '4\n2\n5 3\n3 1\n5\n0\n01800.00\n0\n0.00100\n3\nx 0\nd 3\n# .\n0xd21#xd098d', 'output': '3\n1800\n.001\n321.030...
{'difficulty': 'MEDIUM_HARD', 'problem_url': 'https://www.codechef.com/problems/FORGETPW', 'time_limit': '1 seconds', 'memory_limit': '50000 bytes'}
vfc_115782
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
575_D. Tablecity
Solve the following coding problem using the programming language python: There was a big bank robbery in Tablecity. In order to catch the thief, the President called none other than Albert – Tablecity’s Chief of Police. Albert does not know where the thief is located, but he does know how he moves. Tablecity can be ...
```python print(2001) for i in range(1 , 1001): print(f"{i} 1 {i} 2") print(f"1 1 1 2") for i in range(1 , 1001): print(f"{i} 1 {i} 2") ```
{'test_cases': [{'type': 'stdin_stdout', 'input': "В этой задаче нет примеров ввода-вывода.\nThis problem doesn't have sample input and output.", 'output': '2000\n1 1 1 2\n2 1 2 2\n3 1 3 2\n4 1 4 2\n5 1 5 2\n6 1 6 2\n7 1 7 2\n8 1 8 2\n9 1 9 2\n10 1 10 2\n11 1 11 2\n12 1 12 2\n13 1 13 2\n14 1 14 2\n15 1 15 2\n16 1 16 2\...
{'difficulty': 10, 'time_limit': {'seconds': 1, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_62705
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
804_F. Fake bullions
Solve the following coding problem using the programming language python: In Isart people don't die. There are n gangs of criminals. The i-th gang contains si evil people numerated from 0 to si - 1. Some of these people took part in a big mine robbery and picked one gold bullion each (these people are given in the inp...
{'test_cases': [{'type': 'stdin_stdout', 'input': '2 2 1\n01\n00\n5 11000\n6 100000\n', 'output': '2'}, {'type': 'stdin_stdout', 'input': '5 2 1\n00000\n10000\n11011\n11000\n11010\n2 00\n1 1\n6 100110\n1 0\n1 0\n', 'output': '5'}, {'type': 'stdin_stdout', 'input': '10 10 6\n0111111101\n0010110000\n0000001001\n011001010...
{'difficulty': 12, 'time_limit': {'seconds': 3, 'nanos': 0}, 'memory_limit_bytes': 512000000}
vfc_71077
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://www.hackerrank.com/challenges/maximum-element/problem
Solve the following coding problem using the programming language javascript: You have an empty sequence, and you will be given $N$ queries. Each query is one of these three types: 1 x -Push the element x into the stack. 2 -Delete the element present at the top of the stack. 3 -Print the maximum element in the...
{'test_cases': [{'type': 'stdin_stdout', 'input': "STDIN Function\n----- --------\n10 operations[] size n = 10\n1 97 operations = ['1 97', '2', '1 20', ....]\n2\n1 20\n2\n1 26\n1 20\n2\n3\n1 91\n3\n", 'output': '26\n91\n'}], 'language': 'javascript'}
{'difficulty': 'EASY', 'problem_url': 'https://www.hackerrank.com/challenges/maximum-element/problem', 'time_limit': None, 'memory_limit': None}
vfc_129271
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://practice.geeksforgeeks.org/problems/count-of-ap-subsequences0016/1
Solve the following coding problem using the programming language python: Given an array A of N positive integers. The task is to count the number of Arithmetic Progression subsequence in the array. Note: Empty sequence or single element sequence is Arithmetic Progression. Example 1: Input : N = 3 A[] = { 1, 2, 3 } ...
```python from collections import defaultdict class Solution: def count(self, n, nums): n = len(nums) ans = 0 dp = defaultdict(lambda : 0) for i in range(1, n): for j in range(i): delta = nums[i] - nums[j] ans += dp[j, delta] dp[i, delta] += dp[j, delta] + 1 return ans + (n + 1) + n * (n - 1...
{'test_cases': [{'type': 'stdin_stdout', 'input': 'N = 3\nA[] = { 1, 2, 3 }', 'output': '8'}, {'type': 'stdin_stdout', 'input': 'N = 3\nA[] = { 10, 20, 30,}', 'output': '8'}], 'language': 'python'}
{'difficulty': 'MEDIUM', 'problem_url': 'https://practice.geeksforgeeks.org/problems/count-of-ap-subsequences0016/1', 'time_limit': None, 'memory_limit': None}
vfc_107014
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
Solve the following coding problem using the programming language rust: Amer cabs has released a scheme through which a user gets a free drive when he shares a reference code with another Amer app user. Given N number of app users, output total number of free drives gained by all of them. Two same users cannot share r...
{'test_cases': [{'type': 'stdin_stdout', 'input': '684\n2924\n7062\n7105\n4716\n9111\n6913\n1421\n9429\n2378\n4540\n9243\n544\n2898\n298\n6607\n4585\n1940\n8635\n5490\n8456\n4913\n5788\n9975\n9536\n1810\n5396\n103\n7349\n438\n1916\n1105\n8690\n6767\n1869\n8552\n4652\n5591\n890\n4494\n4695\n3567\n7945\n3752\n7690\n8886\...
{'difficulty': 'UNKNOWN_DIFFICULTY', 'problem_url': None, 'time_limit': None, 'memory_limit': None}
vfc_89300
PrimeIntellect/verifiable-coding-problems
apps
verifiable_code
3290
Solve the following coding problem using the programming language rust: Today your friends are playing a game of Exploding Kittens. On a player’s turn, she must perform the following actions in order: - Draw a single card from the top of the deck. - If the drawn card is an “Exploding Kitten”, she must leave the game...
null
{'test_cases': [{'type': 'stdin_stdout', 'input': '2 4 3\n3 4 5 7\n1 2 10\n', 'output': '0\n'}, {'type': 'stdin_stdout', 'input': '3 5 2\n1 4 7 9 11\n2 3\n', 'output': '2\n'}, {'type': 'stdin_stdout', 'input': '3 3 2\n1 4 7\n2 3\n', 'output': '-1\n'}], 'language': 'rust'}
{'difficulty': 'competition', 'problem_url': 'https://open.kattis.com/problems/explodingkittens'}
vfc_22268
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://codeforces.com/problemset/problem/620/A
Solve the following coding problem using the programming language cpp: Professor GukiZ makes a new robot. The robot are in the point with coordinates (x_1, y_1) and should go to the point (x_2, y_2). In a single step the robot can change any of its coordinates (maybe both of them) by one (decrease or increase). So the...
{'test_cases': [{'type': 'stdin_stdout', 'input': '0 0\n4 5\n', 'output': '5\n'}, {'type': 'stdin_stdout', 'input': '3 4\n6 1\n', 'output': '3\n'}, {'type': 'stdin_stdout', 'input': '0 0\n4 6\n', 'output': '6\n'}, {'type': 'stdin_stdout', 'input': '1 1\n-3 -5\n', 'output': '6\n'}, {'type': 'stdin_stdout', 'input': '-1 ...
{'difficulty': 'EASY', 'problem_url': 'https://codeforces.com/problemset/problem/620/A', 'time_limit': None, 'memory_limit': None}
vfc_139703
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://www.codechef.com/OCT12/problems/NEWSCH
Solve the following coding problem using the programming language javascript: Scheme? - Too loudly said. Just a new idea. Now Chef is expanding his business. He wants to make some new restaurants in the big city of Lviv. To make his business competitive he should interest customers. Now he knows how. But don't tell an...
{'test_cases': [{'type': 'stdin_stdout', 'input': '3\n2\n3\n5\n', 'output': '12\n24\n240\n'}], 'language': 'javascript'}
{'difficulty': 'UNKNOWN_DIFFICULTY', 'problem_url': 'https://www.codechef.com/OCT12/problems/NEWSCH', 'time_limit': None, 'memory_limit': None}
vfc_136761
PrimeIntellect/verifiable-coding-problems
apps
verifiable_code
1247
Solve the following coding problem using the programming language javascript: The Little Girl loves problems on games very much. Here's one of them. Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one m...
null
{'test_cases': [{'type': 'stdin_stdout', 'input': 'aba\n', 'output': 'First\n'}, {'type': 'stdin_stdout', 'input': 'abca\n', 'output': 'Second\n'}, {'type': 'stdin_stdout', 'input': 'aabb\n', 'output': 'First\n'}, {'type': 'stdin_stdout', 'input': 'ctjxzuimsxnarlciuynqeoqmmbqtagszuo\n', 'output': 'Second\n'}, {'type': ...
{'difficulty': 'interview', 'problem_url': 'https://codeforces.com/problemset/problem/276/B'}
vfc_14743
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
p02102 Tangled Cables
Solve the following coding problem using the programming language javascript: Problem On a company's network, there are $ n $ computers and $ m $ communication cables that connect them. Computers are distinguished by identifiers from $ 0 $ to $ n -1 $, and communication cables also have identifiers from $ 0 $ to $ m ...
{'test_cases': [{'type': 'stdin_stdout', 'input': '4 5\n0 2 22 13\n0 3 15 25\n1 2 3 3\n1 3 28 5\n2 3 5 22', 'output': '0.36000'}, {'type': 'stdin_stdout', 'input': '2 1\n0 1 1 1', 'output': '0'}, {'type': 'stdin_stdout', 'input': '5 6\n0 1 22 33\n0 2 43 11\n0 3 92 10\n1 3 50 12\n2 3 88 2\n3 4 58 89', 'output': '0.06667...
{'difficulty': 0, 'time_limit': {'seconds': 2, 'nanos': 0}, 'memory_limit_bytes': 267386880}
vfc_35858
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
Solve the following coding problem using the programming language cpp: You are a product engineer and would like to improve the quality of duct tapes that your company manufactures. An entire tape can be represented as a single row of N cells. Each cell has its Stickiness factor, which stands for its ability to stick ...
{'test_cases': [{'type': 'stdin_stdout', 'input': '95 10 8359\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1', 'output': '5'}, {'type': 'stdin_stdout', 'input': '89 40 58\n1 1 ...
{'difficulty': 'EASY', 'problem_url': None, 'time_limit': None, 'memory_limit': None}
vfc_86451
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
p00925 Miscalculation
Solve the following coding problem using the programming language rust: Example Input 1+2*3+4 11 Output M The input will be given via stdin and the output should be printed to stdout by your code. Now solve the problem by providing the code.
{'test_cases': [{'type': 'stdin_stdout', 'input': '1+2*3+4\n11', 'output': 'M'}, {'type': 'stdin_stdout', 'input': '1+2*3+4\n9', 'output': 'I\n'}, {'type': 'stdin_stdout', 'input': '0+1*3+4\n7', 'output': 'U\n'}, {'type': 'stdin_stdout', 'input': '4+3*0+4\n8', 'output': 'M\n'}, {'type': 'stdin_stdout', 'input': '3*1+0*...
{'difficulty': 0, 'time_limit': {'seconds': 1, 'nanos': 0}, 'memory_limit_bytes': 268435456}
vfc_49151
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
835_D. Palindromic characteristics
Solve the following coding problem using the programming language cpp: Palindromic characteristics of string s with length |s| is a sequence of |s| integers, where k-th number is the total number of non-empty substrings of s which are k-palindromes. A string is 1-palindrome if and only if it reads the same backward a...
```cpp #include <bits/stdc++.h> template <class T, class U> inline bool smin(T &x, const U &y) { return y < x ? x = y, 1 : 0; } template <class T, class U> inline bool smax(T &x, const U &y) { return x < y ? x = y, 1 : 0; } using LL = long long; using PII = std::pair<int, int>; constexpr int N(5005); std::array<int...
{'test_cases': [{'type': 'stdin_stdout', 'input': 'abacaba\n', 'output': '12 4 1 0 0 0 0 '}, {'type': 'stdin_stdout', 'input': 'abba\n', 'output': '6 1 0 0 '}, {'type': 'stdin_stdout', 'input': 'qqqpvmgd\n', 'output': '11 3 0 0 0 0 0 0 '}, {'type': 'stdin_stdout', 'input': 'wyemcafatp\n', 'output': '11 1 0 0 0 0 0 0 0 ...
{'difficulty': 10, 'time_limit': {'seconds': 3, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_67340
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://www.codechef.com/PBK32020/problems/ITGUY28
Solve the following coding problem using the programming language rust: The chef is trying to solve some pattern problems, Chef wants your help to code it. Chef has one number K to form a new pattern. Help the chef to code this pattern problem. -----Input:----- - First-line will contain $T$, the number of test cases....
{'test_cases': [{'type': 'stdin_stdout', 'input': '2\n2\n4\n', 'output': '2\n21\n210\n21\n2\n4\n43\n432\n4321\n43210\n4321\n432\n43\n4\n'}], 'language': 'rust'}
{'difficulty': 'UNKNOWN_DIFFICULTY', 'problem_url': 'https://www.codechef.com/PBK32020/problems/ITGUY28', 'time_limit': None, 'memory_limit': None}
vfc_107804
PrimeIntellect/verifiable-coding-problems
apps
verifiable_code
764
Solve the following coding problem using the programming language rust: Chef has just found a recipe book, where every dish consists of exactly four ingredients. He is going to choose some two dishes and prepare them for dinner. Of course, he likes diversity and wants to know whether the two dishes are similar. Two di...
null
{'test_cases': [{'type': 'stdin_stdout', 'input': '5\neggs sugar flour salt\nsugar eggs milk flour\naa ab ac ad\nac ad ae af\ncookies sugar grass lemon\nlemon meat chili wood\none two three four\none two three four\ngibberish jibberish lalalalala popopopopo\njibberisz gibberisz popopopopu lalalalalu\n', 'output': 'simi...
{'difficulty': 'interview', 'problem_url': 'https://www.codechef.com/problems/SIMDISH'}
vfc_1900
PrimeIntellect/verifiable-coding-problems
apps
verifiable_code
1343
Solve the following coding problem using the programming language javascript: Masha wants to open her own bakery and bake muffins in one of the n cities numbered from 1 to n. There are m bidirectional roads, each of whose connects some pair of cities. To bake muffins in her bakery, Masha needs to establish flour supp...
null
{'test_cases': [{'type': 'stdin_stdout', 'input': '5 4 2\n1 2 5\n1 2 3\n2 3 4\n1 4 10\n1 5\n', 'output': '3'}, {'type': 'stdin_stdout', 'input': '3 1 1\n1 2 3\n3\n', 'output': '-1'}, {'type': 'stdin_stdout', 'input': '2 3 1\n1 2 3\n1 2 18\n1 2 13\n2\n', 'output': '3'}, {'type': 'stdin_stdout', 'input': '3 7 0\n1 3 9\n1...
{'difficulty': 'interview', 'problem_url': 'https://codeforces.com/problemset/problem/707/B'}
vfc_15127
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
205_A. Little Elephant and Rozdil
Solve the following coding problem using the programming language python: The Little Elephant loves Ukraine very much. Most of all he loves town Rozdol (ukr. "Rozdil"). However, Rozdil is dangerous to settle, so the Little Elephant wants to go to some other town. The Little Elephant doesn't like to spend much time on...
```python n = int(input()) string = input() times = list(map(int, string.split())) a = min(times) if times.count(a) == 1: print(times.index(a) + 1) else: print("Still Rozdil") ```
{'test_cases': [{'type': 'stdin_stdout', 'input': '7\n7 4 47 100 4 9 12\n', 'output': 'Still Rozdil'}, {'type': 'stdin_stdout', 'input': '2\n7 4\n', 'output': '2'}, {'type': 'stdin_stdout', 'input': '1\n47\n', 'output': '1'}, {'type': 'stdin_stdout', 'input': '20\n3 3 6 9 8 2 4 1 7 3 2 9 7 7 9 7 2 6 2 7\n', 'output': '...
{'difficulty': 7, 'time_limit': {'seconds': 2, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_66397
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
p02330 Coin Combination Problem II
Solve the following coding problem using the programming language rust: You have N coins each of which has a value ai. Find the number of combinations that result when you choose K different coins in such a way that the total value of the coins is greater than or equal to L and less than or equal to R. Constraints *...
{'test_cases': [{'type': 'stdin_stdout', 'input': '5 2 7 19\n3 5 4 2 2', 'output': '5'}, {'type': 'stdin_stdout', 'input': '2 2 1 9\n5 1', 'output': '1'}, {'type': 'stdin_stdout', 'input': '5 2 7 19\n6 5 4 2 2', 'output': '7\n'}, {'type': 'stdin_stdout', 'input': '2 2 2 9\n5 1', 'output': '1\n'}, {'type': 'stdin_stdout...
{'difficulty': 0, 'time_limit': {'seconds': 3, 'nanos': 0}, 'memory_limit_bytes': 268435456}
vfc_67511
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://atcoder.jp/contests/arc109/tasks/arc109_a
Solve the following coding problem using the programming language rust: There are two 100-story buildings, called A and B. (In this problem, the ground floor is called the first floor.) For each i = 1,\dots, 100, the i-th floor of A and that of B are connected by a corridor. Also, for each i = 1,\dots, 99, there is a ...
{'test_cases': [{'type': 'stdin_stdout', 'input': '2 1 1 5\n', 'output': '1\n'}, {'type': 'stdin_stdout', 'input': '1 2 100 1\n', 'output': '101\n'}, {'type': 'stdin_stdout', 'input': '1 100 1 100\n', 'output': '199\n'}, {'type': 'stdin_stdout', 'input': '18 18 40 79\n', 'output': '40\n'}, {'type': 'stdin_stdout', 'inp...
{'difficulty': 'MEDIUM_HARD', 'problem_url': 'https://atcoder.jp/contests/arc109/tasks/arc109_a', 'time_limit': None, 'memory_limit': None}
vfc_127123
PrimeIntellect/verifiable-coding-problems
apps
verifiable_code
4295
Solve the following coding problem using the programming language Python: # Definition **_Balanced number_** is the number that * **_The sum of_** all digits to the **_left of the middle_** digit(s) and the sum of all digits to the **_right of the middle_** digit(s) are **_equal_***. ____ # Task **_Given_** a numb...
null
{'test_cases': [{'type': 'function_call', 'fn_name': 'balanced_num', 'input': [56239814], 'output': ['Balanced']}], 'language': 'Python'}
{'difficulty': 'introductory', 'problem_url': 'https://www.codewars.com/kata/5a4e3782880385ba68000018'}
vfc_9046
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
1213_E. Two Small Strings
Solve the following coding problem using the programming language rust: You are given two strings s and t both of length 2 and both consisting only of characters 'a', 'b' and 'c'. Possible examples of strings s and t: "ab", "ca", "bb". You have to find a string res consisting of 3n characters, n characters should be...
{'test_cases': [{'type': 'stdin_stdout', 'input': '3\naa\nbc\n', 'output': 'YES\nacbacbacb'}, {'type': 'stdin_stdout', 'input': '1\ncb\nac\n', 'output': 'YES\nabc'}, {'type': 'stdin_stdout', 'input': '2\nab\nbc\n', 'output': 'YES\nacbacb'}, {'type': 'stdin_stdout', 'input': '2\naa\nca\n', 'output': 'YES\nacbacb'}, {'ty...
{'difficulty': 11, 'time_limit': {'seconds': 2, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_72991
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
250_A. Paper Work
Solve the following coding problem using the programming language rust: Polycarpus has been working in the analytic department of the "F.R.A.U.D." company for as much as n days. Right now his task is to make a series of reports about the company's performance for the last n days. We know that the main information in a...
{'test_cases': [{'type': 'stdin_stdout', 'input': '5\n0 -1 100 -1 0\n', 'output': '1\n5\n'}, {'type': 'stdin_stdout', 'input': '11\n1 2 3 -4 -5 -6 5 -5 -6 -7 6\n', 'output': '3\n5 3 3 '}, {'type': 'stdin_stdout', 'input': '3\n-3 -4 -5\n', 'output': '2\n2 1 '}, {'type': 'stdin_stdout', 'input': '100\n-63 20 79 73 18 82 ...
{'difficulty': 7, 'time_limit': {'seconds': 2, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_75571
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://www.codechef.com/problems/XORMAX
Solve the following coding problem using the programming language python: Chef has two binary strings A and B, each of length N. Chef can rearrange both the strings in any way. Find the maximum [bitwise XOR] he can achieve if he rearranges the strings optimally. ------ Input Format ------ - The first line of input...
```python for _ in range(int(input())): s1 = input() s2 = input() s3 = s1 + s2 a = s3.count('1') b = s3.count('0') m = min(a, b) print('1' * m + '0' * (len(s1) - m)) ```
{'test_cases': [{'type': 'stdin_stdout', 'input': '4\n0011\n1011\n100\n100\n11111\n11101\n1\n0\n', 'output': '1110\n110\n10000\n1\n'}], 'language': 'python'}
{'difficulty': 'EASY', 'problem_url': 'https://www.codechef.com/problems/XORMAX', 'time_limit': '1 seconds', 'memory_limit': '50000 bytes'}
vfc_104555
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
lowsum
Solve the following coding problem using the programming language rust: The Head Chef is studying the motivation and satisfaction level of his chefs . The motivation and satisfaction of a Chef can be represented as an integer . The Head Chef wants to know the N th smallest sum of one satisfaction value and one motiv...
{'test_cases': [{'type': 'stdin_stdout', 'input': '1\n3 1\n1 2 3\n4 5 6\n4', 'output': '7'}, {'type': 'stdin_stdout', 'input': '1\n3 1\n1 4 3\n4 5 6\n4', 'output': '7\n'}, {'type': 'stdin_stdout', 'input': '1\n6 1\n1 4 3\n4 5 6\n1', 'output': '5\n'}, {'type': 'stdin_stdout', 'input': '1\n6 1\n0 4 3\n4 5 6\n1', 'output'...
{'difficulty': 2, 'time_limit': None, 'memory_limit_bytes': 0}
vfc_30455
PrimeIntellect/verifiable-coding-problems
apps
verifiable_code
281
Solve the following coding problem using the programming language cpp: Even if the world is full of counterfeits, I still regard it as wonderful. Pile up herbs and incense, and arise again from the flames and ashes of its predecessor — as is known to many, the phoenix does it like this. The phoenix has a rather long...
null
{'test_cases': [{'type': 'stdin_stdout', 'input': '2 4\n', 'output': '2\n'}, {'type': 'stdin_stdout', 'input': '0 10\n', 'output': '0\n'}, {'type': 'stdin_stdout', 'input': '107 109\n', 'output': '2\n'}, {'type': 'stdin_stdout', 'input': '10 13\n', 'output': '6\n'}, {'type': 'stdin_stdout', 'input': '998244355 99824435...
{'difficulty': 'interview', 'problem_url': 'https://codeforces.com/problemset/problem/869/B'}
vfc_10881
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
p01770 Arojam's Mask
Solve the following coding problem using the programming language javascript: Problem statement You are a hero. The world in which the hero is traveling consists of N cities and M roads connecting different cities. Road i connects town a_i and town b_i and can move in both directions. The purpose of the brave is to ...
{'test_cases': [{'type': 'stdin_stdout', 'input': '8 5 2 0 5 5\n0 1\n0 3\n0 6\n1 2\n6 7\n3 4 7\n4 5 2', 'output': '9'}, {'type': 'stdin_stdout', 'input': '8 5 2 0 5 5\n0 1\n0 3\n0 6\n1 2\n6 7\n1 4 7\n4 5 2', 'output': '8\n'}, {'type': 'stdin_stdout', 'input': '8 5 2 0 5 5\n0 1\n0 3\n0 2\n1 2\n6 7\n3 4 7\n4 5 2', 'outpu...
{'difficulty': 0, 'time_limit': {'seconds': 1, 'nanos': 0}, 'memory_limit_bytes': 134217728}
vfc_30418
PrimeIntellect/verifiable-coding-problems
apps
verifiable_code
3507
Solve the following coding problem using the programming language Python: ## Enough is enough! Alice and Bob were on a holiday. Both of them took many pictures of the places they've been, and now they want to show Charlie their entire collection. However, Charlie doesn't like these sessions, since the motive usually ...
null
{'test_cases': [{'type': 'function_call', 'fn_name': 'delete_nth', 'input': [[20, 37, 20, 21], 1], 'output': [[20, 37, 21]]}, {'type': 'function_call', 'fn_name': 'delete_nth', 'input': [[1, 1, 3, 3, 7, 2, 2, 2, 2], 3], 'output': [[1, 1, 3, 3, 7, 2, 2, 2]]}, {'type': 'function_call', 'fn_name': 'delete_nth', 'input': [...
{'difficulty': 'introductory', 'problem_url': 'https://www.codewars.com/kata/554ca54ffa7d91b236000023'}
vfc_8258
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
431_C. k-Tree
Solve the following coding problem using the programming language javascript: Quite recently a creative student Lesha had a lecture on trees. After the lecture Lesha was inspired and came up with the tree of his own which he called a k-tree. A k-tree is an infinite rooted tree where: * each vertex has exactly k ch...
{'test_cases': [{'type': 'stdin_stdout', 'input': '4 5 2\n', 'output': '7\n'}, {'type': 'stdin_stdout', 'input': '3 3 2\n', 'output': '3\n'}, {'type': 'stdin_stdout', 'input': '3 3 3\n', 'output': '1\n'}, {'type': 'stdin_stdout', 'input': '4 3 2\n', 'output': '6\n'}, {'type': 'stdin_stdout', 'input': '10 13 6\n', 'outp...
{'difficulty': 9, 'time_limit': {'seconds': 1, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_63930
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
592_E. BCPC
Solve the following coding problem using the programming language javascript: BCPC stands for Byteforces Collegiate Programming Contest, and is the most famous competition in Byteforces. BCPC is a team competition. Each team is composed by a coach and three contestants. Blenda is the coach of the Bit State University...
{'test_cases': [{'type': 'stdin_stdout', 'input': '7 6 6\n3 2\n1 7\n5 7\n3 7\n6 4\n8 9\n8 5\n', 'output': '11\n'}, {'type': 'stdin_stdout', 'input': '5 2 2\n1 1\n4 1\n2 3\n3 2\n3 4\n', 'output': '4\n'}, {'type': 'stdin_stdout', 'input': '8 61 898\n315 863\n524 559\n612 425\n577 542\n220 280\n560 880\n297 626\n381 24\n'...
{'difficulty': 11, 'time_limit': {'seconds': 4, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_29386
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
p01931 Check answers
Solve the following coding problem using the programming language cpp: problem AOR Ika is studying to pass the test. AOR Ika-chan solved the $ N $ question. After that, round the solved problem according to the following procedure. 1. Check the correctness of the answer. 2. If the answer is correct, write a circle ...
```cpp #include<iostream> #include<string> using namespace std; int main(){ int N,i=0; string s; cin>>N>>s; for(i=1;i<N;i++){ if(s[i]=='x'&&s[i-1]=='x') break; } cout << i << endl; return 0; } ```
{'test_cases': [{'type': 'stdin_stdout', 'input': '3\noxx', 'output': '2'}, {'type': 'stdin_stdout', 'input': '3\nnxx', 'output': '2\n'}, {'type': 'stdin_stdout', 'input': '3\nnwx', 'output': '3\n'}, {'type': 'stdin_stdout', 'input': '3\nxxo', 'output': '1\n'}, {'type': 'stdin_stdout', 'input': '3\nxwn', 'output': '3\n...
{'difficulty': 0, 'time_limit': {'seconds': 1, 'nanos': 0}, 'memory_limit_bytes': 268435456}
vfc_30008
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
72_E. Ali goes shopping
Solve the following coding problem using the programming language rust: Ali Koochooloo is going to buy new clothes since we're reaching Noruz, the ancient Persian festival and the beginning of new Persian year. When Ali entered a shop, he saw that the shopkeeper was a programmer and since there is no money in program...
{'test_cases': [{'type': 'stdin_stdout', 'input': 'abab\n', 'output': 'ab\n'}, {'type': 'stdin_stdout', 'input': 'abcd\n', 'output': 'abcd\n'}], 'language': 'rust'}
{'difficulty': 11, 'time_limit': {'seconds': 5, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_56907
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
Solve the following coding problem using the programming language python: Little Bear has received a home assignment to find the sum of all digits in a number N. Following his affinity towards single digit number, he intends to repeatedly compute the sum of all digits until the sum itself becomes a single digit number...
```python t=int(input()) while t: res=0 n=int(input()) while n: a,b=list(map(int,input().split())) res=res+(a*b) n=n-1 s=str(res) while len(s)>1: res=sum(map(int,list(s))) s=str(res) print(s) t=t-1 ```
{'test_cases': [{'type': 'stdin_stdout', 'input': '10\n10\n242 7\n207 5\n192 3\n944 9\n902 6\n746 9\n110 8\n895 8\n877 5\n3 3\n10\n121 1\n26 5\n762 8\n718 7\n901 8\n61 5\n471 6\n685 5\n307 0\n3 3\n10\n15 0\n456 4\n475 6\n81 8\n286 6\n892 8\n766 3\n720 3\n910 0\n1 7\n10\n972 9\n658 3\n515 1\n309 9\n871 9\n670 0\n695 8\n...
{'difficulty': 'EASY', 'problem_url': None, 'time_limit': None, 'memory_limit': None}
vfc_102369
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
1392_A. Omkar and Password
Solve the following coding problem using the programming language cpp: Lord Omkar has permitted you to enter the Holy Church of Omkar! To test your worthiness, Omkar gives you a password which you must interpret! A password is an array a of n positive integers. You apply the following operation to the array: pick any...
```cpp #include <bits/stdc++.h> using namespace std; int dx[] = {1, -1, 0, 0, 1, 1, -1, -1}; int dy[] = {0, 0, 1, -1, -1, 1, 1, -1}; inline int nxt() { int a; scanf("%d", &a); return a; } inline long long int NXT() { long long int a; scanf("%lld", &a); return a; } template <typename T> string NumberToString...
{'test_cases': [{'type': 'stdin_stdout', 'input': '2\n4\n2 1 3 1\n2\n420 420\n', 'output': '1\n2\n'}, {'type': 'stdin_stdout', 'input': '1\n4\n1 2 2 1\n', 'output': '1\n'}, {'type': 'stdin_stdout', 'input': '1\n7\n529035968 529035968 529035968 529035968 529035968 529035968 529035968\n', 'output': '7\n'}, {'type': 'stdi...
{'difficulty': 7, 'time_limit': {'seconds': 2, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_45964
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://www.codechef.com/problems/CHNGFUNC
Solve the following coding problem using the programming language rust: Chang's new maths teacher is very enthusiastic about making sure that students understand the concept rather than remembering it. On her first day at teaching, she gives an assignment to all the students to test their potential. Chang wants to dem...
{'test_cases': [{'type': 'stdin_stdout', 'input': '4 4\n', 'output': '1\n'}], 'language': 'rust'}
{'difficulty': 'UNKNOWN_DIFFICULTY', 'problem_url': 'https://www.codechef.com/problems/CHNGFUNC', 'time_limit': None, 'memory_limit': None}
vfc_109421
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
cr02
Solve the following coding problem using the programming language javascript: POINTS - 30   Given an integer N, output the number of zeroes at the end of N! (factorial).   Input The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows. The first lin...
{'test_cases': [{'type': 'stdin_stdout', 'input': '3\n60\n3\n100', 'output': '14\n0\n24'}], 'language': 'javascript'}
{'difficulty': 6, 'time_limit': None, 'memory_limit_bytes': 0}
vfc_63350
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
subly-again
Solve the following coding problem using the programming language cpp: Subly found a set of Numbers in his Dad's table. Subly examines that set and wants to know how many numbers in that set are not divisible by his favourite number. He asked his brother for help. His brother told him that the numbers were in some r...
{'test_cases': [{'type': 'stdin_stdout', 'input': '7 5\n\nSAMPLE', 'output': '6'}, {'type': 'stdin_stdout', 'input': '8 2', 'output': '2'}, {'type': 'stdin_stdout', 'input': '89765 13', 'output': '288'}, {'type': 'stdin_stdout', 'input': '105685 13', 'output': '3600\n'}, {'type': 'stdin_stdout', 'input': '13 2', 'outpu...
{'difficulty': 0, 'time_limit': None, 'memory_limit_bytes': 0}
vfc_51164
PrimeIntellect/verifiable-coding-problems
codeforces
verifiable_code
931
Solve the following coding problem using the programming language javascript: Two friends are on the coordinate axis *Ox* in points with integer coordinates. One of them is in the point *x*1<==<=*a*, another one is in the point *x*2<==<=*b*. Each of the friends can move by one along the line in any direction unlimit...
{'test_cases': [{'type': 'stdin_stdout', 'input': '3\n4', 'output': '1'}, {'type': 'stdin_stdout', 'input': '101\n99', 'output': '2'}, {'type': 'stdin_stdout', 'input': '5\n10', 'output': '9'}, {'type': 'stdin_stdout', 'input': '1\n2', 'output': '1'}, {'type': 'stdin_stdout', 'input': '1\n1000', 'output': '250000'}, {'...
{'time_limit': 1000}
vfc_82022
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
p02155 First Kiss
Solve the following coding problem using the programming language rust: Problem At the boys' school where Bit-kun attends, a Kippo game is played during the lunch break. This school's Kippo game is famous for being a little strange. First, prepare a $ N $ book ticket. The length of the $ i $ first ticket is $ a_i $. ...
{'test_cases': [{'type': 'stdin_stdout', 'input': '3 5\n10 8 4', 'output': 'First'}, {'type': 'stdin_stdout', 'input': '4 10\n3 8 5 2', 'output': 'Second'}, {'type': 'stdin_stdout', 'input': '2 25\n19 19', 'output': 'Second'}, {'type': 'stdin_stdout', 'input': '1 1\n2', 'output': 'First'}, {'type': 'stdin_stdout', 'inp...
{'difficulty': 0, 'time_limit': {'seconds': 3, 'nanos': 0}, 'memory_limit_bytes': 268435456}
vfc_61251
PrimeIntellect/verifiable-coding-problems
codeforces
verifiable_code
591
Solve the following coding problem using the programming language python: Harry Potter and He-Who-Must-Not-Be-Named engaged in a fight to the death once again. This time they are located at opposite ends of the corridor of length *l*. Two opponents simultaneously charge a deadly spell in the enemy. We know that the im...
s=int(input()) p=int(input()) q=int(input()) print(s*p/(p+q))
{'test_cases': [{'type': 'stdin_stdout', 'input': '100\n50\n50', 'output': '50'}, {'type': 'stdin_stdout', 'input': '199\n60\n40', 'output': '119.4'}, {'type': 'stdin_stdout', 'input': '1\n1\n1', 'output': '0.5'}, {'type': 'stdin_stdout', 'input': '1\n1\n500', 'output': '0.001996007984'}, {'type': 'stdin_stdout', 'inpu...
{'time_limit': 2000}
vfc_82789
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
p01468 Closest Segment Pair
Solve the following coding problem using the programming language cpp: Problem statement $ N $ Line segments $ s_1, s_2, ..., s_N $ are given. At this time, find the minimum possible value of dist $ (s_i, s_j) $, ($ 1 \ leq i, j \ leq N, i \ ne j $). dist $ (s_i, s_j) $ is * $ \ sqrt {(x_i-x_j) ^ 2 + (y_i-y_j) ^ 2} ...
```cpp #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef complex<double> P; typedef pair<int,int> pii; #define REP(i,n) for(ll i=0;i<n;++i) #define REPR(i,n) for(ll i=1;i<n;++i) #define FOR(i,a,b) for(ll i=a;i<b;++i) #define DEBUG(x) cout<<#x<<...
{'test_cases': [{'type': 'stdin_stdout', 'input': '6\n5 5 5 45\n7 45 19 45\n7 30 19 30\n21 34 21 44\n26 45 36 28\n45 45 26 5', 'output': '0.83553169'}, {'type': 'stdin_stdout', 'input': '4\n2 0 2 25\n0 30 15 20\n16 20 5 15\n23 0 23 30', 'output': '0.41380294'}, {'type': 'stdin_stdout', 'input': '11\n10 10 10 90\n10 90 ...
{'difficulty': 0, 'time_limit': {'seconds': 1, 'nanos': 0}, 'memory_limit_bytes': 134217728}
vfc_41256
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://codeforces.com/problemset/problem/1111/A
Solve the following coding problem using the programming language cpp: We all know that a superhero can transform to certain other superheroes. But not all Superheroes can transform to any other superhero. A superhero with name $s$ can transform to another superhero with name $t$ if $s$ can be made equal to $t$ by cha...
{'test_cases': [{'type': 'stdin_stdout', 'input': 'a\nu\n', 'output': 'Yes\n'}, {'type': 'stdin_stdout', 'input': 'abc\nukm\n', 'output': 'Yes\n'}, {'type': 'stdin_stdout', 'input': 'akm\nua\n', 'output': 'No\n'}, {'type': 'stdin_stdout', 'input': 'u\nd\n', 'output': 'No\n'}, {'type': 'stdin_stdout', 'input': 'aaaaaeee...
{'difficulty': 'EASY', 'problem_url': 'https://codeforces.com/problemset/problem/1111/A', 'time_limit': None, 'memory_limit': None}
vfc_87832
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
p03123 World Tour Finals 2019 - Distinct Boxes
Solve the following coding problem using the programming language python: Snuke has R red balls and B blue balls. He distributes them into K boxes, so that no box is empty and no two boxes are identical. Compute the maximum possible value of K. Formally speaking, let's number the boxes 1 through K. If Box i contains ...
{'test_cases': [{'type': 'stdin_stdout', 'input': '8 3', 'output': '5'}], 'language': 'python'}
{'difficulty': 0, 'time_limit': {'seconds': 2, 'nanos': 0}, 'memory_limit_bytes': 1073741824}
vfc_49101
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
alien-language
Solve the following coding problem using the programming language rust: Little Jhool considers Jaadu to be a very close friend of his. But, he ends up having some misunderstanding with him a lot of times, because Jaadu's English isn't perfect, and Little Jhool sucks at the language Jaadu speaks. So, he's in a fix - si...
{'test_cases': [{'type': 'stdin_stdout', 'input': '2\nhackerearth\nhacker\nhackerearth\nwow\nSAMPLE', 'output': 'YES\nNO\n'}, {'type': 'stdin_stdout', 'input': '2\nhackerearth\nhacker\nhackerearti\nwow\nSAMPLE', 'output': 'YES\nNO\n'}, {'type': 'stdin_stdout', 'input': '2\nhackerdarth\nhacker\nhackerearti\nwow\nSAMPLE'...
{'difficulty': 0, 'time_limit': None, 'memory_limit_bytes': 0}
vfc_46967
PrimeIntellect/verifiable-coding-problems
apps
verifiable_code
940
Solve the following coding problem using the programming language python: Masha has three sticks of length $a$, $b$ and $c$ centimeters respectively. In one minute Masha can pick one arbitrary stick and increase its length by one centimeter. She is not allowed to break sticks. What is the minimum number of minutes sh...
```python a, b, c = sorted(map(int, input().split())) print(max(0, c - a - b + 1)) ```
{'test_cases': [{'type': 'stdin_stdout', 'input': '3 4 5\n', 'output': '0\n'}, {'type': 'stdin_stdout', 'input': '2 5 3\n', 'output': '1\n'}, {'type': 'stdin_stdout', 'input': '100 10 10\n', 'output': '81\n'}, {'type': 'stdin_stdout', 'input': '1 1 1\n', 'output': '0\n'}, {'type': 'stdin_stdout', 'input': '100 100 100\...
{'difficulty': 'interview', 'problem_url': 'https://codeforces.com/problemset/problem/1064/A'}
vfc_13514
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
55_A. Flea travel
Solve the following coding problem using the programming language python: A flea is sitting at one of the n hassocks, arranged in a circle, at the moment. After minute number k the flea jumps through k - 1 hassoсks (clockwise). For example, after the first minute the flea jumps to the neighboring hassock. You should a...
```python n = int(input()) visited = [False] * n k = 0 for i in range(n ** 2 + 1): k += i + 1 visited[k % n] = True for i in visited: if not i: print("NO") exit() print("YES") ```
{'test_cases': [{'type': 'stdin_stdout', 'input': '1\n', 'output': 'YES\n'}, {'type': 'stdin_stdout', 'input': '3\n', 'output': 'NO\n'}, {'type': 'stdin_stdout', 'input': '37\n', 'output': 'NO\n'}, {'type': 'stdin_stdout', 'input': '7\n', 'output': 'NO\n'}, {'type': 'stdin_stdout', 'input': '24\n', 'output': 'NO\n'}, {...
{'difficulty': 7, 'time_limit': {'seconds': 1, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_59373
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
402_D. Upgrading Array
Solve the following coding problem using the programming language javascript: You have an array of positive integers a[1], a[2], ..., a[n] and a set of bad prime numbers b1, b2, ..., bm. The prime numbers that do not occur in the set b are considered good. The beauty of array a is the sum <image>, where function f(s) ...
{'test_cases': [{'type': 'stdin_stdout', 'input': '4 5\n2 4 8 16\n3 5 7 11 17\n', 'output': '10'}, {'type': 'stdin_stdout', 'input': '5 2\n4 20 34 10 10\n2 5\n', 'output': '-2'}, {'type': 'stdin_stdout', 'input': '21 1\n4608 864 2592 2304 144 13824 1296 432 576 6912 20736 648 288 72 1728 3456 5184 216 41472 1152 10368\...
{'difficulty': 10, 'time_limit': {'seconds': 1, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_67682
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://leetcode.com/problems/find-the-shortest-superstring/
Solve the following coding problem using the programming language python: Given an array A of strings, find any smallest string that contains each string in A as a substring. We may assume that no string in A is substring of another string in A.   Example 1: Input: ["alex","loves","leetcode"] Output: "alexlovesleetco...
```python class Solution: def shortestSuperstring(self, A: List[str]) -> str: A = [a for (i, a) in enumerate(A) if all((a not in b for (j, b) in enumerate(A) if i != j))] def memo(f): dic = {} def f_alt(*args): if args not in dic: dic[args] = f(*args) return dic[args] return f_alt def m...
{'test_cases': [{'type': 'function_call', 'fn_name': 'shortestSuperstring', 'input': [['"alex"', '"loves"', '"leetcode"']], 'output': '"leetcode"loves"alex"'}], 'language': 'python'}
{'difficulty': 'MEDIUM', 'problem_url': 'https://leetcode.com/problems/find-the-shortest-superstring/', 'time_limit': None, 'memory_limit': None}
vfc_116183
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
isd
Solve the following coding problem using the programming language javascript: Ilya lives in the beautiful city of Bytes lying in a hilly terrain. She loves to ride her bicycle on the hills whenever she gets a chance to do so. There are check-posts located on the hill at a unit distance from each other. The height of ...
{'test_cases': [{'type': 'stdin_stdout', 'input': '2\n3\n1 3 2\n5\n1 2 3 4 5', 'output': '1 \n0'}], 'language': 'javascript'}
{'difficulty': 6, 'time_limit': None, 'memory_limit_bytes': 0}
vfc_42958
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
9_E. Interesting Graph and Apples
Solve the following coding problem using the programming language cpp: Hexadecimal likes drawing. She has drawn many graphs already, both directed and not. Recently she has started to work on a still-life «interesting graph and apples». An undirected graph is called interesting, if each of its vertices belongs to one ...
```cpp #include <bits/stdc++.h> using namespace std; void fun() {} long long int __gcd(long long int a, long long int b) { if (b == 0) return a; return __gcd(b, a % b); } long long int poww(long long int a, long long int b, long long int md) { if (b < 0) return 0; if (a == 0) return 0; long long int res = 1; ...
{'test_cases': [{'type': 'stdin_stdout', 'input': '3 2\n1 2\n2 3\n', 'output': 'YES\n1\n1 3\n'}, {'type': 'stdin_stdout', 'input': '42 28\n7 19\n15 24\n3 42\n18 5\n32 27\n26 20\n40 30\n35 2\n14 8\n22 10\n36 4\n16 14\n21 29\n37 40\n2 12\n30 21\n19 17\n39 34\n31 28\n20 3\n4 33\n11 42\n26 21\n9 10\n4 32\n6 1\n1 14\n14 12\...
{'difficulty': 11, 'time_limit': {'seconds': 1, 'nanos': 0}, 'memory_limit_bytes': 64000000}
vfc_30292
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://www.codechef.com/problems/LASTLEVELS
Solve the following coding problem using the programming language cpp: Chef is playing a videogame, and is getting close to the end. He decides to finish the rest of the game in a single session. There are X levels remaining in the game, and each level takes Chef Y minutes to complete. To protect against eye strain, ...
{'test_cases': [{'type': 'stdin_stdout', 'input': '4\n2 12 10\n3 12 10\n7 20 8\n24 45 15\n', 'output': '24\n36\n156\n1185'}], 'language': 'cpp'}
{'difficulty': 'EASY', 'problem_url': 'https://www.codechef.com/problems/LASTLEVELS', 'time_limit': '1 seconds', 'memory_limit': '50000 bytes'}
vfc_121623
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://www.codewars.com/kata/53d16bd82578b1fb5b00128c
Solve the following coding problem using the programming language python: Create a function that takes a number as an argument and returns a grade based on that number. Score | Grade -----------------------------------------|----- Anything greater than 1 or less than 0.6 | "F" 0.9 o...
```python def grader(x): if 0.9 <= x <= 1: return 'A' elif 0.8 <= x < 0.9: return 'B' elif 0.7 <= x < 0.8: return 'C' elif 0.6 <= x < 0.7: return 'D' else: return 'F' ```
{'test_cases': [{'type': 'function_call', 'fn_name': 'grader', 'input': [1], 'output': ['A']}, {'type': 'function_call', 'fn_name': 'grader', 'input': [1.01], 'output': ['F']}, {'type': 'function_call', 'fn_name': 'grader', 'input': [0.2], 'output': ['F']}, {'type': 'function_call', 'fn_name': 'grader', 'input': [0.7],...
{'difficulty': 'EASY', 'problem_url': 'https://www.codewars.com/kata/53d16bd82578b1fb5b00128c', 'time_limit': None, 'memory_limit': None}
vfc_114524
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://codeforces.com/problemset/problem/665/D
Solve the following coding problem using the programming language python: A tuple of positive integers {x_1, x_2, ..., x_{k}} is called simple if for all pairs of positive integers (i, j) (1 ≤ i < j ≤ k), x_{i} + x_{j} is a prime. You are given an array a with n positive integers a_1, a_2, ..., a_{n} (not ne...
```python def main(): input() (l0, l1, ones) = ([], [], 0) for a in map(int, input().split()): if a == 1: ones += 1 else: (l1 if a & 1 else l0).append(a) seive = [False, True] * (((max(l0) if l0 else 0) + (max(l1) if l1 else 0)) // 2 + 1) a = len(seive) for i in range(3, int(a ** 0.5) + 1, 2): if seiv...
{'test_cases': [{'type': 'stdin_stdout', 'input': '2\n2 3\n', 'output': '2\n3 2\n'}, {'type': 'stdin_stdout', 'input': '2\n2 2\n', 'output': '1\n2\n'}, {'type': 'stdin_stdout', 'input': '3\n2 1 1\n', 'output': '3\n1 1 2\n'}, {'type': 'stdin_stdout', 'input': '2\n83 14\n', 'output': '2\n14 83\n'}, {'type': 'stdin_stdout...
{'difficulty': 'MEDIUM_HARD', 'problem_url': 'https://codeforces.com/problemset/problem/665/D', 'time_limit': None, 'memory_limit': None}
vfc_95076
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
mriu4
Solve the following coding problem using the programming language javascript: Given an input sequence. You have to write a program to sort it in non decreasing order. Input First line of input T has number of test cases followed by T test cases. Each test case has two lines. First line has a number N. The second line...
{'test_cases': [{'type': 'stdin_stdout', 'input': '3\n2\n3 4\n5\n1 4 5 8 2\n1\n7', 'output': '3 4\n1 2 4 5 8\n7\n'}, {'type': 'stdin_stdout', 'input': '3\n2\n3 4\n5\n1 4 0 8 2\n1\n7', 'output': '3 4 0 1 2 4 8 7\n'}, {'type': 'stdin_stdout', 'input': '3\n2\n3 4\n5\n1 4 0 8 2\n1\n3', 'output': '3 4 0 1 2 4 8 3\n'}, {'typ...
{'difficulty': 6, 'time_limit': None, 'memory_limit_bytes': 0}
vfc_41294
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
Solve the following coding problem using the programming language cpp: Given A and B, compute the sum of lcm(a, b) over all pairs of positive integers a and b such that: (1) a ≤ A and b ≤ B. (2) There is no integer n>1 such that n^2 divides both a and b. Give your answer modulo 2^30. INPUT The first line contains...
{'test_cases': [{'type': 'stdin_stdout', 'input': '15\n2 6\n3 8\n4 6\n5 8\n11 34\n45 89\n345 678\n2 7\n10 20\n234 765\n456 890\n432 567\n78 675\n56 89\n24 67', 'output': '51\n178\n148\n418\n29358\n2981376\n191241619\n72\n8169\n3753690'}, {'type': 'stdin_stdout', 'input': '4\n2 4\n3 3\n6 5\n8 3', 'output': '24\n28\n233\...
{'difficulty': 'UNKNOWN_DIFFICULTY', 'problem_url': None, 'time_limit': None, 'memory_limit': None}
vfc_123791
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
1355_E. Restorer Distance
Solve the following coding problem using the programming language javascript: You have to restore the wall. The wall consists of N pillars of bricks, the height of the i-th pillar is initially equal to h_{i}, the height is measured in number of bricks. After the restoration all the N pillars should have equal heights....
{'test_cases': [{'type': 'stdin_stdout', 'input': '3 1 100 100\n1 3 8\n', 'output': '12\n'}, {'type': 'stdin_stdout', 'input': '5 1 2 4\n5 5 3 6 5\n', 'output': '4\n'}, {'type': 'stdin_stdout', 'input': '3 100 100 1\n1 3 8\n', 'output': '4\n'}, {'type': 'stdin_stdout', 'input': '5 1 2 2\n5 5 3 6 5\n', 'output': '3\n'},...
{'difficulty': 11, 'time_limit': {'seconds': 1, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_78014
PrimeIntellect/verifiable-coding-problems
apps
verifiable_code
704
Solve the following coding problem using the programming language cpp: Eugene has to do his homework. But today, he is feeling very lazy and wants to you do his homework. His homework has the following given maths problem. You are given three integers: A, N, M. You write the number A appended to itself N times in a ro...
null
{'test_cases': [{'type': 'stdin_stdout', 'input': '2\n12 2 17\n523 3 11\n\n\n', 'output': '5\n6\n'}], 'language': 'cpp'}
{'difficulty': 'interview', 'problem_url': 'https://www.codechef.com/problems/KBIGNUMB'}
vfc_1661
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
382_A. Ksenia and Pan Scales
Solve the following coding problem using the programming language python: Ksenia has ordinary pan scales and several weights of an equal mass. Ksenia has already put some weights on the scales, while other weights are untouched. Ksenia is now wondering whether it is possible to put all the remaining weights on the sca...
```python nm = list(map(str, input().split("|"))) s = list(input()) n = nm[0] m = nm[1] while s: if len(n)<=len(m): n = n + s.pop(0) else: m = m + s.pop(0) if len(n) == len(m): print(n + "|" + m) else: print("Impossible") ```
{'test_cases': [{'type': 'stdin_stdout', 'input': 'W|T\nF\n', 'output': 'Impossible\n'}, {'type': 'stdin_stdout', 'input': 'AC|T\nL\n', 'output': 'AC|TL\n'}, {'type': 'stdin_stdout', 'input': 'ABC|\nD\n', 'output': 'Impossible\n'}, {'type': 'stdin_stdout', 'input': '|ABC\nXYZ\n', 'output': 'XYZ|ABC\n'}, {'type': 'stdin...
{'difficulty': 7, 'time_limit': {'seconds': 1, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_70589
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
p00846 How I Mathematician Wonder What You Are!
Solve the following coding problem using the programming language python: After counting so many stars in the sky in his childhood, Isaac, now an astronomer and a mathematician, uses a big astronomical telescope and lets his image processing program count stars. The hardest part of the program is to judge if a shining...
{'test_cases': [{'type': 'stdin_stdout', 'input': '6\n66 13\n96 61\n76 98\n13 94\n4 0\n45 68\n8\n27 21\n55 14\n93 12\n56 95\n15 48\n38 46\n51 65\n64 31\n0', 'output': '1\n0'}, {'type': 'stdin_stdout', 'input': '6\n66 13\n96 61\n76 98\n13 94\n4 0\n45 68\n8\n27 21\n55 14\n93 12\n56 95\n15 48\n38 46\n51 65\n35 31\n0', 'ou...
{'difficulty': 0, 'time_limit': {'seconds': 8, 'nanos': 0}, 'memory_limit_bytes': 134217728}
vfc_73713
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
wsc
Solve the following coding problem using the programming language rust: The following is an easy game that the setter of this problem played when he was 8: A boatman, a wolf, a sheep, and a cabbage are on the bank of a river. They have a small boat that is capable of carrying the boatman and at most one other animal/i...
{'test_cases': [{'type': 'stdin_stdout', 'input': '2\n3 2\n1 2\n2 3\n3 3\n1 2\n2 3\n1 3', 'output': 'YES\nNO\n'}, {'type': 'stdin_stdout', 'input': '2\n3 2\n1 2\n2 3\n3 3\n1 2\n2 3\n2 3', 'output': 'YES\nNO\n'}, {'type': 'stdin_stdout', 'input': '2\n4 2\n1 2\n4 3\n3 3\n1 2\n3 3\n2 2', 'output': 'NO\nNO\n'}, {'type': 's...
{'difficulty': 3, 'time_limit': None, 'memory_limit_bytes': 0}
vfc_68371
PrimeIntellect/verifiable-coding-problems
apps
verifiable_code
1477
Solve the following coding problem using the programming language python: You are given a program you want to execute as a set of tasks organized in a dependency graph. The dependency graph is a directed acyclic graph: each task can depend on results of one or several other tasks, and there are no directed circular de...
```python n, m = (int(x) for x in input().strip().split()) coproc = [int(x) for x in input().strip().split()] edges = [] for _ in range(m): edges.append((int(x) for x in input().strip().split())) inorder = [0] * n adj = [[] for _ in range(n)] for u, v in edges: adj[v].append(u) inorder[u] += 1 queue0 = [u ...
{'test_cases': [{'type': 'stdin_stdout', 'input': '4 3\n0 1 0 1\n0 1\n1 2\n2 3\n', 'output': '2\n'}, {'type': 'stdin_stdout', 'input': '4 3\n1 1 1 0\n0 1\n0 2\n3 0\n', 'output': '1\n'}, {'type': 'stdin_stdout', 'input': '10 39\n0 1 0 1 0 1 1 0 1 1\n0 1\n0 2\n0 3\n0 4\n0 5\n0 6\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n1 9\n2...
{'difficulty': 'interview', 'problem_url': 'https://codeforces.com/problemset/problem/909/E'}
vfc_15662
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
p00686 Where's Your Robot?
Solve the following coding problem using the programming language python: You have full control over a robot that walks around in a rectangular field paved with square tiles like a chessboard. There are m columns of tiles from west to east, and n rows of tiles from south to north (1 <= m, n <= 100). Each tile is given...
```python while True: col, row = map(int, input().split()) if col == 0: break else: robot = [1, 1] direction = "up" while True: str = input() if str == "STOP": print(robot[0], robot[1]) break elif str == "LEF...
{'test_cases': [{'type': 'stdin_stdout', 'input': '6 5\nFORWARD 3\nRIGHT\nFORWARD 5\nLEFT\nBACKWARD 2\nSTOP\n3 1\nFORWARD 2\nSTOP\n0 0', 'output': '6 2\n1 1'}, {'type': 'stdin_stdout', 'input': '6 5\nFORWARD 3\nRIGHT\nFORWARD 5\nLEFT\nBACKWARD 2\nSTOP\n5 1\nFORWARD 2\nSTOP\n0 0', 'output': '6 2\n1 1\n'}, {'type': 'stdi...
{'difficulty': 0, 'time_limit': {'seconds': 1, 'nanos': 0}, 'memory_limit_bytes': 134217728}
vfc_78289
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
1340_B. Nastya and Scoreboard
Solve the following coding problem using the programming language cpp: Denis, after buying flowers and sweets (you will learn about this story in the next task), went to a date with Nastya to ask her to become a couple. Now, they are sitting in the cafe and finally... Denis asks her to be together, but ... Nastya does...
```cpp #include <bits/stdc++.h> using namespace std; long long mod2 = 1e9 + 7; long long mod = 998244353; const long long N = 2e3 + 12; bool vis[2005][2005]; int n, k, a[10][2005]; string s[] = {"1110111", "0010010", "1011101", "1011011", "0111010", "1101011", "1101111", "1010010", "1111111", "1111011"}, ...
{'test_cases': [{'type': 'stdin_stdout', 'input': '3 5\n0100001\n1001001\n1010011\n', 'output': '-1\n'}, {'type': 'stdin_stdout', 'input': '2 5\n0010010\n0010010\n', 'output': '97\n'}, {'type': 'stdin_stdout', 'input': '1 7\n0000000\n', 'output': '8\n'}, {'type': 'stdin_stdout', 'input': '3 8\n0111010\n1011011\n1011101...
{'difficulty': 8, 'time_limit': {'seconds': 1, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_61348
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
p01132 Make Purse Light
Solve the following coding problem using the programming language cpp: Mr. Bill is shopping at the store. There are some coins in his wallet (10-yen coins, 50-yen coins, 100-yen coins, 500-yen coins), but he is now trying to consume as much of this coin as possible. In other words, by paying for the goods with an appr...
```cpp #include <algorithm> #include <iostream> using namespace std; int mincoin(int a) { int i, j, k, l, n; l = a/500; k = (a%500)/100; j = (a%100)/50; i = (a%50)/10; n = i+k+j+l; return n; } int main() { int price, a, b, c, d, i, j, k, l, p, q, r, s, change, num, tempnum; cin >> price; if (p...
{'test_cases': [{'type': 'stdin_stdout', 'input': '160\n1 1 2 0\n160\n1 0 2 10\n0', 'output': '10 1\n50 1\n100 1\n\n10 1\n100 2'}, {'type': 'stdin_stdout', 'input': '160\n1 1 4 0\n160\n1 0 2 10\n0', 'output': '10 1\n50 1\n100 1\n\n10 1\n100 2\n'}, {'type': 'stdin_stdout', 'input': '160\n1 1 4 0\n58\n2 0 4 10\n0', 'outp...
{'difficulty': 0, 'time_limit': {'seconds': 8, 'nanos': 0}, 'memory_limit_bytes': 134217728}
vfc_68312
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
p01875 Complex Oracle
Solve the following coding problem using the programming language python: D: Complex Oracle --Complex Oracle- problem * This problem is a reactive problem. In other words, it is necessary to create a program that derives the correct answer by interactively responding to the program prepared on the server side. Also,...
{'test_cases': [{'type': 'stdin_stdout', 'input': '', 'output': ''}], 'language': 'python'}
{'difficulty': 0, 'time_limit': {'seconds': 5, 'nanos': 0}, 'memory_limit_bytes': 536870912}
vfc_78737
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
1405_A. Permutation Forgery
Solve the following coding problem using the programming language cpp: A permutation of length n is an array consisting of n distinct integers from 1 to n in arbitrary order. For example, [2,3,1,5,4] is a permutation, but [1,2,2] is not a permutation (2 appears twice in the array) and [1,3,4] is also not a permutation...
```cpp #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); long long int t, n, i; cin >> t; while (t--) { cin >> n; long long int s[n]; for (i = 0; i < n; i++) cin >> s[i]; for (i = n - 1; i >= 0; i--) cout << s[i] << " "; cout << '\n'; } ret...
{'test_cases': [{'type': 'stdin_stdout', 'input': '3\n2\n1 2\n6\n2 1 6 5 4 3\n5\n2 4 3 1 5\n', 'output': '2 1\n3 4 5 6 1 2\n5 1 3 4 2\n'}, {'type': 'stdin_stdout', 'input': '3\n2\n1 2\n6\n2 1 6 5 4 3\n5\n2 4 3 1 5\n', 'output': '2 1\n3 4 5 6 1 2\n5 1 3 4 2\n'}, {'type': 'stdin_stdout', 'input': '3\n2\n1 2\n6\n2 1 6 0 4...
{'difficulty': 7, 'time_limit': {'seconds': 1, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_53456
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
59_C. Title
Solve the following coding problem using the programming language python: Vasya has recently finished writing a book. Now he faces the problem of giving it the title. Vasya wants the title to be vague and mysterious for his book to be noticeable among others. That's why the title should be represented by a single word...
```python import sys from array import array # noqa: F401 def input(): return sys.stdin.buffer.readline().decode('utf-8') k = int(input()) a = list(input().rstrip()) n = len(a) unused = [1] * k def ng(): print('IMPOSSIBLE') exit() try: for i in range(n): if a[i] == '?' and a[n - i - 1] ...
{'test_cases': [{'type': 'stdin_stdout', 'input': '3\na?c\n', 'output': 'IMPOSSIBLE\n'}, {'type': 'stdin_stdout', 'input': '2\na??a\n', 'output': 'abba\n'}, {'type': 'stdin_stdout', 'input': '2\n?b?a\n', 'output': 'abba\n'}, {'type': 'stdin_stdout', 'input': '26\nabcdefghijklmnopqrstuvwxyzfgvnsltvvohywvqhuhtydghtthgdyt...
{'difficulty': 9, 'time_limit': {'seconds': 2, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_78537
PrimeIntellect/verifiable-coding-problems
codeforces
verifiable_code
191
Solve the following coding problem using the programming language cpp: The ancient Berlanders believed that the longer the name, the more important its bearer is. Thus, Berland kings were famous for their long names. But long names are somewhat inconvenient, so the Berlanders started to abbreviate the names of their k...
{'test_cases': [{'type': 'stdin_stdout', 'input': '3\nabc\nca\ncba', 'output': '6'}, {'type': 'stdin_stdout', 'input': '4\nvvp\nvvp\ndam\nvvp', 'output': '0'}, {'type': 'stdin_stdout', 'input': '3\nab\nc\ndef', 'output': '1'}, {'type': 'stdin_stdout', 'input': '5\nab\nbc\ncd\nde\nffffffffff', 'output': '10'}, {'type': ...
{'time_limit': 2000}
vfc_85012
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://www.codechef.com/problems/CATHIEF
Solve the following coding problem using the programming language cpp: A policeman wants to catch a thief. Both the policeman and the thief can only move on a line on integer coordinates between $0$ and $N$ (inclusive). Initially, the policeman is at a coordinate $x$ and the thief is at a coordinate $y$. During each s...
{'test_cases': [{'type': 'stdin_stdout', 'input': '5\n0 1 1 1\n1 4 1 5\n4 2 1 7\n3 7 2 10\n8 2 3 15\n', 'output': 'No\nNo\nYes\nYes\nYes\n'}], 'language': 'cpp'}
{'difficulty': 'MEDIUM', 'problem_url': 'https://www.codechef.com/problems/CATHIEF', 'time_limit': '1 seconds', 'memory_limit': '50000 bytes'}
vfc_98123
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
1089_J. JS Minification
Solve the following coding problem using the programming language python: International Coding Procedures Company (ICPC) writes all its code in Jedi Script (JS) programming language. JS does not get compiled, but is delivered for execution in its source form. Sources contain comments, extra whitespace (including trail...
```python def main(): t = int(input()) reserved = set(input().split()) lines = int(input()) code = '' for i in range(lines): code += input() + '\n' def is_word(suspect): if suspect[0].isdigit(): return False for x in suspect: if (not x.isalpha()) and (not x in {'_', '$'}) and (not x.isdigit()): ret...
{'test_cases': [{'type': 'stdin_stdout', 'input': '16\nfun while return var { } ( ) , ; &gt; = + ++ - --\n9\nfun fib(num) { # compute fibs\n var return_value = 1, prev = 0, temp;\n while (num &gt; 0) {\n temp = return_value; return_value = return_value + prev;\n prev = temp;\n num--;\n }\n return return_va...
{'difficulty': 16, 'time_limit': {'seconds': 1, 'nanos': 500000000}, 'memory_limit_bytes': 512000000}
vfc_48397
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://atcoder.jp/contests/abc062/tasks/arc074_b
Solve the following coding problem using the programming language cpp: Let N be a positive integer. There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements....
{'test_cases': [{'type': 'stdin_stdout', 'input': '2\n3 1 4 1 5 9\n', 'output': '1\n'}, {'type': 'stdin_stdout', 'input': '1\n1 2 3\n', 'output': '-1\n'}, {'type': 'stdin_stdout', 'input': '3\n8 2 2 7 4 6 5 3 8\n', 'output': '5\n'}, {'type': 'stdin_stdout', 'input': '2\n3 1 4 1 7 9', 'output': '-1\n'}, {'type': 'stdin_...
{'difficulty': 'MEDIUM', 'problem_url': 'https://atcoder.jp/contests/abc062/tasks/arc074_b', 'time_limit': '2.0 seconds', 'memory_limit': '256.0 megabytes'}
vfc_124304
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
illegible-string
Solve the following coding problem using the programming language javascript: Your friend Max has written a string S in your textbook. The string consists of lowercase latin letters. The problem is that Max is not good at writing at all! Especially, you never know if he wanted to write "w" or two consecutive "v". Give...
{'test_cases': [{'type': 'stdin_stdout', 'input': '5\navwvb\n\nSAMPLE', 'output': '4 6\n'}, {'type': 'stdin_stdout', 'input': '5\navwvb\n\nSAMPLF', 'output': '4 6\n'}, {'type': 'stdin_stdout', 'input': '5\nvawvb\n\nSAMPLF', 'output': '5 6\n'}, {'type': 'stdin_stdout', 'input': '5\nwawvb\n\nSAMPLF', 'output': '5 7\n'}, ...
{'difficulty': 0, 'time_limit': None, 'memory_limit_bytes': 0}
vfc_62378
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
p01755 AI
Solve the following coding problem using the programming language rust: A robot, a wall, and a goal are installed on the board, and a program that describes the behavior pattern of the robot is given. The given program is represented by the following EBNF. Program: = {statement}; Statement: = if statement | while s...
{'test_cases': [{'type': 'stdin_stdout', 'input': '5 7\n\n.#g..#\n.###.#\ns....#\n\n{T{~C^}>}', 'output': '-1'}, {'type': 'stdin_stdout', 'input': '5 3\n###\n#g#\n#.#\n#s#\n###\n^<^<vv', 'output': '5'}, {'type': 'stdin_stdout', 'input': '5 7\n\n.#g..#\n.###.#\ns....#\n\n{T{~C^}<}', 'output': '17'}, {'type': 'stdin_stdo...
{'difficulty': 0, 'time_limit': {'seconds': 2, 'nanos': 0}, 'memory_limit_bytes': 134217728}
vfc_50839
PrimeIntellect/verifiable-coding-problems
apps
verifiable_code
4614
Solve the following coding problem using the programming language Python: You are the judge at a competitive eating competition and you need to choose a winner! There are three foods at the competition and each type of food is worth a different amount of points. Points are as follows: - Chickenwings: 5 points - H...
null
{'test_cases': [{'type': 'function_call', 'fn_name': 'scoreboard', 'input': [[{'name': 'Billy The Beast', 'chickenwings': 17, 'hamburgers': 7, 'hotdogs': 8}, {'name': 'Habanero Hillary', 'chickenwings': 5, 'hamburgers': 17, 'hotdogs': 11}, {'name': 'Joey Jaws', 'chickenwings': 8, 'hamburgers': 8, 'hotdogs': 15}, {'name...
{'difficulty': 'introductory', 'problem_url': 'https://www.codewars.com/kata/571d2e9eeed4a150d30011e7'}
vfc_9365
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://codeforces.com/problemset/problem/718/A
Solve the following coding problem using the programming language cpp: Efim just received his grade for the last test. He studies in a special school and his grade can be equal to any positive decimal fraction. First he got disappointed, as he expected a way more pleasant result. Then, he developed a tricky plan. Each...
{'test_cases': [{'type': 'stdin_stdout', 'input': '6 1\n10.245\n', 'output': '10.25\n'}, {'type': 'stdin_stdout', 'input': '6 2\n10.245\n', 'output': '10.3\n'}, {'type': 'stdin_stdout', 'input': '3 100\n9.2\n', 'output': '9.2\n'}, {'type': 'stdin_stdout', 'input': '12 5\n872.04488525\n', 'output': '872.1\n'}, {'type': ...
{'difficulty': 'MEDIUM_HARD', 'problem_url': 'https://codeforces.com/problemset/problem/718/A', 'time_limit': None, 'memory_limit': None}
vfc_97086
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
1070_C. Cloud Computing
Solve the following coding problem using the programming language cpp: Buber is a Berland technology company that specializes in waste of investor's money. Recently Buber decided to transfer its infrastructure to a cloud. The company decided to rent CPU cores in the cloud for n consecutive days, which are numbered fro...
```cpp #include <bits/stdc++.h> #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #pragma GCC optimization("unroll-loops") using namespace std; const int N = 200005; long long int tree[2 * N]; long long int tree1[2 * N]; vector<long long int> e(N, 0); vector<long long int> cos1(N, 0); int m; vector<pair<...
{'test_cases': [{'type': 'stdin_stdout', 'input': '7 13 5\n2 3 10 7\n3 5 10 10\n1 2 10 6\n4 5 10 9\n3 4 10 8\n', 'output': '462\n'}, {'type': 'stdin_stdout', 'input': '4 100 3\n3 3 2 5\n1 1 3 2\n2 4 4 4\n', 'output': '64\n'}, {'type': 'stdin_stdout', 'input': '5 7 3\n1 4 5 3\n1 3 5 2\n2 5 10 1\n', 'output': '44\n'}, {'...
{'difficulty': 9, 'time_limit': {'seconds': 3, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_30060
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
111_C. Petya and Spiders
Solve the following coding problem using the programming language rust: Little Petya loves training spiders. Petya has a board n × m in size. Each cell of the board initially has a spider sitting on it. After one second Petya chooses a certain action for each spider, and all of them humbly perform its commands. There ...
{'test_cases': [{'type': 'stdin_stdout', 'input': '1 1\n', 'output': '0\n'}, {'type': 'stdin_stdout', 'input': '2 3\n', 'output': '4\n'}, {'type': 'stdin_stdout', 'input': '1 31\n', 'output': '20\n'}, {'type': 'stdin_stdout', 'input': '6 4\n', 'output': '17\n'}, {'type': 'stdin_stdout', 'input': '2 12\n', 'output': '17...
{'difficulty': 9, 'time_limit': {'seconds': 2, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_50071
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
Solve the following coding problem using the programming language python: Once a Mathematician was trapped by military people during a world war with his forty colleagues. The colleagues were without any weapons, only the mathematician had a knife. And with no weapons they were not able to fight with the military, so ...
```python def survivor(x): if x == 1: return 0 if x % 2 == 0: return 2*survivor(x // 2) else: s = x // 2 + 1 a = (survivor(s) - 1) % s return 2*a def main(): for _ in range(int(input())): x = int(input()) print(survivor(x) + 1) main() ```
{'test_cases': [{'type': 'stdin_stdout', 'input': '952\n2320756\n29322199\n69962176\n35597905\n77503600\n16044585\n78680494\n87353756\n46901578\n54533600\n56732835\n52356252\n3139727\n67375042\n39918429\n47546657\n55270670\n75055313\n37482942\n4607646\n3592454\n42195046\n6958164\n92680150\n74100365\n67455070\n78497675\...
{'difficulty': 'UNKNOWN_DIFFICULTY', 'problem_url': None, 'time_limit': None, 'memory_limit': None}
vfc_113688
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
982_C. Cut 'em all!
Solve the following coding problem using the programming language javascript: You're given a tree with n vertices. Your task is to determine the maximum possible number of edges that can be removed in such a way that all the remaining connected components will have even size. Input The first line contains an intege...
{'test_cases': [{'type': 'stdin_stdout', 'input': '4\n2 4\n4 1\n3 1\n', 'output': '1\n'}, {'type': 'stdin_stdout', 'input': '2\n1 2\n', 'output': '0\n'}, {'type': 'stdin_stdout', 'input': '10\n7 1\n8 4\n8 10\n4 7\n6 5\n9 3\n3 5\n2 10\n2 5\n', 'output': '4\n'}, {'type': 'stdin_stdout', 'input': '3\n1 2\n1 3\n', 'output'...
{'difficulty': 9, 'time_limit': {'seconds': 1, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_49458
PrimeIntellect/verifiable-coding-problems
codeforces
verifiable_code
549
Solve the following coding problem using the programming language javascript: The developers of Looksery have to write an efficient algorithm that detects faces on a picture. Unfortunately, they are currently busy preparing a contest for you, so you will have to do it for them. In this problem an image is a rectangu...
{'test_cases': [{'type': 'stdin_stdout', 'input': '4 4\nxxxx\nxfax\nxcex\nxxxx', 'output': '1'}, {'type': 'stdin_stdout', 'input': '4 2\nxx\ncf\nae\nxx', 'output': '1'}, {'type': 'stdin_stdout', 'input': '2 3\nfac\ncef', 'output': '2'}, {'type': 'stdin_stdout', 'input': '1 4\nface', 'output': '0'}, {'type': 'stdin_stdo...
{'time_limit': 1000}
vfc_83566
PrimeIntellect/verifiable-coding-problems
apps
verifiable_code
2914
Solve the following coding problem using the programming language cpp: Gunnar and his friends like games which involve rolling dice. Gunnar has a huge collection of 6-sided, 12-sided and 20-sided dice. All the games with dice started to bore him, so he came up with a new game. He rolls an $s$-sided die $n$ times and w...
null
{'test_cases': [{'type': 'stdin_stdout', 'input': '3 3 2\n', 'output': '0.888888889\n'}, {'type': 'stdin_stdout', 'input': '3 3 3\n', 'output': '0.222222222\n'}], 'language': 'cpp'}
{'difficulty': 'interview', 'problem_url': 'https://open.kattis.com/problems/dicebetting'}
vfc_21141
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
Solve the following coding problem using the programming language python: Problem Jennifer and Marian presented Carla with the string S. However, Carla is not happy to receive the string S. I wanted the string T. The three decided to work together to change the string S to the string T. Jennifer first sorts the let...
```python (cha, chzn) = (ord('a'), ord('z') + 1) (S, T) = ([0] * 128, [0] * 128) input() a = input() for x in a: S[ord(x)] += 1 S = sorted(S[cha:chzn], reverse=True) a = input() for x in a: T[ord(x)] += 1 T = sorted(T[cha:chzn], reverse=True) ans = 0 for i in range(26): ans += abs(S[i] - T[i]) print(ans >> 1) ```
{'test_cases': [{'type': 'stdin_stdout', 'input': '3\ncba\nxyz', 'output': '0\n'}, {'type': 'stdin_stdout', 'input': '5\naaabb\nxywyz', 'output': '2\n'}, {'type': 'stdin_stdout', 'input': '3\ncbb\nxyz', 'output': '1\n'}, {'type': 'stdin_stdout', 'input': '5\naaacb\nxywyz', 'output': '1\n'}, {'type': 'stdin_stdout', 'in...
{'difficulty': 'UNKNOWN_DIFFICULTY', 'problem_url': None, 'time_limit': '1.0 seconds', 'memory_limit': '267.38688 megabytes'}
vfc_86775
PrimeIntellect/verifiable-coding-problems
codeforces
verifiable_code
166
Solve the following coding problem using the programming language javascript: Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are ...
{'test_cases': [{'type': 'stdin_stdout', 'input': '7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10', 'output': '3'}, {'type': 'stdin_stdout', 'input': '5 4\n3 1\n3 1\n5 3\n3 1\n3 1', 'output': '4'}, {'type': 'stdin_stdout', 'input': '5 1\n2 2\n1 1\n1 1\n1 1\n2 2', 'output': '2'}, {'type': 'stdin_stdout', 'input': '6 3\n2 2...
{'time_limit': 2000}
vfc_81870
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
82_B. Sets
Solve the following coding problem using the programming language python: Little Vasya likes very much to play with sets consisting of positive integers. To make the game more interesting, Vasya chose n non-empty sets in such a way, that no two of them have common elements. One day he wanted to show his friends just ...
```python c, v = [[0] * 201 for i in range(201)], [] n = int(input()) for i in range(n * (n - 1) // 2): a = list(map(int, input().split()))[1:] for x in a: for y in a: c[x][y] += 1 for i, ci in enumerate(c): if ci[i]: a = [j for j, cij in enumerate(ci) if cij == n - 1] v....
{'test_cases': [{'type': 'stdin_stdout', 'input': '4\n5 6 7 8 9 100\n4 7 8 9 1\n4 7 8 9 2\n3 1 6 100\n3 2 6 100\n2 1 2\n', 'output': '1 1 \n1 2 \n2 6 100 \n3 7 8 9 \n'}, {'type': 'stdin_stdout', 'input': '4\n3 2 7 4\n3 1 7 3\n3 5 4 2\n3 1 3 5\n4 3 1 2 4\n2 5 7\n', 'output': '2 1 3 \n2 2 4 \n1 5 \n1 7 \n'}, {'type': 'st...
{'difficulty': 8, 'time_limit': {'seconds': 2, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_41517
PrimeIntellect/verifiable-coding-problems
apps
verifiable_code
3518
Solve the following coding problem using the programming language rust: This is a very exciting week for John. The reason is that, as a middle school teacher, he has been asked to dedicate the entire week to teaching his class of $n$ students about the cause and effect of global warming. As John is very passionate abo...
null
{'test_cases': [{'type': 'stdin_stdout', 'input': '5 4\n3 1 375\n2 5 283\n1 4 716\n3 4 98\n', 'output': 'impossible\n'}, {'type': 'stdin_stdout', 'input': '6 7\n5 6 600\n2 5 200\n3 5 400\n6 3 500\n1 4 300\n3 2 400\n6 2 200\n', 'output': '900\n'}], 'language': 'rust'}
{'difficulty': 'competition', 'problem_url': 'https://open.kattis.com/problems/globalwarming'}
vfc_22952
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
586_C. Gennady the Dentist
Solve the following coding problem using the programming language python: Gennady is one of the best child dentists in Berland. Today n children got an appointment with him, they lined up in front of his office. All children love to cry loudly at the reception at the dentist. We enumerate the children with integers f...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- n = int(input()) C = [list(map(int,input().split())) for i in range(0,n)] ans = [] for i in range(n): v, d, p = C[i] if p >= 0: count = 0 d0 = 0 for j in range(i + 1, n): if C[j][2] >= 0: C[j][2] -= m...
{'test_cases': [{'type': 'stdin_stdout', 'input': '5\n4 2 2\n4 1 2\n5 2 4\n3 3 5\n5 1 2\n', 'output': '2\n1 3'}, {'type': 'stdin_stdout', 'input': '5\n4 5 1\n5 3 9\n4 1 2\n2 1 8\n4 1 9\n', 'output': '4\n1 2 4 5'}, {'type': 'stdin_stdout', 'input': '10\n10 3 3\n8 6 17\n9 5 26\n10 7 17\n3 10 29\n3 1 27\n3 3 7\n8 10 28\n1...
{'difficulty': 9, 'time_limit': {'seconds': 1, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_53137
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
1388_D. Captain Flint and Treasure
Solve the following coding problem using the programming language javascript: Captain Fint is involved in another treasure hunt, but have found only one strange problem. The problem may be connected to the treasure's location or may not. That's why captain Flint decided to leave the solving the problem to his crew and...
{'test_cases': [{'type': 'stdin_stdout', 'input': '3\n1 2 3\n2 3 -1\n', 'output': '10\n1 2 3 \n'}, {'type': 'stdin_stdout', 'input': '10\n-10 -1 2 2 5 -2 -3 -4 2 -6\n-1 -1 2 2 -1 5 5 7 7 9\n', 'output': '-9\n3 4 2 9 5 7 10 8 6 1\n'}, {'type': 'stdin_stdout', 'input': '2\n-1 100\n2 -1\n', 'output': '99\n2 1\n'}, {'type'...
{'difficulty': 10, 'time_limit': {'seconds': 2, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_40962
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
248_B. Chilly Willy
Solve the following coding problem using the programming language cpp: Chilly Willy loves playing with numbers. He only knows prime numbers that are digits yet. These numbers are 2, 3, 5 and 7. But Willy grew rather bored of such numbers, so he came up with a few games that were connected with them. Chilly Willy want...
```cpp #include <bits/stdc++.h> using namespace std; const int N = 100005; vector<int> vmod, ans; int main() { int i, j, k, l; vmod.push_back(0); vmod.push_back(0); vmod.push_back(0); vmod.push_back(100); i = 4; while (i < N) { vmod.push_back((vmod[i - 1] * 10) % 210); i++; } int n, x; cin >...
{'test_cases': [{'type': 'stdin_stdout', 'input': '5\n', 'output': '10080\n'}, {'type': 'stdin_stdout', 'input': '1\n', 'output': '-1\n'}, {'type': 'stdin_stdout', 'input': '99996\n', 'output': '10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
{'difficulty': 8, 'time_limit': {'seconds': 2, 'nanos': 0}, 'memory_limit_bytes': 256000000}
vfc_32672
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://codeforces.com/problemset/problem/127/A
Solve the following coding problem using the programming language cpp: Mr. Scrooge, a very busy man, decided to count the time he wastes on all sorts of useless stuff to evaluate the lost profit. He has already counted the time he wastes sleeping and eating. And now Mr. Scrooge wants to count the time he has wasted si...
{'test_cases': [{'type': 'stdin_stdout', 'input': '48 447\n14 9\n9 -17\n-17 11\n-14 14\n19 -8\n-14 -17\n-7 10\n-6 -11\n-9 -19\n19 10\n-4 2\n-5 16\n20 9\n-10 20\n-7 -17\n14 -16\n-2 -10\n-18 -17\n14 12\n-6 -19\n5 -18\n-3 2\n-3 10\n-5 5\n13 -12\n10 -18\n10 -12\n-2 4\n7 -15\n-5 -5\n11 14\n11 10\n-6 -9\n13 -4\n13 9\n6 12\n-...
{'difficulty': 'EASY', 'problem_url': 'https://codeforces.com/problemset/problem/127/A', 'time_limit': '2.0 seconds', 'memory_limit': '256.0 megabytes'}
vfc_114783
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://codeforces.com/problemset/problem/224/D
Solve the following coding problem using the programming language javascript: A subsequence of length |x| of string s = s1s2... s|s| (where |s| is the length of string s) is a string x = sk1sk2... sk|x| (1 ≤ k1 < k2 < ... < k|x| ≤ |s|). You've got two strings — s and t. Let's consider all subsequences of string s, co...
{'test_cases': [{'type': 'stdin_stdout', 'input': 'babaabaabb\nbbccb\n', 'output': 'No\n'}, {'type': 'stdin_stdout', 'input': 'aaaaaa\naaaaaaa\n', 'output': 'No\n'}, {'type': 'stdin_stdout', 'input': 'abcdadbcd\nabcd\n', 'output': 'Yes\n'}, {'type': 'stdin_stdout', 'input': 'abaaaaba\nabba\n', 'output': 'No\n'}, {'type...
{'difficulty': 'HARD', 'problem_url': 'https://codeforces.com/problemset/problem/224/D', 'time_limit': '2.0 seconds', 'memory_limit': '256.0 megabytes'}
vfc_135461
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://codeforces.com/problemset/problem/465/A
Solve the following coding problem using the programming language python: Sergey is testing a next-generation processor. Instead of bytes the processor works with memory cells consisting of n bits. These bits are numbered from 1 to n. An integer is stored in the cell in the following way: the least significant bit is ...
```python N = int(input()) S = input() flg = True ans = 0 for s in S: if flg: if s == '0': ans += 1 flg = False elif s == '1': ans += 1 flg = True print(ans) ```
{'test_cases': [{'type': 'stdin_stdout', 'input': '4\n1100\n', 'output': '3\n'}, {'type': 'stdin_stdout', 'input': '4\n1111\n', 'output': '4\n'}, {'type': 'stdin_stdout', 'input': '1\n0\n', 'output': '1\n'}, {'type': 'stdin_stdout', 'input': '1\n1\n', 'output': '1\n'}, {'type': 'stdin_stdout', 'input': '2\n00\n', 'outp...
{'difficulty': 'EASY', 'problem_url': 'https://codeforces.com/problemset/problem/465/A', 'time_limit': None, 'memory_limit': None}
vfc_137783
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
https://www.codechef.com/problems/CHKPTS
Solve the following coding problem using the programming language cpp: Chef has $N$ points (numbered $1$ through $N$) in a 2D Cartesian coordinate system. For each valid $i$, the $i$-th point is $(x_i, y_i)$. He also has a fixed integer $c$ and he may perform operations of the following type: choose a point $(x_i, y_i...
{'test_cases': [{'type': 'stdin_stdout', 'input': '1\n3 1\n1 1\n1 0\n3 2\n', 'output': '2 2\n'}], 'language': 'cpp'}
{'difficulty': 'VERY_HARD', 'problem_url': 'https://www.codechef.com/problems/CHKPTS', 'time_limit': '1 seconds', 'memory_limit': '50000 bytes'}
vfc_131971
PrimeIntellect/verifiable-coding-problems
taco
verifiable_code
Solve the following coding problem using the programming language python: Problem Statement We can describe detailed direction by repeating the directional names: north, south, east and west. For example, northwest is the direction halfway between north and west, and northnorthwest is between north and northwest. In...
```python import re while 1: s = input() if s == '#': break s = re.split('[w|n]', s)[1:] c = 1 d = 90 if s[-1] == 'est' else 0 for x in s[:-1][::-1]: d *= 2 d += 90 if x == 'est' else -90 c *= 2 while d & 1 == 0 and c & 1 == 0: d //= 2 c //= 2 if c == 1: print(d) else: print(d, c, sep='/') ```
{'test_cases': [{'type': 'stdin_stdout', 'input': 'north\nwest\nnorthwest\nnorthnorthwest\nwestwestwestnorth\n#', 'output': '0\n90\n45\n45/2\n315/4'}], 'language': 'python'}
{'difficulty': 'UNKNOWN_DIFFICULTY', 'problem_url': None, 'time_limit': '8.0 seconds', 'memory_limit': '536.870912 megabytes'}
vfc_130948
PrimeIntellect/verifiable-coding-problems
code_contests
verifiable_code
p01633 Hole
Solve the following coding problem using the programming language rust: Problem Statement Mr. Hagiwara, a witch, has a very negative personality. When she feels depressed, she uses the magic of digging to make holes and cry and fill them. The magic of digging is as follows. She first draws N line segments on the gro...
{'test_cases': [{'type': 'stdin_stdout', 'input': '11\n0 0 10 0\n10 0 10 10\n10 10 0 10\n0 10 0 0\n1 2 9 2\n8 1 8 9\n9 8 1 8\n2 9 2 1\n8 11 11 8\n8 11 14 10\n11 8 10 14', 'output': '1'}, {'type': 'stdin_stdout', 'input': '8\n5 0 5 10\n5 10 0 5\n0 5 5 0\n10 0 10 10\n10 10 5 5\n5 5 10 0\n10 2 15 5\n15 5 10 8', 'output': ...
{'difficulty': 0, 'time_limit': {'seconds': 1, 'nanos': 0}, 'memory_limit_bytes': 134217728}
vfc_75823
PrimeIntellect/verifiable-coding-problems